Fix[Settings]: Improve focus restoration after AI settings saves - #812
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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
Screencast
screencast.mov
Changelog Entry