Skip to content

Fix missing custom duotone creation menu in duotone controls - #77649

Open
prachigarg19 wants to merge 2 commits into
WordPress:trunkfrom
prachigarg19:fix/68549-custom-duotone-missing
Open

prachigarg19 wants to merge 2 commits into
WordPress:trunkfrom
prachigarg19:fix/68549-custom-duotone-missing

Conversation

@prachigarg19

@prachigarg19 prachigarg19 commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

What?

Closes #58548

Fixes the missing custom duotone creator in the block sidebar by making FiltersPanel read customDuotone and custom (color) settings instead of always passing hardcoded disableCustomColors and disableCustomDuotone to DuotonePicker.

Removed the custom duotone creator at Global block settings level as per the comment: #58548 (comment)

Why?

When editing an Image or Cover block, the custom duotone creator (the color picker that lets you build a two-tone filter from scratch) appeared in the block toolbar but was completely absent from the block sidebar. This was a regression caused by a hardcoded disableCustomColors and disableCustomDuotone in FiltersPanel, originally added with a TODO comment noting it should be re-enabled when block-level custom colors were supported.

How?

In filters-panel.js:

Extracted a getCustomDuotoneFlags( settings, colorPalette, enableCustomDuotone ) helper that derives disableCustomColors and disableCustomDuotone from the actual block settings, matching the logic already used in the toolbar path (DuotonePanelPure in duotone.js).

Added an enableCustomDuotone prop on FiltersPanel (defaults to true) to allow callers to opt out if needed.

Removed the hardcoded disableCustomColors and disableCustomDuotone from DuotonePicker, replacing them with the values computed from settings.

Testing Instructions

  1. Activate a block theme.
  2. Open a post in the Editor.
  3. Insert an Image block and upload or select an image.
  4. Open the block sidebar (Inspector Controls).
  5. Scroll to the Filters panel and click the Duotone toggle.

Screenshots or screencast

Before After
Sidebar shows only preset swatches, no custom creator Sidebar shows custom duotone color picker
image image
Custom creator present in global site editor settings Disabled custom creator in global editor settings
image image

Use of AI Tools

This PR was developed with assistance from Claude for code generation and iteration. All changes were reviewed and verified manually.

@prachigarg19
prachigarg19 requested a review from ellatrix as a code owner April 24, 2026 12:45
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: prachigarg19 <prachigarg19@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: graylaurenm <oncecoupled@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: SirLouen <sirlouen@git.wordpress.org>
Co-authored-by: webexpr-dhenriet <dhenriet@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Apr 24, 2026
@prachigarg19 prachigarg19 changed the title Fix/68549 custom duotone missing Fix missing custom duotone creation menu in duotone controls Apr 24, 2026
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Apr 27, 2026

This branch has not been deployed

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

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom duotone menu has disappeared

2 participants