Skip to content

Icon Picker: Restore option to hide colors#20650

Merged
AndyButland merged 4 commits intoumbraco:mainfrom
bjarnef:feature/icon-picker-hide-colors
Dec 11, 2025
Merged

Icon Picker: Restore option to hide colors#20650
AndyButland merged 4 commits intoumbraco:mainfrom
bjarnef:feature/icon-picker-hide-colors

Conversation

@bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Oct 25, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes

Description

This PR fix part of the discussion in #20647 and add the option to hide colors from icon picker, which was previously available in the old backoffice UI: #13079

It would be great if we furthermore can pass in an arrray of color/swatch modal to override the umbracoColors array, but I still think it is useful explicit to hide colors even though colors may be defined.

Example:

const modalContext = modalManager.open(this, UMB_ICON_PICKER_MODAL, {
  value: {
    icon: alias,
    color: color,
  },
  data: { hideColors: true }
});
image

or via configuration of Umb.PropertyEditorUi.IconPicker.

{
  alias: 'icon',
  label: 'Workspace View icon',
  description: "The icon for the Collection's Workspace View.",
  propertyEditorUiAlias: 'Umb.PropertyEditorUi.IconPicker',
  config: [
    { alias: 'placeholder', value: 'icon-grid' },
    { alias: 'hideColors', value: true },
  ],
}
image

Copilot AI review requested due to automatic review settings October 25, 2025 16:38
@github-actions
Copy link

github-actions bot commented Oct 25, 2025

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the ability to hide the color picker section in the icon picker modal, restoring functionality that existed in the old backoffice UI. This allows developers to programmatically hide colors when opening the icon picker modal by setting hideColors: true in the modal data.

Key Changes:

  • Added hideColors property to the icon picker property editor and modal interfaces
  • Refactored color picker rendering into a conditional renderColors() method

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
property-editor-ui-icon-picker.element.ts Adds hideColors property and passes it to the modal data
icon-picker-modal.token.ts Extends modal data interface with optional hideColors boolean field
icon-picker-modal.element.ts Refactors color picker rendering into conditional method that respects hideColors flag

@emmagarland
Copy link
Collaborator

Hi again @bjarnef!

Thanks for this PR to fix part of the discussion in #20647 and add the option to hide colours from the icon picker (previously available in the old backoffice UI).

I've just seen some merge conflicts that don't look easy to auto-resolve - are you comfortable to look into those before one of the team take a look at this?

Best regards

Emma

@bjarnef
Copy link
Contributor Author

bjarnef commented Dec 1, 2025

@nielslyngsoe @AndyButland is it possible we can bring back this feature? 🙏

In a current project on 16.3.4, I am re-using icon picker / icon modal, but would really like to hide colors as it was possible in Umbraco 13 😎

If possible it would be great if it can be included in 16.5.0

@bjarnef
Copy link
Contributor Author

bjarnef commented Dec 10, 2025

@AndyButland I think it is considered a regression this wasn't re-implemented in v17 :)

@AndyButland
Copy link
Contributor

I think this will be a nice addition @bjarnef. If you could get it up to date with main, fix up the merge conflicts and consider if the Copilot comment is relevant please, I can give it a test and include. And backport for 16.5 if that's useful. Please let me know when you have the PR ready.

…on-picker-hide-colors

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.ts
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this out and it all works as expected. You can define the icon picker to have the colour selections hidden, and choosing icons works correctly whether colours are shown or not. Thanks for the contribution @bjarnef.

@AndyButland AndyButland merged commit 23e8ee5 into umbraco:main Dec 11, 2025
28 checks passed
@AndyButland AndyButland changed the title Add option to hide colors from icon picker Icon Picker: Add option to hide colors Dec 11, 2025
@bjarnef bjarnef deleted the feature/icon-picker-hide-colors branch December 11, 2025 05:41
AndyButland added a commit that referenced this pull request Dec 11, 2025
* Add option to hide colors from icon picker

* Hide colors

* Hide colors from config
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-picker-modal/icon-picker-modal.element.ts
@AndyButland
Copy link
Contributor

AndyButland commented Dec 11, 2025

Backported to v16/dev for 16.5 via 1a4256f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants