Skip to content

Block Directory: Standardize downloadable block focus indicators - #85307

Merged
ciampo merged 5 commits into
WordPress:trunkfrom
himanshupathak95:fix/80138-block-directory-focus-ring
Oct 22, 2026
Merged

ciampo merged 5 commits into
WordPress:trunkfrom
himanshupathak95:fix/80138-block-directory-focus-ring

Conversation

@himanshupathak95

@himanshupathak95 himanshupathak95 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What?

Part of #80138. Use the design system focus outline for downloadable-block cards in the inserter.

Why?

These cards still use the old shadow for keyboard focus. Their focus ring can also be clipped when arrow-key navigation scrolls a card against the bottom edge.

How?

Use outset-ring__focus() for keyboard focus and a subtle neutral background tint on hover. Remove the old hover shadow and its transition, use the shared small corner radius, and keep the scroll margin that prevents the focus outline from being clipped. Disabled cards do not get the hover tint.

Testing Instructions

  1. Open a new post in the Visual editor as an administrator with permission to install plugins.
  2. Open the block inserter and search for map. Wait for “Available to install”. This needs access to WordPress.org and a block that is not already installed.
  3. Hover over a downloadable block card. It should show a subtle background tint, without a shadow. Move the pointer away and check that the tint disappears.
  4. Check the keyboard steps below. Do not activate a card, since that installs the block.
  5. Repeat with forced colors enabled. The focus outline should remain visible.

Testing Instructions for Keyboard

  1. Focus the inserter search field and enter map.
  2. Press Tab to reach Reset search, then Tab again to reach the first downloadable-block card.
  3. Check that one outline surrounds the card, with a small gap.
  4. Use the Down Arrow and Up Arrow to move through all results. Check that the outline remains visible at the bottom edge when the panel scrolls.
  5. Move the pointer over the focused card. It should show the hover tint and keep one focus outline, without an extra shadow.

Screenshots or screencast

Before

Screenshot 2026-10-21 at 22 26 36

After

image Screenshot 2026-10-22 at 12 14 46
Screen.Recording.2026-10-22.at.12.13.26.mov

Use of AI Tools

Implemented with assistance of Codex (Astra 6)

@coderabbitai review

@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: himanshupathak95 <abcd95@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.

@himanshupathak95 himanshupathak95 added the [Type] Enhancement A suggestion for improvement. label Oct 21, 2026
@himanshupathak95
himanshupathak95 marked this pull request as ready for review October 21, 2026 17:24
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: WordPress/gutenberg/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e186a64-339b-4bff-9147-523187526c8a
📥 Commits

Reviewing files that changed from the base of the PR and between b243d39 and efae034.

📒 Files selected for processing: 2
  • packages/block-directory/CHANGELOG.md
  • packages/block-directory/src/components/downloadable-block-list-item/style.scss
🚧 Files skipped from review as they are similar to previous changes: 2
  • packages/block-directory/CHANGELOG.md
  • packages/block-directory/src/components/downloadable-block-list-item/style.scss

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Accessibility
    • Improved keyboard focus visibility for downloadable block cards with a clear outline.
    • Kept focused cards visible when keyboard navigation scrolls them into view.
  • Style
    • Added a subtle background tint when hovering over enabled cards.
    • Updated card corners to match the design system.

Downloadable block cards now use updated focus-visible and hover styles, a small border radius, and scroll spacing. The changelog records the keyboard-focus outline and hover background tint.

Changes: Downloadable block keyboard focus

Layer / File(s) Summary
Focus styling and changelog
packages/block-directory/src/components/downloadable-block-list-item/style.scss, packages/block-directory/CHANGELOG.md
List items use a small border radius and scroll margin. Hover styling changes the background only when the item is not aria-disabled. Focus-visible styling uses the outset focus ring. The changelog records the enhancement.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: ciampo

Merge Risk: ⚪ Minimal · up to efae0

The focus and hover styling changes have no identified issue that should delay merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: standardizing focus indicators for downloadable blocks in the Block Directory.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description directly explains the downloadable-block card focus, hover, border-radius, and scroll-margin changes documented in the changeset.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ciampo
ciampo requested a review from a team October 21, 2026 22:11
Comment thread packages/block-directory/src/components/downloadable-block-list-item/style.scss Outdated
@himanshupathak95
himanshupathak95 force-pushed the fix/80138-block-directory-focus-ring branch from b243d39 to efae034 Compare October 22, 2026 05:34
@ciampo ciampo added the [Feature] Block Directory Related to the Block Directory, a repository of block plugins label Oct 22, 2026

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

@ciampo
ciampo merged commit f1a9d5b into WordPress:trunk Oct 22, 2026
101 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 github-actions Bot removed the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 22, 2026
gutenbergplugin pushed a commit that referenced this pull request Oct 22, 2026
)

* Block Directory: Standardize focus rings on downloadable blocks

* Block Directory: Document the downloadable block focus update

* Block Directory: Suppress the hover box-shadow when a focused item is also hovered

* Block Directory: Add PR reference to changelog

* Block Directory: Use subtle background tint on hover and add border-radius

---

Co-authored-by: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
@github-actions github-actions Bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Oct 22, 2026
@github-actions

Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 0741b7f

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

# 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

@himanshupathak95 , can you please open a new PR to manually backport this change to the 7.2 branch? (cc @t-hamano )

@himanshupathak95

Copy link
Copy Markdown
Contributor Author

@himanshupathak95 , can you please open a new PR to manually backport this change to the 7.2 branch? (cc @t-hamano )

Yes, I can. Coming right up.

@t-hamano

Copy link
Copy Markdown
Contributor

Actually, the backport succeeded. Adding two labels at once probably fires two events, so the workflow ran twice. I haven't looked into it in detail, but we probably need to adjust the workflow.

@ciampo

ciampo commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Oh, I missed the earlier message 🤦 Sorry for the ping, you both 🙏

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

Labels

Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Block Directory Related to the Block Directory, a repository of block plugins [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants