[Content Resizing]: Fix focus loss when regenerating content resizing suggestions#663
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #663 +/- ##
==========================================
Coverage 74.68% 74.68%
Complexity 1754 1754
==========================================
Files 85 85
Lines 7549 7549
==========================================
Hits 5638 5638
Misses 1911 1911
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:
|
5d8a720 to
d81c03f
Compare
|
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. |
dkotter
left a comment
There was a problem hiding this comment.
Overall this looks good to me but it is a slight change from our current UI and there is one potential problem I see.
Right now when a suggestion is being generated, we open the modal and show just a loading state. In this PR, we open the modal, we show the original content and then show a loading state beneath that. On smaller screens or when the original content is long, the loading state isn't in the viewport so it's not clear anything is happening. Ideally we auto scroll to the bottom of the modal so the loading state is always immediately visible.
8865962 to
bbf4d10
Compare
|
Thanks for the review. This should be fixed with bbf4d10. after.mov |
What?
See #589
Fixes a focus-loss issue in the Content Resizing modal where clicking Regenerate after a successful generation could move focus behind the modal.
Why?
The previous loading state replaced the modal content while regeneration was running. Since the focused
Regeneratebutton disappeared from the DOM, keyboard focus could escape to the background page, leaving keyboard and screen reader users unable to tab back into the modal.How?
accessibleWhenDisabledonRegenerateso focus remains stable.Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Initial code skeleton; final implementation and tests were reviewed and edited by me.
Testing Instructions
Tabseveral times.Screencast
screencast.mov
Changelog Entry