Skip to content

DataViews: Use the focus ring mixin for all focus rings - #87691

Merged
ciampo merged 25 commits into
trunkfrom
t3/dataviews-focus-rings
Dec 2, 2026
Merged

ciampo merged 25 commits into
trunkfrom
t3/dataviews-focus-rings

Conversation

@ciampo

@ciampo ciampo commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow-up to #87662.

Moves the DataViews focus rings to the outset-ring__focus() mixin, and fixes the ones that got clipped or doubled up along the way.

Why?

Some rings still used --wp-admin-border-width-focus, a hard-coded 2px, an inset box-shadow, or the old link-reset() mixin, which draws in the admin theme color. A few were also clipped by the scroll container or hard to tell apart from the selection ring.

How?

Every ring DataViews draws now uses the mixin. Rings against a scroll edge in single-column layouts (list item, picker table row, picker activity item) sit inside the item. The rest sit outside.

What you'll notice:

  • Picker grid: the active card's top edge was clipped. The grid layouts now leave room above the first row for the selection and focus rings, and focused items get a matching scroll margin.
  • Picker table: the active row's sides were clipped. The ring now sits inside the row, just below the line above it.
  • Grid preview: it showed the browser's default ring plus ours. Now it's a single ring outside the preview.
  • Grid card: Shift+Tab from a preview focuses its card, and the arrow keys move between cards. The card showed the browser's default ring plus ours, drawn inside the card. Now it's a single ring outside the card.
  • Selected and focused grid items: the selection ring from DataViews: Keep interaction states in the same WPDS color tone #87452 sits outside the preview, where the focus ring is too. On a selected item, the focus ring of the preview or the card now sits one focus width past the selection ring, so both stay visible. The grid preview has a single outline for both rings, so a shadow draws the selection ring while the preview has focus. The picker grid card's ring follows the preview's rounded corners.
  • Titles and table thumbnails: they used an admin-colored shadow or the browser default ring. Now they get the same ring as everything else. Focusing a title also no longer turns its text gray.
  • Links and buttons in item titles: the grid, list and activity titles clip their overflow, which cut off the focus ring of a link or button a field renders there. Titles that hold one now leave room for its ring, using padding with a matching negative margin so the layout doesn't move.
  • High-DPI: the picker rings that hard-coded 2px now follow the token, so they're 1.5px like every other ring.

Links rendered by WordPress admin pick up a shadow from common.css on a:focus, so the rings that can be links clear it.

Also removes a dead rule: the picker grid preview's focus rule, since that element never gets focus.

The README now suggests setting a custom background through ThemeProvider, which keeps the focus ring in contrast, rather than --wp-dataviews-color-background.

Left for later: arrowing through the infinite-scroll grid shows the browser's default ring on the cards, same as on trunk.

Testing Instructions

  1. Run Storybook and open DataViews > Layout Table, Layout Grid and Layout List, and DataViewsPicker > Default.
  2. Tab to a title, a table thumbnail, a grid preview (also with the card selected) and a list item. In the grid, also Shift+Tab from a preview to its card and arrow between cards, with and without selected cards. In the picker, tab into the items, select one and move back to it, then switch Layout to Table and Activity.
  3. Check the rings against the screenshots below, on a regular and a high-DPI screen if you can.

Testing Instructions for Keyboard

Same as above. Everything is reachable with Tab and the arrow keys.

Screenshots or screencast

Storybook at 1280px wide. 1x is a regular screen and 2x a high-DPI one, where the focus token is 1.5px. The selected-card screenshots compare trunk (5cf8a15) with this PR (0fd57d5, and cc1d72e for the grid card ring). The rest compare trunk at 37927d4 with this PR at fdbdbdd, from before the rebase. Their rings haven't changed since then.

Before After
Picker grid active card on trunk at 1x, top edge of the ring clipped Picker grid active card with this PR at 1x, full ring with rounded corners
Selected grid cards on trunk at 1x, a dark ring around each selected preview Selected grid cards with this PR at 1x, a dark ring around each selected preview
Selected grid preview focused on trunk at 2x, focus ring drawn inside the selection ring Selected grid preview focused with this PR at 2x, focus ring one focus width past the selection ring
Selected picker grid card active on trunk at 1x, focus ring clipped at the top and touching the selection ring Selected picker grid card active with this PR at 1x, focus ring past the selection ring
Selected grid card focused with the arrow keys on trunk at 1x, the browser's default ring next to a ring drawn inside the card Selected grid card focused with the arrow keys with this PR at 1x, a single ring outside the card, past the selection ring
Picker grid card at 2x
Before After
Picker grid active card on trunk at 2x Picker grid active card with this PR at 2x
Selected picker grid card active on trunk at 2x Selected picker grid card active with this PR at 2x
Picker table row
Before After
Picker table active row on trunk at 1x, only the bottom edge of the ring visible Picker table active row with this PR at 1x, ring inside the row
Picker table active row on trunk at 2x Picker table active row with this PR at 2x
Picker activity item
Before After
Picker activity active item on trunk at 1x Picker activity active item with this PR at 1x, same as before
Picker activity active item on trunk at 2x, 2px ring Picker activity active item with this PR at 2x, 1.5px ring
Grid preview, focused
Before After
Grid preview focused on trunk at 1x, ring drawn inside the preview Grid preview focused with this PR at 1x, single ring outside
Grid preview focused on trunk at 2x Grid preview focused with this PR at 2x
Selected grid and picker grid cards at other scales
Before After
Selected grid cards on trunk at 2x Selected grid cards with this PR at 2x
Selected grid card focused with the arrow keys on trunk at 2x Selected grid card focused with the arrow keys with this PR at 2x
Grid card focused with the arrow keys on trunk at 1x Grid card focused with the arrow keys with this PR at 1x, a single ring outside the card
Selected grid preview focused on trunk at 1x Selected grid preview focused with this PR at 1x
Selected picker grid cards on trunk at 1x Selected picker grid cards with this PR at 1x
Table title and thumbnail
Before After
Table title focused on trunk at 1x, admin-colored shadow and gray text Table title focused with this PR at 1x, outline ring
Table title focused on trunk at 2x Table title focused with this PR at 2x
Table thumbnail focused on trunk at 1x, browser default ring Table thumbnail focused with this PR at 1x, design system ring
Table thumbnail focused on trunk at 2x Table thumbnail focused with this PR at 2x
Grid title
Before After
Grid title focused on trunk at 1x Grid title focused with this PR at 1x
Grid title focused on trunk at 2x Grid title focused with this PR at 2x
List item (unchanged)
Before After
List item focused on trunk at 1x List item focused with this PR at 1x
List item focused on trunk at 2x List item focused with this PR at 2x

No story has clickable activity items, so that ring isn't pictured. The mixin gives it the same width, offset and color as before.

Use of AI Tools

Claude Code (Claude Opus 5.5) wrote the code, captured the screenshots with Playwright and drafted this description. GPT-6.2 Astra reviewed it locally over several rounds.

🤖 Generated with Claude Code

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

github-actions Bot commented Nov 30, 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: 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>

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: +1.72 kB (+0.02%)

Total Size: 8.73 MB

📦 View Changed
Filename Size Change
build/styles/edit-site/style-rtl.css 21.6 kB +172 B (+0.8%)
build/styles/edit-site/style-rtl.min.css 17.6 kB +234 B (+1.35%)
build/styles/edit-site/style.css 21.6 kB +171 B (+0.8%)
build/styles/edit-site/style.min.css 17.6 kB +234 B (+1.35%)
build/styles/editor/style-rtl.css 32.7 kB +196 B (+0.6%)
build/styles/editor/style-rtl.min.css 28.4 kB +261 B (+0.93%)
build/styles/editor/style.css 32.8 kB +194 B (+0.59%)
build/styles/editor/style.min.css 28.4 kB +260 B (+0.92%)

cc1d72e Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 615854f trunk % Change
timeToFirstByte 46.45 ms +13.13% -5.17% 45.5 ms +9.78% -3.85% 2.09%
largestContentfulPaint 74 ms +10.81% -8.11% 74 ms +2.7% -2.7% 0%
lcpMinusTtfb 25.4 ms +18.5% -6.3% 30.05 ms +4.99% -21.3% -15.47%
wpBeforeTemplate 23.91 ms +16.19% -2.47% 24.01 ms +12.95% -3.54% -0.42%
wpTemplate 18.34 ms +4.96% -5.62% 17.66 ms +3.68% -3.23% 3.85%
wpTotal 42.93 ms +12.86% -5.59% 42.13 ms +9.99% -3.61% 1.9%
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 615854f trunk % Change
timeToFirstByte 36.6 ms +6.28% -2.87% 37.55 ms +4.53% -4.79% -2.53%
largestContentfulPaint 64 ms +6.25% -0% 64 ms +6.25% -0% 0%
lcpMinusTtfb 28.45 ms +2.46% -1.76% 28.3 ms +2.65% -2.47% 0.53%
wpBeforeTemplate 20.44 ms +2.01% -2.45% 20.36 ms +10.12% -1.72% 0.39%
wpTemplate 12.98 ms +3.78% -1.16% 13.24 ms +4.53% -3.25% -1.96%
wpTotal 33.57 ms +4.97% -2.41% 34.46 ms +3.63% -4% -2.58%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 615854f trunk % Change
mediaProcessingJpeg 333.27 ms +0.63% -2.09% 326.96 ms +1.39% -0.57% 1.93%
mediaProcessingAvif 4888.45 ms +0.83% -0.21% 4867.3 ms +0.29% -0.33% 0.43%
mediaProcessingJpegToAvif 3399.26 ms +0.46% -0.48% 3401.1 ms +0.45% -0.44% -0.05%

