Repository navigation
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Could we model the three supported presentations explicitly?
@WordPress/gutenberg-components what do you think? |
|
|
||
| - `Modal`: Prevent an Escape key press that dismisses the modal from propagating to underlying overlays. ([#81785](https://github.com/WordPress/gutenberg/pull/81785)) | ||
| - `BoxControl`: Update the opposite side when ALT is held on the left or right input, which each updated themselves instead ([#81530](https://github.com/WordPress/gutenberg/pull/81530)). | ||
| - `PaletteEdit`: Expose palette swatches as buttons instead of a listbox, since activating a swatch opens the editor rather than selecting a value ([#81800](https://github.com/WordPress/gutenberg/issues/81800)). |
There was a problem hiding this comment.
| - `PaletteEdit`: Expose palette swatches as buttons instead of a listbox, since activating a swatch opens the editor rather than selecting a value ([#81800](https://github.com/WordPress/gutenberg/issues/81800)). | |
| - `PaletteEdit`: Expose palette swatches as buttons instead of a listbox, since activating a swatch opens the editor rather than selecting a value ([#81836](https://github.com/WordPress/gutenberg/pull/81836)). |
|
@dilipom13 Let us know once you've addressed current review feedback, thank you 🙏 We're not going to do another round of review until then. Alternatively, if you can't continue the work here, let us know and we'll close this PR (and open a new one to continue) |
Thanks @ciampo |
Keep the Duotone picker from WordPress#81605 and apply asButtons to Color, Gradient, and Duotone swatches. Point the CHANGELOG entry at WordPress#81836. Co-authored-by: Cursor <cursoragent@cursor.com>
3b5575a to
e32c48c
Compare
Keep presentation off the DOM, restore aria-pressed for toggle buttons, and refresh the Storybook/docs snapshots. Co-authored-by: Cursor <cursoragent@cursor.com>
Deprecated props still appear in the Storybook snapshot when the tag is not part of the description text. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hello @ciampo, I've addressed the feedback:
Ready for another look when you have a minute. Please review it and let me know. if any thing missing from my side. Thank you. |
There was a problem hiding this comment.
To complete the deprecation, we should also:
- Migrate Cover and the story to presentation="toggle-buttons".
- Keep
asButtonssupported and type-deprecated, but hide it from generated/public documentation (using the@ignoretag in the prop's JSDocs) - Emit the warning at each public picker boundary.
- Test both compatibility and the warning.
We should update ColorPalette's README to document presentation, deprecate asButtons. While we're doing that, let's also correct the repeated loop description across Circular, Color, Gradient, and Duotone: loop applies only when the resolved presentation is listbox; explicit presentation takes precedence over asButtons.
Finally, the PR description is not out of date, let's update it to reflect latest changes and approach.
| * | ||
| * @default 'listbox' | ||
| */ | ||
| presentation?: 'listbox' | 'toggle-buttons' | 'command-buttons'; |
There was a problem hiding this comment.
presentation="command-buttons" can be combined with value or selectedSlug. All three pickers then show a selected check and clear the value when the selected button is activated, but command mode removes aria-pressed. This creates toggle behavior whose state is not exposed to assistive technology.
PaletteEdit is safe because it passes no selection prop, but the new public API permits this combination. Could command mode exclude value/selectedSlug, or ignore selection and selected-item clearing? Please test the chosen behavior through Color, Gradient, and Duotone.
There was a problem hiding this comment.
Hello @ciampo
- Migrated Cover and the CircularOptionPicker story to presentation="toggle-buttons"
- Hid asButtons from docs / Storybook with @ignore (still supported and type-deprecated)
- Added wrapper-level deprecation warnings on ColorPalette, GradientPicker, and DuotonePicker
- Added compatibility + warning tests
- Updated READMEs (presentation, corrected loop description)
There was a problem hiding this comment.
I believe this reply was meant for this thread, while this thread is still unaddressed.
| asButtons | ||
| ); | ||
|
|
||
| // Prefer `presentation` so wrappers do not keep passing deprecated `asButtons`. |
There was a problem hiding this comment.
Could we complete the package’s soft-deprecation sequence for asButtons?
The Components guidance is to hide the legacy API from documentation, migrate Gutenberg consumers, and only then add runtime warnings. Cover and the CircularOptionPicker story still use asButtons, while the public pickers convert it to presentation before the current warning can run.
Please migrate those consumers to presentation="toggle-buttons", hide asButtons from generated and manual docs while keeping it type-deprecated and supported, then warn at the ColorPalette, GradientPicker, and DuotonePicker boundaries. A wrapper-level compatibility and warning test would complete the deprecation path.
There was a problem hiding this comment.
Okay
So @ciampo do I need to do anything else from my side?
There was a problem hiding this comment.
Yup, pretty much everything listed in the previous comment and here 😅
Covercomponent and theCircularOptionPickerstory still useasButtons, they should be refactored to the newpresentation="toggle-buttons"prop;- The prop needs
@ignoreto its JSDocs comment; it needs to be removed from generated and manual docs, and from the Storybook manifest - Make the public ColorPalette, GradientPicker, and DuotonePicker wrappers also warn when the deprecated
asButtonsprop is received
Migrate Cover and stories to presentation, hide asButtons from docs, and warn at public picker boundaries. Co-authored-by: Cursor <cursoragent@cursor.com>
Storybook docgen still emits asButtons, so the snapshot must include it while the prop stays soft-deprecated in docs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@dilipom13 I decided to continue the work in #82023 — the current feedback loop is too slow (I'm finding myself repeating the same feedback, previous feedback doesn't get addressed) and it's time-consuming for me as the reviewer. I'll make sure to mention you as a co-author in the new PR. Thank you for your help! |
Okay @ciampo Am I experiencing the same issue on my end as well? |
Fixes #81800
What?
In Global Styles -> Edit palette, colour and gradient swatches were exposed as a listbox even though clicking one opens the edit popover.
Why?
Screen readers announce a listbox with options, but none are ever selected, and activation opens an editor, not a selection. That mismatch is what #81800 reports.
How?
Pass
asButtonsto theColorPaletteandGradientPickerinsidePaletteEdit. Swatches become regular buttons instead of listbox options.Also updates the style-variations e2e locators (
role=option->role=button).Testing Instructions
role=" button", notrole=" option"Testing Instructions for Keyboard
Same flow, keyboard only. Tab to a swatch and press Enter; the popover should open.
Use of AI Tools
None