Repository navigation
DataViews: Keep interaction states in the same WPDS color tone - #87452
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -11.7 kB (-0.13%) Total Size: 8.72 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. should undo without broken temporary state in
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0e977f9 to
34d942f
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
My bad, I thought I had fixed it already. I'll look into it again
It absolutely does, it's something we had also recently discussed with @mirka |
|
@jameskoster I'm realizing that screenshot you're showing is not currently implemented in this PR, the description above that section says:
It's basically an experiment that I ran using This is what the focus rings around the chip look like in this PR: Screen.Recording.2026-11-27.at.17.05.04.movApart from that, was there anything else that needs changing? |
|
Just the stroke color on selected items. I'd also appreciate a gut-check on the switch from blueberry to neutral tones for selected items in DataViews. Like #87426 this is fine with me but others might have stronger feelings. |
That's done, too. Re. switching from blueberry to neutral tones for selected items, that goes against one of the main principles behind how we constructed the color scales and WPDS token pairings:
The colors ramps do have some influence on each other (we try to match the brightness for what's possible and recently also introduced a min 3:1 contrast constraint between the branded focus color and neutral surfaces)), but we can't easily guarantee that mixing tones on the same element based on resting/active states will always look good/balanced and accessible. For example, we applied this same rule to our buttons and links (neutral buttons stay neutral, branded buttons stay branded). Some notable exceptions are:
For this specific case, the "selected" status is also reinforced by the checkbox, another thing to keep in mind |
I've had that thought too, and concluded there are only a few places we'd actually use the brand palette. Basically just buttons, links, and focus rings. |
|
Assuming that it's a separate (follow-up) topic, I guess that this PR should be in a good state for a final check / approval? |
jameskoster
left a comment
There was a problem hiding this comment.
It works for me. I'd appreciate a +1 from another person in the design group on the dataviews selection states, but in lieu of that we can always follow-up where necessary.
|
I honestly don't love the neutral colour for row-selections, but I also don't think me blocking it at this point is actually useful. We can feel it out. I think what bugs me more is actually the border at the to and bottom—could we have those only for the active state of List View layout? The checkbox is plenty indicator of selection, the rest is really decoration. |
Rows, filter options, title links and DataForm panel fields used neutral tokens at rest and switched to brand tokens on hover, focus or selection. Use the matching neutral token for those states, and pair brand with brand where the element is brand-toned (filter chip remove button with values, filter count badge). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd the panel edit button with @wordpress/ui - Selected rows in the table, list, picker table and picker activity layouts use stroke-surface-neutral-strong. - Filter options use the highlight colors, spacing and check indicator of the Select and Menu items in @wordpress/ui. - The DataForm panel edit button is a neutral minimal IconButton from @wordpress/ui. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tons - Selected grid and picker grid cards use a stroke-surface-neutral-strong ring. - Table header buttons override the brand hover of the tertiary components Button with neutral tokens. - Hovered list fields, hovered filter chips and the sticky infinite scroll actions use the matching neutral tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Selected grid and picker grid cards get a rounded outline outside the preview, so it stays visible on any image. The grids get a top padding so the first row's ring is not clipped. - Selected rows and cards use foreground-interactive-neutral, the color of the selected Tabs indicator in @wordpress/ui, for a stronger selection line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Selected rows in the table, list, picker table and picker activity layouts use stroke-surface-neutral-strong instead of foreground-interactive-neutral. A row is not an interactive control by itself, and the darker line was too strong. Grid cards keep the dark ring.
Table and picker table rows show a checkbox, so the gray lines above and below a selected row only add decoration. Only the selected item of the list layout, which has no checkbox, keeps them.
Hide the row lines above and below a selected row, and a hovered row in the picker table, so the selection is one gray block with even edges. Fill the space kept for the row line with the row background: the sticky fade and actions cells do not paint it, and the table background showed through as a white line.
39d481e to
0f3dc94
Compare
|
@jasmussen that should addressed. I'm going to merge this PR to unblock further work, but always happy to iterate as needed. |
#87452 already gave the sticky view actions of an infinite-scroll view the --wp-dataviews-color-background color, falling back to the surface color. Keep that, so a custom background still applies, and drop the changelog entry this change no longer needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#87452 moved the selection ring of grid and picker grid previews outside the preview, where the focus ring is too. On a selected and focused item, draw the focus ring one focus width past the selection ring, so both stay visible: - Grid: the preview has one outline for both rings, so the outline draws the focus ring and a shadow draws the selection ring, over a gap filled with the DataViews background. - Picker grid: the card's focus ring moves out past the preview's selection ring, and the card gets the preview's corner radius so the ring follows it. Grow the room above the first row, and the scroll margins, to fit both rings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coming to second @jasmussen input. The border feels very high contrast compared to the brand tone. The checkbox is the main indicator that item is selected. |
|
@fcoveram that should be addressed (see updated screenshots in PR description) |
|
Nice ✨ I can see it now |
#87452 already gave the sticky view actions of an infinite-scroll view the --wp-dataviews-color-background color, falling back to the surface color. Keep that, so a custom background still applies, and drop the changelog entry this change no longer needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#87452 moved the selection ring of grid and picker grid previews outside the preview, where the focus ring is too. On a selected and focused item, draw the focus ring one focus width past the selection ring, so both stay visible: - Grid: the preview has one outline for both rings, so the outline draws the focus ring and a shadow draws the selection ring, over a gap filled with the DataViews background. - Picker grid: the card's focus ring moves out past the preview's selection ring, and the card gets the preview's corner radius so the ring follows it. Grow the room above the first row, and the scroll margins, to fit both rings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* DataViews: Use WPDS tokens for focus rings Move the focus rings that still use --wp-admin-border-width-focus or a hard-coded 2px width to the outset-ring__focus() mixin or the --wpds-border-width-focus token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add changelog entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Use the focus ring mixin for picker and grid media rings Draw the picker grid, picker table and grid media rings with the outset-ring__focus() mixin, inside the item, so that the scroll container does not clip them. Remove the default outline that doubled the grid media ring, and the focus rule for the picker grid media, which never receives focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update changelog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Keep focus rings distinct from selection and admin link styles Draw the grid preview ring outside the preview, so it stays distinct from the selection ring. Clear the WordPress common.css box-shadow on focused title links. Move the picker table ring below the line above the row, so the sticky end cells no longer cover it. Remove the panel trigger's own outline, which the Button focus ring already overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw preview focus rings inside, past the selection ring Draw the grid preview and picker grid card focus rings inside the item, past the selection ring, so that they stay distinct from it and the scroll container can't clip them. Clear the WordPress common.css box-shadow on focused preview and activity title links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw the picker card ring outside, with room above the grid Draw the picker grid card ring outside the card, clear of its content, and reserve room above the first row so the scroll container doesn't clip it. Draw the grid preview ring on its overlay, above positioned preview content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw grid focus rings outside items, with room to show them Draw the grid preview ring outside the preview, where its content can't cover it, and the table thumbnail ring with the focus ring mixin. Leave room above the first row of the grid layouts and add scroll margins, so neither the scroll container nor keyboard scrolling clips the rings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Show focus rings of title links and below the bulk toolbar Let the grid and list title fields show the focus ring of a link they contain, and keep focused grid items, focus rings included, below the sticky bulk toolbar. Describe the visible focus ring changes in the changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Cover title buttons and pointer focus on activity title links Let the grid and list title fields show the focus ring of a button as well as a link, and clear the WordPress common.css shadow on activity title links for any focus, not only keyboard focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Show title overflow only for links and link buttons Only the links and link buttons that DataViews truncates stay within the title field, so show overflow only while one of them has focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Hug title links with their focus ring instead of opening overflow Opening the title field's overflow let content that doesn't truncate itself escape it. Draw the ring of a link in a title field with no offset instead, so it fits in the room the layouts leave above and below it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Leave room for focus rings in item titles Give the grid, list and activity item titles room inside their clipping box for the focus rings of links and buttons in them, with padding and a matching negative margin that keep their layout. Document pairing a custom background with a ThemeProvider, so focus rings keep contrast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Keep list rows clickable around title links Let pointer events pass through a list title that holds a link or button, except on those, so its room for focus rings doesn't take clicks from the row. Recommend a ThemeProvider background over the CSS property for custom DataViews backgrounds, and checking the focus ring otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Restore list title pointer behavior and theme the toolbar Passing pointer events through list titles cost text selection and other controls in them, so keep the base behavior and note what the room for focus rings adds to it. Give the sticky infinite-scroll view actions the DataViews background instead of white, so themed focus rings keep their contrast there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Leave room for focus rings in picker grid titles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Keep the infinite-scroll toolbar opaque; drop picker title room Paint the DataViews background over an opaque surface in the sticky infinite-scroll view actions, so items don't show through with a translucent background. Picker cards are listbox options, which can't hold links accessibly, so drop the room for title focus rings there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Use the surface color for the sticky toolbar; scope title room Give the sticky infinite-scroll view actions the design system surface color: opaque like the white it replaces, and themed by a ThemeProvider together with the icons in it. Only make room for focus rings in item titles that hold a link or button, so text-only titles keep their edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Narrow the title focus ring changelog and ThemeProvider docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Keep the custom background on the infinite-scroll toolbar #87452 already gave the sticky view actions of an infinite-scroll view the --wp-dataviews-color-background color, falling back to the surface color. Keep that, so a custom background still applies, and drop the changelog entry this change no longer needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw grid focus rings past the selection ring #87452 moved the selection ring of grid and picker grid previews outside the preview, where the focus ring is too. On a selected and focused item, draw the focus ring one focus width past the selection ring, so both stay visible: - Grid: the preview has one outline for both rings, so the outline draws the focus ring and a shadow draws the selection ring, over a gap filled with the DataViews background. - Picker grid: the card's focus ring moves out past the preview's selection ring, and the card gets the preview's corner radius so the ring follows it. Grow the room above the first row, and the scroll margins, to fit both rings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Show grid selection as a neutral card background Replace the selection ring around the grid and picker grid previews with a neutral background that spans the whole card. It reaches past the card, so the content keeps its place, and the checkbox still marks the selection. The focus ring of a selected preview no longer needs to clear a selection ring, and the picker grid draws it past the background. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw the grid card focus ring past the selection background The ring of a grid card focused with the arrow keys sat inside the card, within the selection background, next to the browser's default ring. Draw it as the card's outline, outside the card and one focus width past the selection background when the card is selected, and leave room for it above the first row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Restore the double ring on selected grid cards Revert the neutral selection background and the card focus ring change that depended on it. Selected grid and picker grid cards show the dark ring around the preview again, with the focus ring drawn past it, which stays closer to trunk. An alternative selection design can be explored separately. This reverts commits f0c886d and dbe9fa4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * DataViews: Draw the grid card focus ring outside the card A grid card focused with the arrow keys showed the browser's default ring plus ours, drawn inside the card. Draw a single ring as the card's outline, outside the card, and one focus width past the selection ring of the preview when the card is selected. Give the card the same scroll margin as the preview, so the rings stay in view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: simison <simison@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: fcoveram <fcoveram@git.wordpress.org>

What?
DataViews and DataForm keep each element in one WPDS color tone across its states. Rows, grid cards, table headers, title links and panel fields stay neutral on hover and selection. Filter options match the
SelectandMenuitems in@wordpress/ui.Why?
The token guidance asks to keep the tone and change only the state, for example
foreground-interactive-neutral→foreground-interactive-neutral-active. Several DataViews styles were neutral at rest and brand on interaction.How?
Rows (table, list, picker table, picker activity): selected and hovered rows use
background-interactive-neutral-weak-active, like theItemGrouprow in UI: Add Item #86676. In the table and picker table, the checkbox shows the selection, so a selected row is a plain gray block with no lines. The active item of the list layout keeps graystroke-surface-neutral-stronglines above and below it, and the selected item of the picker activity layout keeps a gray outline, as neither has a checkbox.Grid cards (grid, picker grid): a selected card gets a dark, rounded outline 2px outside its preview, in place of a brand ring on the preview's edge. It stays visible on light and dark images.
Filter options: the
@wordpress/uipopup item colors, and acheckmark in place of theRadioandCheckboxmarks.Table headers, title links and DataForm panel fields stay neutral on hover. Title links get an underline. The panel edit button is now a minimal, neutral
IconButtonfrom@wordpress/ui.Also: brand-toned elements keep brand tokens only: the filter chip with values, its remove button (now also on focus), the filter count badge and the changed-view dot. The × of a filter chip now takes the chip's darker color when you hover the chip or open its popover. The infinite-scroll actions bar uses the DataViews background token in place of
#fff. The 1px space kept for the line between table rows now takes the row's background: the sticky fade and actions cells did not paint it, so a tinted row showed a white line at both ends.Compromises and follow-ups
Note
foreground-interactive-neutral(#1e1e1e), like the selectedTabsindicator in@wordpress/uiand the selected pattern in the block editor's pattern list, so it stays visible on light and dark previews. A darker stroke token in@wordpress/themewould remove this workaround. Rows are not interactive by themselves, so the list and picker activity lines use the surface tokenstroke-surface-neutral-strong(#8b8b8b).border-width-xs). The pattern list uses 2px. Changing it is a one-token change.Select, in place of a radio or a checkbox.Buttons from@wordpress/components, and DataViews overrides their brand hover colors. Other@wordpress/componentsbuttons in DataViews, such as row actions, pagination and view options, still turn brand on hover. Moving them to the@wordpress/uiButtonfixes both without overrides, in a separate PR.@wordpress/uioutlineButton, but its shape does not (8px corners, only the filter name in bold), and no@wordpress/uicomponent draws it. We tried a minimalIconButtonfor the ×, as theTODOinfilter.tsxsuggests and theComboboxchips do. It looked almost the same (screenshots below), so it is not in this PR. Still open: should hovering the × highlight only the ×, as now, or the whole chip, as inCombobox? Here the chip and the × trigger different actions. A follow-up should decide how the pattern looks and which component draws it.IconButtonis an early adoption. It is "use with caution" in@wordpress/use-recommended-components, so its import has a scopedeslint-disablecomment, like inwidget-dashboard. DataViews setsposition: staticon it, so the hit area still covers the whole field. That override wins only because DataViews styles are unlayered and the@wordpress/uistyles are in@layer wp-ui.Testing Instructions
npm run storybook:dev.Testing Instructions for Keyboard
Screenshots or screencast
Storybook, default admin theme, 1200 px viewport. Before is
trunkat 7a2b164, except the table and picker table rows, which comparetrunkat d7663cb with 0f3dc94.List, picker table and picker activity: selected and hovered items
Grid and picker grid: selected card on dark and light previews
The light previews replace the story images, on both sides, to show the ring on a light image.
Table header, title and DataForm panel field on hover
Filter chip: the current × and an
IconButton×, in every state (not in this PR)Each sheet shows rest, chip hover, chip keyboard focus, popover open, × hover, × keyboard focus and × pressed. The left column is this PR. The right column uses a minimal
IconButtonfor the ×. The only differences are the 2px corners of the × background and the focus ring, which hides while the × is pressed.TODO
Use of AI Tools
Claude Code (Claude Opus 5.5) wrote this change and the screenshots under my direction. I reviewed it.
🤖 Generated with Claude Code