media-upload

Metric 615854f trunk % Change
jpegUploadProcessing 1458.88 ms +1.78% -1% 1466.77 ms +0.47% -1.14% -0.54%
pngUploadProcessing 238.45 ms +2.97% -3.28% 232.6 ms +7.62% -1.96% 2.52%
largeJpegUploadProcessing 1446.91 ms +1.29% -0.39% 1437.69 ms +1.04% -0.52% 0.64%
multipleImageUploadProcessing 1522.1 ms +0.8% -1.23% 1497.88 ms +0.9% -0.32% 1.62%

post-editor

Metric 615854f trunk % Change
serverResponse 313.5 ms +4.44% -6.77% 292.43 ms +12.31% -2.62% 7.21%
firstPaint 359.79 ms +2.46% -5.11% 331.83 ms +8.28% -7.76% 8.43%
domContentLoaded 640.5 ms +1.05% -0.96% 640.27 ms +1.29% -0.39% 0.04%
loaded 641.41 ms +1.04% -0.98% 641.2 ms +1.28% -0.41% 0.03%
firstContentfulPaint 360.72 ms +2.2% -1.03% 359.24 ms +2.94% -2.89% 0.41%
firstBlock 1734.85 ms +1.59% -1.26% 1753.21 ms +0.97% -0.88% -1.05%
type 14.85 ms +2.9% -10.84% 14.36 ms +3.97% -4.74% 3.41%
typeWithoutInspector 15.03 ms +3.13% -9.71% 15.21 ms +3.55% -12.75% -1.18%
typeWithTopToolbar 18.77 ms +4.26% -3.2% 18.31 ms +7.1% -8.68% 2.51%
typeContainer 6.84 ms +8.33% -3.95% 6.95 ms +6.04% -14.24% -1.58%
focus 85.47 ms +5.98% -5.28% 77.21 ms +13.51% -3.04% 10.7%
firstFocus 208.61 ms +0% -0% 198.71 ms +0% -0% 4.98%
selectAll 313.74 ms +0.1% -4.16% 293.36 ms +8.48% -0.41% 6.95%
undo 24.79 ms +3.11% -5.69% 24.17 ms +4.26% -5.96% 2.57%
listViewOpen 30.15 ms +8.69% -6.6% 29.77 ms +13.03% -3.93% 1.28%
inserterOpen 32.92 ms +5.53% -12.82% 31.12 ms +11.73% -6.81% 5.78%
inserterHover 8.95 ms +6.15% -3.58% 9.07 ms +7.72% -8.49% -1.32%
inserterSearch 7.06 ms +8.64% -4.82% 7.18 ms +3.62% -11.84% -1.67%
loadPatterns 515.13 ms +1.51% -4.52% 495.03 ms +3.3% -2.07% 4.06%
wpTotal 304.94 ms +4.56% -6.97% 283.85 ms +12.66% -2.67% 7.43%
wpMemoryUsage 14.80 MB +0% -0% 14.76 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 615854f trunk % Change
serverResponse 481.85 ms +1.75% -7.34% 479.62 ms +1.24% -8.42% 0.46%
firstPaint 476.32 ms +4.37% -3.42% 469.54 ms +3% -15.16% 1.44%
domContentLoaded 856.43 ms +1.2% -1.15% 851.07 ms +0.64% -0.76% 0.63%
loaded 857.49 ms +1.21% -1.16% 852.2 ms +0.61% -0.77% 0.62%
firstContentfulPaint 477.81 ms +4.05% -1.3% 472.64 ms +2.32% -1.98% 1.09%
firstBlock 2649.2 ms +0.83% -1.44% 2667.39 ms +0.34% -1.74% -0.68%
type 18.33 ms +6% -6.38% 17.49 ms +7.09% -8.12% 4.8%
navigate 118.65 ms +4.85% -4.66% 111.03 ms +5.03% -2% 6.86%
loadPatterns 1615.99 ms +5.42% -17.09% 1626.38 ms +7.46% -13.72% -0.64%
loadPages 976.24 ms +5.71% -1.35% 977.71 ms +0.59% -0.38% -0.15%
wpTotal 472.24 ms +1.79% -7.48% 469.88 ms +1.26% -8.56% 0.5%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

