Skip to content

Revisions: Show design system focus ring on the code diff - #85368

Open
R1shabh-Gupta wants to merge 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/revisions-code-diff-focus-ring
Open

R1shabh-Gupta wants to merge 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/revisions-code-diff-focus-ring

Conversation

@R1shabh-Gupta

@R1shabh-Gupta R1shabh-Gupta commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What?

Part of #80138

The code diff in the revisions screen (Code editor → Revisions) now uses the design system's outline focus ring instead of a legacy box-shadow.

Why?

The ring was an inset box-shadow with outline: none, so keyboard users had no focus indicator in high contrast (forced colors) mode.

How?

  • Replaced the box-shadow with outset-ring__focus().
  • Set a negative outline-offset so the ring stays inside the region.

Testing Instructions

  1. Open a post that has a few revisions.
  2. Switch to the Code editor (⋮ → Code editor).
  3. In the post sidebar, click "Revisions" to open the revisions screen.
  4. Press Tab until the code diff has focus. It should show a ring along its inside edge.
  5. Click the code diff with the mouse. There should be no ring.
  6. In DevTools → Rendering, emulate forced-colors: active and tick "Emulate a focused page", then repeat step 4. The ring should be visible. On trunk there's no indicator.

Testing Instructions for Keyboard

  1. Open the revisions screen with the Code editor active.
  2. Press Tab until focus reaches the code diff region. It should show the focus ring.
  3. Use the arrow keys to scroll the diff. The ring should stay visible.

Screenshots or screencast

Before After
Normal Before - Normal After - Normal
Windows High Contrast Mode Before - High After - High

Use of AI Tools

This PR was developed with the assistance of Claude Code.

@github-actions

github-actions Bot commented Oct 22, 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: R1shabh-Gupta <rishabhwp@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.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Oct 22, 2026
@R1shabh-Gupta
R1shabh-Gupta marked this pull request as ready for review October 22, 2026 05:42

This branch has not been deployed

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

Labels

[Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant