Skip to content

Fix[Content Classification]: Improve focus management - #873

Merged
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:fix/a11y-suggestion-panel
Jul 16, 2026
Merged

Fix[Content Classification]: Improve focus management#873
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:fix/a11y-suggestion-panel

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Closes #872

This PR improves keyboard focus management in the content classification suggestion panel because dynamically replacing the generate button or removing a focused suggestion caused focus loss. It tracks pending focus with refs and moves focus to the generating button, the first available suggestion, or the generate button as the interface updates.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.6 Sol
Used for: Initial code skeleton, code review, and PR metadata.

Testing Instructions

  1. Create a new post and add enough content to enable category/tag suggestions.
  2. Select "Suggest Categories/Tags" and wait for the suggestions to appear.
  3. Verify that focus moves to the first suggestion.
  4. Accept or dismiss a suggestion, then verify that focus moves to the first remaining suggestion.
  5. Select Suggest again and verify that focus is preserved while suggestions regenerate.
  6. Select Dismiss all and verify that focus returns to the "Suggest Categories/Tags" button.

Screencast

screencast.mov

Changelog Entry

Changed - Improved keyboard focus handling when generating, accepting, or dismissing classification suggestions.

Open WordPress Playground Preview

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.44%. Comparing base (adb9afa) to head (0d616eb).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #873   +/-   ##
==========================================
  Coverage      78.44%   78.44%           
  Complexity      2454     2454           
==========================================
  Files            104      104           
  Lines           9925     9925           
==========================================
  Hits            7786     7786           
  Misses          2139     2139           
Flag Coverage Δ
unit 78.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review July 16, 2026 07:34
@yogeshbhutkar
yogeshbhutkar requested a review from a team July 16, 2026 07:34
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

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: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>

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

@dkotter dkotter added this to the 1.3.0 milestone Jul 16, 2026
@dkotter
dkotter merged commit 6dcd0ab into WordPress:develop Jul 16, 2026
26 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the fix/a11y-suggestion-panel branch July 17, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve keyboard focus management for content classification suggestions

2 participants