Closed
Conversation
19 tasks
vraja-pro
requested changes
Feb 26, 2026
Contributor
vraja-pro
left a comment
There was a problem hiding this comment.
AC 🚧
The current flow:
- I click on ai optimize button
- Suggestions appear in content
- Ai optimize button is removed
- Focus moves to tab while AI notification is visible.
- I apply suggestions, focus is lost.
Check the commnet on the Premium PR first.
…oning consistency
8f46c2a to
d5e888f
Compare
Contributor
Author
|
Solved by #23036 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
handleAIOptimizeFocusFallbackis a plain function (not a React component) that is called fromcomponentDidUpdatein bothReadabilityAnalysisandSeoAnalysis. Timer cleanup happens incomponentWillUnmount. This avoids the problem of using hooks in class components.focusAIButtonId,locationContext,results,fallbackElementId,timerRef), and usesdispatch()directly instead ofuseDispatch().focusAIButtonIdorresultsprops actually change (checked viapreviousPropscomparison incomponentDidUpdate), avoiding unnecessary calls on unrelated re-renders.setTimeoutis used to giveAIOptimizeButton'suseLayoutEffecta chance to handle focus first, before the fallback kicks in.focusAIButtonIdprop is connected viawithSelect/getFocusAIFixesButtonIdin both analysis components.buttonIdprop was added to the collapsible in both analysis components to ensure the fallback element ID resolves to a focusable element.focusAIButtonIdis never set, so the fallback function exits immediately on its first guard check — effectively a no-op with negligible cost.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Scenario 1: With Premium active
Scenario 2: Without Premium active
ModalNotification changes in the UI library
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand commited the results, if my PR introduces new images or SVGs.Innovation
innovationlabel.Fixes #4372