Conversation
|
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. |
There was a problem hiding this comment.
Pull request overview
This PR addresses missing disabled-state visuals for CheckboxControl so a checked+disabled checkbox no longer appears identical to an enabled checkbox (notably in DataForm Storybook scenarios). It adds disabled styling at the component stylesheet level and tweaks a DataForm story to display both boolean control variants together.
Changes:
- Add
:disabled-driven styling toCheckboxControl(opacity + cursor adjustments), including dimming the checkmark icon uniformly. - Update the DataForm “Layout Regular” story to render
can_commentas a toggle and place it next to thestickyboolean field for easier visual comparison.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/components/src/checkbox-control/style.scss | Adds disabled-state cursor handling and dims the entire input container (including SVG icons) when the checkbox input is disabled. |
| packages/dataviews/src/dataform/stories/layout-regular.tsx | Adjusts the boolean field presentation/order in Storybook to show both checkbox and toggle variants together. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Size Change: +119 B (0%) Total Size: 7.74 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 52558bb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24128137087
|
|
There's this conversation about whether we go this route or another that's important to figure out for this PR to land: #77127 (comment) |
Follow-up to #77090
What?
Add disabled styles for the
CheckboxControlcomponent.Why?
The
CheckboxControlcomponent had no CSS styles for the:disabledstate. When a checkbox was both checked and disabled, the blue accent background ($components-color-accent) rendered at full opacity, making it visually indistinguishable from an enabled checkbox.This was visible in the DataForm field types boolean story where setting
disabled: truehad no visual effect on the checkbox.How?
:disabledstyles topackages/components/src/checkbox-control/style.scss:opacity: 0.3on.components-checkbox-control__input-container:has(:disabled)to dim both the custom-styled input and the absolutely-positioned SVG checkmark icon uniformly — matching the toggle's disabled opacity.cursor: defaulton the disabled input and on the label (via.components-checkbox-control:has(:disabled)).Edit: 'toggle'for thecan_commentfield and moved it next to thestickycheckbox so both boolean control variants are visible together.Testing Instructions
npm run storybook.True.Use of AI Tools
Claude Code was used to assist with identifying the root cause and implementing the fix.