Skip to content

DataViews: Keep interaction states in the same WPDS color tone - #87452

Merged
ciampo merged 12 commits into
trunkfrom
t3/fix-dataviews-token-pairing
Dec 1, 2026
Merged

ciampo merged 12 commits into
trunkfrom
t3/fix-dataviews-token-pairing

Conversation

@ciampo

@ciampo ciampo commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 Select and Menu items 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 the ItemGroup row 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 gray stroke-surface-neutral-strong lines 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/ui popup item colors, and a check mark in place of the Radio and Checkbox marks.

  • 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 IconButton from @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

  • A foreground token draws the grid ring. It uses foreground-interactive-neutral (#1e1e1e), like the selected Tabs indicator in @wordpress/ui and 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/theme would remove this workaround. Rows are not interactive by themselves, so the list and picker activity lines use the surface token stroke-surface-neutral-strong (#8b8b8b).
  • Hover and selection share one background. In the table and picker table, only the checkbox tells a selected row from a hovered one. In the list and picker activity layouts, the line or outline does.
  • The grid ring is 1px (border-width-xs). The pattern list uses 2px. Changing it is a one-token change.
  • Single and multiple selection filters now look the same. Both show a check mark, like Select, in place of a radio or a checkbox.
  • Table header buttons rely on an override. They are tertiary Buttons from @wordpress/components, and DataViews overrides their brand hover colors. Other @wordpress/components buttons in DataViews, such as row actions, pagination and view options, still turn brand on hover. Moving them to the @wordpress/ui Button fixes both without overrides, in a separate PR.
  • The filter chip needs design attention. It is a split control: the chip opens the filter, and the × inside it removes the filter. Its colors match the @wordpress/ui outline Button, but its shape does not (8px corners, only the filter name in bold), and no @wordpress/ui component draws it. We tried a minimal IconButton for the ×, as the TODO in filter.tsx suggests and the Combobox chips 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 in Combobox? Here the chip and the × trigger different actions. A follow-up should decide how the pattern looks and which component draws it.
  • IconButton is an early adoption. It is "use with caution" in @wordpress/use-recommended-components, so its import has a scoped eslint-disable comment, like in widget-dashboard. DataViews sets position: static on it, so the hit area still covers the whole field. That override wins only because DataViews styles are unlayered and the @wordpress/ui styles are in @layer wp-ui.
  • The grid ring needs room above the first row. It sits outside the preview, so both grids get a 3px top padding, or the scroll container clips it. A consumer that overrides the grid padding can clip the ring again. The block editor inserter does this, but its grid has no selection.

Testing Instructions

  1. Run npm run storybook:dev.
  2. Open DataViews → Layout Table. Select two adjacent rows, then hover a title and a column header. The rows form one gray block, with no lines above, between or below them. The title stays dark and gets an underline. The header turns gray, not blue.
  3. Open DataViews → Layout List, and DataViewsPicker → Default in the Activity layout. Select one item and hover another. Both are gray. Only the selected item has gray lines (list) or a gray outline (activity).
  4. In DataViewsPicker → Default, switch to the Table layout. Select one row and hover another. Both rows are gray blocks with even edges, with no lines and no white marks at the ends.
  5. Open DataViews → Layout Grid, and DataViewsPicker → Default in the Grid layout. Select a card in the first row. A dark, rounded outline appears just outside its preview, and its top edge is not cut off.
  6. Open DataViews → Filter Popover and the Elements filter. Select Published and hover Draft. Published shows a check mark. Draft has a solid blue highlight with white text.
  7. Open DataForm → Layout Panel and hover a field. The label darkens and the pencil button stays neutral.

Testing Instructions for Keyboard

  1. In the Elements filter, move through the options with the arrow keys and press Enter. The active option has the solid blue highlight, and the selected option gets a check mark.
  2. In DataForm → Layout Panel, press Tab to move to a field's edit button. The focus ring shows, and Enter opens the field.

Screenshots or screencast

Storybook, default admin theme, 1200 px viewport. Before is trunk at 7a2b164, except the table and picker table rows, which compare trunk at d7663cb with 0f3dc94.

Before After
Table with two selected rows on a blue tint and blue lines Table with two selected rows as one gray block without lines
Filter options with a blue radio on Published and a light blue hover on Draft Filter options with a check on Published and a solid blue highlight on Draft
List with the selected item on a blue tint with blue lines, and no hovered item List with the selected item on a gray background with gray lines, and no hovered item
List, picker table and picker activity: selected and hovered items
Before After
List with a blue selected item and a gray hovered item List with gray items, and gray lines around the selected item
Picker table with two selected rows and a hovered row on a blue tint with blue lines Picker table with two selected rows and a hovered row as gray blocks without lines
Picker activity with blue selected and hovered items Picker activity with gray items, and a gray outline on the selected item
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.

Before After
Grid with a blue ring on the edge of the selected dark preview Grid with a dark outline outside the selected dark preview
Grid with a blue ring on the edge of the selected light preview Grid with a dark outline outside the selected light preview
Picker grid with a blue ring on the edge of the selected dark preview Picker grid with a dark outline outside the selected dark preview
Picker grid with a blue ring on the edge of the selected light preview Picker grid with a dark outline outside the selected light preview
Table header, title and DataForm panel field on hover
Before After
Hovered Title header with blue text on a light blue background Hovered Title header with dark text on a gray background
Hovered title Io in blue Hovered title Io in dark text with an underline
Hovered Status and visibility field with a blue label, value and pencil Hovered Status and visibility field with a dark label and value, and a neutral pencil button on a gray background
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 IconButton for the ×. The only differences are the 2px corners of the × background and the focus ring, which hides while the × is pressed.

Filter chip with values, in brand colors, in seven states, with the current × and with an IconButton ×

Filter chip without values, in neutral colors, in seven states, with the current × and with an IconButton ×

TODO

  • Add screenshots for other admin color schemes and for dark mode.

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

@github-actions github-actions Bot added the [Package] DataViews /packages/dataviews label Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

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: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: -11.7 kB (-0.13%)

Total Size: 8.72 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 559 kB -2.09 kB (-0.37%)
build/scripts/components/index.min.js 356 kB -8 B (0%)
build/scripts/edit-site/index.min.js 376 kB -3.37 kB (-0.89%)
build/scripts/editor/index.min.js 574 kB -2 kB (-0.35%)
build/scripts/media-utils/index.min.js 235 kB -3.53 kB (-1.48%)
build/styles/block-editor/style-rtl.css 20.4 kB -204 B (-0.99%)
build/styles/block-editor/style-rtl.min.css 17.3 kB -144 B (-0.83%)
build/styles/block-editor/style.css 20.4 kB -211 B (-1.02%)
build/styles/block-editor/style.min.css 17.3 kB -146 B (-0.84%)
build/styles/customize-widgets/style-rtl.css 3.04 kB -40 B (-1.3%)
build/styles/customize-widgets/style-rtl.min.css 2.04 kB -37 B (-1.78%)
build/styles/customize-widgets/style.css 3.04 kB -39 B (-1.27%)
build/styles/customize-widgets/style.min.css 2.04 kB -38 B (-1.83%)
build/styles/edit-site/style-rtl.css 21.5 kB +112 B (+0.52%)
build/styles/edit-site/style-rtl.min.css 17.4 kB +104 B (+0.6%)
build/styles/edit-site/style.css 21.5 kB +113 B (+0.53%)
build/styles/edit-site/style.min.css 17.4 kB +104 B (+0.6%)
build/styles/edit-widgets/style-rtl.css 5.46 kB -8 B (-0.15%)
build/styles/edit-widgets/style-rtl.min.css 4.05 kB -13 B (-0.32%)
build/styles/edit-widgets/style.css 5.46 kB -8 B (-0.15%)
build/styles/edit-widgets/style.min.css 4.05 kB -17 B (-0.42%)
build/styles/editor/style-rtl.css 32.3 kB -83 B (-0.26%)
build/styles/editor/style-rtl.min.css 28 kB -13 B (-0.05%)
build/styles/editor/style.css 32.4 kB -79 B (-0.24%)
build/styles/editor/style.min.css 28 kB -15 B (-0.05%)

0f3dc94 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 7d730a7 trunk % Change
timeToFirstByte 59.65 ms +7.04% -4.78% 60.85 ms +6.49% -7.89% -1.97%
largestContentfulPaint 90 ms +11.11% -2.22% 92 ms +8.7% -4.35% -2.17%
lcpMinusTtfb 29.9 ms +17.39% -4.68% 29.7 ms +25.25% -4.71% 0.67%
wpBeforeTemplate 31.1 ms +7.91% -2.19% 31.25 ms +11.1% -3.3% -0.48%
wpTemplate 23.82 ms +2.94% -6.3% 24.02 ms +5.33% -8.03% -0.83%
wpTotal 55.09 ms +7.73% -3.81% 57.01 ms +6.75% -8.17% -3.37%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 7d730a7 trunk % Change
timeToFirstByte 48.85 ms +8.19% -2.66% 49 ms +7.96% -2.96% -0.31%
largestContentfulPaint 84 ms +7.14% -0% 84 ms +7.14% -4.76% 0%
lcpMinusTtfb 36.15 ms +1.94% -2.77% 35.4 ms +3.67% -5.23% 2.12%
wpBeforeTemplate 28.1 ms +9.57% -2.21% 27.95 ms +9.95% -1.43% 0.54%
wpTemplate 16.93 ms +4.08% -1.89% 17.18 ms +9.25% -2.39% -1.46%
wpTotal 45.52 ms +8.81% -2.13% 45.57 ms +8.56% -2.35% -0.11%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 7d730a7 trunk % Change
mediaProcessingJpeg 401.06 ms +0.98% -0.56% 402.96 ms +0.13% -1.68% -0.47%
mediaProcessingAvif 6183.39 ms +0.26% -0.02% 6121.18 ms +0.86% -0.07% 1.02%
mediaProcessingJpegToAvif 4297.02 ms +0.34% -0.27% 4227.17 ms +0.14% -0.13% 1.65%

media-upload

Metric 7d730a7 trunk % Change
jpegUploadProcessing 1770.34 ms +16.02% -13.4% 1523.89 ms +30.1% -1.08% 16.17%
pngUploadProcessing 276.6 ms +1.6% -5.29% 283.09 ms +2.78% -3.15% -2.29%
largeJpegUploadProcessing 1985.29 ms +1.69% -24.06% 2003.28 ms +0.29% -2.16% -0.9%
multipleImageUploadProcessing 2124.05 ms +2.33% -0.66% 2103.88 ms +2.04% -0.23% 0.96%

post-editor

Metric 7d730a7 trunk % Change
serverResponse 487.66 ms +1.72% -8.98% 486.13 ms +1.58% -9.32% 0.31%
firstPaint 407.33 ms +10.47% -2.43% 454.04 ms +2.28% -11.45% -10.29%
domContentLoaded 842.31 ms +2.95% -2.82% 828.09 ms +1.09% -0.81% 1.72%
loaded 843.62 ms +2.94% -2.84% 829.01 ms +1.1% -0.78% 1.76%
firstContentfulPaint 469.58 ms +3.32% -3.15% 465.01 ms +2.36% -1.69% 0.98%
firstBlock 2278.96 ms +3.79% -1.3% 2283.49 ms +1.76% -1.86% -0.2%
type 19.57 ms +4.04% -10.07% 19.64 ms +6.36% -10.13% -0.36%
typeWithoutInspector 19.89 ms +4.88% -12.37% 18.93 ms +9.4% -10.41% 5.07%
typeWithTopToolbar 25.26 ms +8.16% -5.74% 25.03 ms +7.71% -6.27% 0.92%
typeContainer 9.38 ms +4.26% -10.98% 9.41 ms +6.27% -13.5% -0.32%
focus 111.67 ms +5.81% -5.21% 111.18 ms +4.25% -6.75% 0.44%
firstFocus 275.15 ms +0% -0% 278.41 ms +0% -0% -1.17%
selectAll 419.91 ms +5.97% -1.88% 394.27 ms +6.16% -0.22% 6.5%
undo 29.98 ms +3.14% -2.4% 29.13 ms +4.98% -4.77% 2.92%
listViewOpen 40.24 ms +11.63% -5.47% 42.72 ms +13.72% -6.74% -5.81%
inserterOpen 43.9 ms +4.92% -11% 45.12 ms +6.09% -21.03% -2.7%
inserterHover 11.87 ms +7.92% -4.55% 11.75 ms +7.49% -10.72% 1.02%
inserterSearch 8.43 ms +11.15% -3.56% 8.2 ms +14.15% -5.49% 2.8%
loadPatterns 669.74 ms +2.33% -5.81% 685.14 ms +4.6% -2.4% -2.25%
wpTotal 477.65 ms +1.78% -9.17% 476.4 ms +1.59% -9.54% 0.26%
wpMemoryUsage 14.80 MB +0% -0% 14.76 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 7d730a7 trunk % Change
serverResponse 466.36 ms +2.4% -6.79% 481.42 ms +1.68% -7.31% -3.13%
firstPaint 461.02 ms +3.94% -15.52% 422.23 ms +14.44% -5.01% 9.19%
domContentLoaded 856.97 ms +3.22% -0.94% 874.66 ms +4.16% -0.79% -2.02%
loaded 858.03 ms +3.24% -0.9% 875.79 ms +4.15% -0.8% -2.03%
firstContentfulPaint 473.18 ms +9.02% -2.3% 490.55 ms +1.04% -1.5% -3.54%
firstBlock 2638.57 ms +5.57% -0.4% 2723.42 ms +0.24% -0.43% -3.12%
type 18.16 ms +4.79% -4.24% 19.7 ms +4.77% -13.2% -7.82%
navigate 122.28 ms +2.67% -0.63% 114.14 ms +3.03% -0.35% 7.13%
loadPatterns 1640.34 ms +8.16% -24.52% 1632.86 ms +10.02% -4.78% 0.46%
loadPages 948.2 ms +3.22% -0.96% 964.72 ms +2.41% -2.88% -1.71%
wpTotal 456.13 ms +2.58% -6.93% 471.73 ms +1.73% -7.5% -3.31%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

0f3dc94 Run

🏁 Flaky tests

Some 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 /test/e2e/specs/editor/blocks/image.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:image -->
- <figure class="wp-block-image"><img alt=""/></figure>
+ <!-- wp:image {"id":26,"sizeSlug":"full","linkDestination":"none"} -->
+ <figure class="wp-block-image size-full"><img src="http://localhost:8891/wp-content/uploads/2026/12/78501d98-28aa-4ab3-a821-d11760fa02e2.png" alt="" class="wp-image-26"/></figure>
  <!-- /wp:image -->
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:432:49

0f3dc94 Run

ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo ciampo self-assigned this Nov 26, 2026
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Nov 26, 2026
@ciampo
ciampo marked this pull request as ready for review November 26, 2026 14:42
@github-actions
github-actions Bot requested a review from aduth November 26, 2026 14:43
@ciampo
ciampo requested review from a team and Mamaduka November 26, 2026 14:47
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo
ciampo force-pushed the t3/fix-dataviews-token-pairing branch from 0e977f9 to 34d942f Compare November 26, 2026 14:52
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ciampo added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jameskoster

Copy link
Copy Markdown
Contributor

Unsure how to fix it but this feels like a small design regression:

Screenshot 2026-11-27 at 11 55 34

Maybe the filter chips should be a dedicated component, it's a pattern we reuse elsewhere. Or perhaps they should just have a different design. Probably fine to address in a follow-up.

@ciampo

ciampo commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Unsure how to fix it but this feels like a small design regression:

My bad, I thought I had fixed it already. I'll look into it again

Maybe the filter chips should be a dedicated component, it's a pattern we reuse elsewhere. Or perhaps they should just have a different design. Probably fine to address in a follow-up.

It absolutely does, it's something we had also recently discussed with @mirka

@ciampo

ciampo commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@jameskoster I'm realizing that screenshot you're showing is not currently implemented in this PR, the description above that section says:

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 IconButton for the ×. The only differences are the 2px corners of the × background and the focus ring, which hides while the × is pressed.

It's basically an experiment that I ran using IconButton, but didn't keep in this PR because it didn't look right.

This is what the focus rings around the chip look like in this PR:

Screen.Recording.2026-11-27.at.17.05.04.mov

Apart from that, was there anything else that needs changing?

@jameskoster

Copy link
Copy Markdown
Contributor

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.

@ciampo

ciampo commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Just the stroke color on selected items.

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:

When styling one UI element across states, keep the token role aligned and change only the state segment. For example, pair --wpds-color-foreground-interactive-neutral with --wpds-color-foreground-interactive-neutral-active and --wpds-color-foreground-interactive-neutral-disabled rather than switching tones between states.

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:

  • select / menu item highlights: we would have preferred to use the brand tone only for focus styles, but a limitation of the base ui underlying component meant that we had to pick one unique style for focused / hovered that retained enough contrast
  • checkboxes and switches: I could argue we should use neutral tone (ie. dark gray on the default theme) instead of blueberry, but that's another conversation

For this specific case, the "selected" status is also reinforced by the checkbox, another thing to keep in mind

@jameskoster

Copy link
Copy Markdown
Contributor

I could argue we should use neutral tone (ie. dark gray on the default theme) instead of blueberry, but that's another conversation

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.

@ciampo

ciampo commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

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 jameskoster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@jasmussen

Copy link
Copy Markdown
Contributor

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.

ciampo and others added 12 commits December 1, 2026 16:02
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.
@ciampo
ciampo force-pushed the t3/fix-dataviews-token-pairing branch from 39d481e to 0f3dc94 Compare December 1, 2026 15:41
@ciampo

ciampo commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@jasmussen that should addressed.

I'm going to merge this PR to unblock further work, but always happy to iterate as needed.

@ciampo
ciampo enabled auto-merge (squash) December 1, 2026 15:54
@ciampo
ciampo merged commit 37927d4 into trunk Dec 1, 2026
88 checks passed
@ciampo
ciampo deleted the t3/fix-dataviews-token-pairing branch December 1, 2026 16:03
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Dec 1, 2026
ciampo added a commit that referenced this pull request Dec 1, 2026
#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>
ciampo added a commit that referenced this pull request Dec 1, 2026
#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>
@fcoveram

fcoveram commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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.

@ciampo

ciampo commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@fcoveram that should be addressed (see updated screenshots in PR description)

@fcoveram

fcoveram commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Nice ✨ I can see it now

ciampo added a commit that referenced this pull request Dec 1, 2026
#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>
ciampo added a commit that referenced this pull request Dec 1, 2026
#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>
ciampo added a commit that referenced this pull request Dec 2, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] DataViews /packages/dataviews [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants