Skip to content

Fix[Settings]: Improve focus restoration after AI settings saves - #812

Merged
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:fix-ai-home/a11y-focus-issues
Jul 1, 2026
Merged

Fix[Settings]: Improve focus restoration after AI settings saves#812
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:fix-ai-home/a11y-focus-issues

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Similar to #532

This PR adds an interim focus-management fix for AI settings flows where the Save button disappears after saving. It restores keyboard focus to a related remaining control: the last inline settings field for inline feature settings, and “Reset to default” for developer model selection when that button is available. This avoids leaving keyboard and assistive technology users focused on an unmounted Save button.

This is not the ideal long-term UX. Disappearing action UI is inherently less predictable, and the settings page currently mixes save models: feature toggles and “Reset to default” save immediately, while developer settings and inline feature settings use explicit Save buttons. A better follow-up would be to unify settings changes through a shared store and provide one persistent Save action in the header, so all updates follow the same interaction model.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Reviewing the code.

Testing Instructions

  1. In the AI settings page, change an inline feature setting and click Save.
  2. Confirm focus returns to the last field in that settings form.
  3. Enable model selection, choose a provider/model, and click Save.
  4. Confirm focus moves to “Reset to default” after Save disappears.

Screencast

screencast.mov

Changelog Entry

Fixed - focus restoration after AI settings saves.

Open WordPress Playground Preview

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.50%. Comparing base (4cbd972) to head (fde2a7f).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #812   +/-   ##
==========================================
  Coverage      75.50%   75.50%           
  Complexity      2086     2086           
==========================================
  Files             99       99           
  Lines           8626     8626           
==========================================
  Hits            6513     6513           
  Misses          2113     2113           
Flag Coverage Δ
unit 75.50% <ø> (ø)

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 1, 2026 11:32
@github-actions

github-actions Bot commented Jul 1, 2026

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.2.0 milestone Jul 1, 2026
@dkotter
dkotter merged commit 18227a4 into WordPress:develop Jul 1, 2026
26 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the fix-ai-home/a11y-focus-issues branch July 1, 2026 16:19
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.

2 participants