cc1d72e Run

@ciampo ciampo self-assigned this Nov 30, 2026
@ciampo ciampo changed the title DataViews: Use WPDS tokens for focus rings DataViews: Use the focus ring mixin for all focus rings Nov 30, 2026
@ciampo
ciampo marked this pull request as ready for review November 30, 2026 22:32
@ciampo
ciampo requested review from a team, Mamaduka and t-hamano and removed request for gigitux, ntsekouras and oandregal November 30, 2026 22:32
@Mamaduka Mamaduka added the [Type] Code Quality Issues or PRs that relate to code quality label Dec 1, 2026
@jasmussen

Copy link
Copy Markdown
Contributor

Probably not a blocker for iterative work, but this one stands out:

image

The double striping is electric here. I assume it's selected+focused, yes? It's a bit much, and it seems like selected might need a different approach.

@jameskoster

Copy link
Copy Markdown
Contributor

I had the same reaction as @jasmussen. It feels like something we can potentially follow-up to unpack. Worth noting that the selection ring will become neutral colored once #87452 lands. I don't know if that helps or hinders.

My instinct is that an overlay treatment might work better than an outline for selection. But we had something like that in the past and obviously changed it. I'd need to dig up the reason why. This all points to a follow-up I think.

@ciampo

ciampo commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

I mentioned this in the PR description:

Note

In this PR, a selected and focused grid item shows a double brand-colored ring. This will be fixed by #87452, which changes the selected ring to be neutral-colored.

Would you be open to having the combined effect of #87452 and this PR (ie still double ring, but two different colors) as an intermediate step, as a better alternative for selected is explored?

@ciampo
ciampo force-pushed the t3/dataviews-focus-rings branch from 11d0535 to fdbdbdd Compare December 1, 2026 16:19
@ciampo

ciampo commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

#87452 merged, here's what a selected and focused grid item looks like:

selected and focused

Is it good enough for this iteration, or do you suggest other changes?

@fcoveram

fcoveram commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

I would connect the double ring effect with the design idea shared in #82113 that addresses the grid item selected where media and other fields are visible/hidden.

ciampo and others added 7 commits December 1, 2026 18:04
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yles

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>
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>
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>
ciampo and others added 15 commits December 1, 2026 18:04
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>
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>
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>
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>
…verflow

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>
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>
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>
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 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>
…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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#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>
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>
@ciampo
ciampo force-pushed the t3/dataviews-focus-rings branch from fdbdbdd to dbe9fa4 Compare December 1, 2026 17:15
@ciampo

ciampo commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

I changed the selection treatment following the feedback above. Selected grid and pickerGrid cards now get a neutral gray background that spans the whole card, in place of the ring around the preview. A selected and focused card shows a single focus ring.

Selected Selected and focused
Grid layout with three selected cards, each with a gray background Selected grid preview focused, a single focus ring around the preview on the gray background
Picker grid with three selected cards, each with a gray background Selected picker grid card active, a single focus ring just outside the gray background

Arrowing between grid cards now draws the card's ring outside the gray background too, instead of inside the card next to the browser's default ring:

Selected grid card focused with the arrow keys, a single ring just outside the gray background

Discarded alternative: background and border

The same background with a 1px neutral border (--wpds-color-stroke-surface-neutral-strong). I dropped the border to stay coherent with #87452, where selected table rows also mark selection with a background and the checkbox, without a border. On a focused picker card, the border and the focus ring also sit side by side again.

Selected Selected and focused
Grid layout with three selected cards, each with a gray background and a gray border Selected grid preview focused, with a gray border around the card
Picker grid with three selected cards, each with a gray background and a gray border Selected picker grid card active, focus ring just outside the gray border

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>
@jameskoster

Copy link
Copy Markdown
Contributor

I think I'd be inclined to keep the double-ring because it's a bit closer to what's on trunk, and explore an alternative design separately.

ciampo and others added 2 commits December 1, 2026 22:44
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>
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>
@ciampo

ciampo commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Switched back to the double-ring for now. At this point,should we merge this PR and iterate if/as needed?

@simison simison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might make sense to wait for final design approval since we're so close to package release, but meanwhile ✅

@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.

Pretty much all the other states are an improvement so I'm happy to approve. Let's follow-up on the select state for grid items though.

@ciampo
ciampo merged commit 8dc9ed0 into trunk Dec 2, 2026
96 checks passed
@ciampo
ciampo deleted the t3/dataviews-focus-rings branch December 2, 2026 10:51
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Dec 2, 2026
@ciampo

ciampo commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Moved over to #87815, where I'm getting the conversation started with a few potential ideas

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

Labels

[Package] DataViews /packages/dataviews [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants