Skip to content

DataViews: Use the design system focus ring for list items. - #85358

Merged
ciampo merged 2 commits into
WordPress:trunkfrom
SainathPoojary:fix/dataviews-list-focus-ring
Oct 22, 2026
Merged

ciampo merged 2 commits into
WordPress:trunkfrom
SainathPoojary:fix/dataviews-list-focus-ring

Conversation

@SainathPoojary

@SainathPoojary SainathPoojary commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What?

Part of #80138.

Use the design system outline for keyboard focus on DataViews list items.

Why?

List items still use a legacy box-shadow focus ring with a separate high contrast fallback.

How?

Replace the shadow and transparent outline with outset-ring__focus(). Use a negative outline offset to keep the ring inside the item.

In high contrast mode, the inset focus ring is now separate from the row separators.

Testing Instructions

  1. Open Storybook → Design System → DataViews → Layout List.
  2. Press Tab until a list item is focused.
  3. Check that one complete focus outline appears around the item.
  4. Use the Up and Down Arrow keys to move between items.
  5. Repeat with forced colors enabled in DevTools. The focus outline and row separators should remain visible.

Screenshots or screencast

Before:

image Screenshot 2026-10-22 at 11 37 45 AM

After:

image image

Use of AI Tools

Implemented with assistance of Github Copilot

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

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 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: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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

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

@SainathPoojary

Copy link
Copy Markdown
Member Author

In high contrast mode, the focus outline now sits inside the row, leaving a small gap between it and the row separators. Previously, the fallback outline extended outward and visually joined those separators. Both the focus outline and separators remain visible with this change. Is this something that needs to be fixed, or is it expected behavior?

Before:
image

image

After:

image image

@SainathPoojary

Copy link
Copy Markdown
Member Author

Additionally The thin grey strip outside the focus outline is the row’s hover/focus background. It also appears on trunk before this patch. If the background and outline should align at the outer edge, we can address that in a follow-up PR.

image image

@SainathPoojary
SainathPoojary force-pushed the fix/dataviews-list-focus-ring branch from aa3d821 to bbbf077 Compare October 22, 2026 06:24
@SainathPoojary
SainathPoojary marked this pull request as ready for review October 22, 2026 07:37
@SainathPoojary SainathPoojary added the [Type] Enhancement A suggestion for improvement. label Oct 22, 2026
@ntsekouras
ntsekouras requested review from a team October 22, 2026 07:59
outline: 2px solid transparent;
@include outset-ring__focus();
// Keep the focus ring inside the item.
outline-offset: calc(-1 * var(--wpds-border-width-focus));

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.

@mirka here's another instance of negative offset

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.

I think this is find for the scope of this PR, we should decide how to tackle this pattern and apply changes in one go in a separate PR.

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

LGTM 🚀

outline: 2px solid transparent;
@include outset-ring__focus();
// Keep the focus ring inside the item.
outline-offset: calc(-1 * var(--wpds-border-width-focus));

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.

I think this is find for the scope of this PR, we should decide how to tackle this pattern and apply changes in one go in a separate PR.

@ciampo ciampo added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Oct 22, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Oct 22, 2026
@ciampo
ciampo merged commit 41310e7 into WordPress:trunk Oct 22, 2026
106 of 110 checks passed
@ciampo ciampo added Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 22, 2026
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 22, 2026
@github-actions

Copy link
Copy Markdown

There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch.

PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk.

# Checkout the wp/7.2 branch instead of trunk.
git checkout wp/7.2

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 41310e797392f85bd7a728fa5939a0280bce0b1e

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.2 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

1 similar comment
@github-actions

Copy link
Copy Markdown

There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch.

PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk.

# Checkout the wp/7.2 branch instead of trunk.
git checkout wp/7.2

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 41310e797392f85bd7a728fa5939a0280bce0b1e

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.2 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

@ciampo

ciampo commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@SainathPoojary do you mind creating a manual PR to backport this change to 7.2? I'll be happy to review that PR (also cc @t-hamano )

SainathPoojary added a commit to SainathPoojary/gutenberg that referenced this pull request Oct 23, 2026
…s#85358)

* DataViews: Use the design system focus ring for list items.

* DataViews: Add Changelog Entry

---

Co-authored-by: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
@SainathPoojary

Copy link
Copy Markdown
Member Author

@ciampo Done! The backport PR is ready for review: #85435 🙌

cc @t-hamano

t-hamano added a commit that referenced this pull request Oct 23, 2026
…85435)

* DataViews: Use the design system focus ring for list items.

* DataViews: Add Changelog Entry

---

Co-authored-by: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
@t-hamano

Copy link
Copy Markdown
Contributor

This PR was backported to wp/7.2 in #85435.

@t-hamano t-hamano added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 23, 2026
wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Oct 27, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340

git-svn-id: https://develop.svn.wordpress.org/trunk@64796 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 27, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340
Built from https://develop.svn.wordpress.org/trunk@64796


git-svn-id: http://core.svn.wordpress.org/trunk@63946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Mamaduka pushed a commit that referenced this pull request Oct 28, 2026
* DataViews: Use the design system focus ring for list items.

* DataViews: Add Changelog Entry

---

Co-authored-by: SainathPoojary <sainathpoojary@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
@Mamaduka Mamaduka removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Oct 28, 2026
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340

git-svn-id: https://develop.svn.wordpress.org/trunk@64796 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [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