Repository navigation
Fix workspace keyboard focus not returning to 3-dot trigger after Back - #97171
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot review |
ReviewOverall this is a solid, well-reasoned change — the LauncherStack registration + 1. Blast radius on shared components (main concern).
The registration looks self-cleaning ( 2. 3. Coverage on the new Minor / nits
Nothing here is a blocker on the approach — the design is sound. The asks are really about confirming the shared-component changes don't ripple into other flows, plus a test on the new hide-restore branch. |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@mkhutornyi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b25fd3c0a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
|
@MelvinBot review |
ReviewSolid, well-scoped accessibility fix with strong test coverage (4 test files, pure 1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cff41306b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot review |
ReviewRe-reviewed at 1. One load-bearing assumption is not covered by the unit tests. The whole fix depends on the Modal firing 2. Shared-component blast radius still needs a manual sanity pass (carried over from the earlier reviews, still the main gate). Two behaviors now change for every consumer, not just the 4 workspace flows in the Tests section:
The registration looks self-cleaning ( Things I checked that look correct
Next Steps: Reply with |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@MelvinBot review |
|
@mkhutornyi fixed the popover close with esc case: Monosnap.screencast.2026-08-18.19-50-46.mp4 |
Review (at
|
|
Please check if this solution makes sense: Also return focus to the ⋯ trigger when a popover menu is dismissed
This makes the derived value an overridable default and opts diff --git a/src/components/PopoverMenu/index.tsx b/src/components/PopoverMenu/index.tsx
index 23e6a776883..3f9c789b9d5 100644
--- a/src/components/PopoverMenu/index.tsx
+++ b/src/components/PopoverMenu/index.tsx
@@ -154,6 +154,13 @@ type PopoverMenuProps = Partial<ModalAnimationProps> & {
* */
shouldEnableNewFocusManagement?: boolean;
+ /**
+ * Whether to return focus to the trigger when the menu is dismissed without navigating.
+ * Defaults to the inverse of `shouldEnableNewFocusManagement`, because that manager owns the restore when it is on.
+ * Set it explicitly for a trigger the manager cannot restore — it only tracks text inputs, so a button is left with nothing to return to.
+ */
+ shouldReturnFocus?: boolean;
+
/** How to re-focus after the modal is dismissed */
restoreFocusType?: BaseModalProps['restoreFocusType'];
@@ -326,6 +333,7 @@ function BasePopoverMenu({
withoutOverlay = false,
shouldSetModalVisibility = true,
shouldEnableNewFocusManagement,
+ shouldReturnFocus,
restoreFocusType,
shouldShowRadioButton = false,
containerStyles,
@@ -699,6 +707,7 @@ function BasePopoverMenu({
withoutOverlay={withoutOverlay}
shouldSetModalVisibility={shouldSetModalVisibility}
shouldEnableNewFocusManagement={shouldEnableNewFocusManagement}
+ shouldReturnFocus={shouldReturnFocus}
restoreFocusType={restoreFocusType}
innerContainerStyle={{...styles.pv0, ...innerContainerStyle}}
shouldUseModalPaddingStyle={shouldUseModalPaddingStyle}
@@ -709,7 +718,7 @@ function BasePopoverMenu({
>
<FocusTrapForModal
active={isVisible}
- shouldReturnFocus={!shouldEnableNewFocusManagement}
+ shouldReturnFocus={shouldReturnFocus ?? !shouldEnableNewFocusManagement}
launcherRef={anchorRef}
>
<CompactMenuContext.Provider value>
diff --git a/src/components/ThreeDotsMenu/index.tsx b/src/components/ThreeDotsMenu/index.tsx
index 5245e35be92..261aa98a6ee 100644
--- a/src/components/ThreeDotsMenu/index.tsx
+++ b/src/components/ThreeDotsMenu/index.tsx
@@ -215,6 +215,8 @@ function ThreeDotsMenu({
shouldSetModalVisibility={shouldSetModalVisibility}
anchorRef={buttonRef}
shouldEnableNewFocusManagement
+ // The button blurs itself before opening and is not a text input, so ComposerFocusManager has nothing to restore — the trap has to return focus.
+ shouldReturnFocus
restoreFocusType={restoreFocusType}
enableEdgeToEdgeBottomSafeAreaPadding
/>cc: @MelvinBot which solution is better? This one vs PR changes |
|
Your Why the
|
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@mkhutornyi updated. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Review (re-review at
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-18.at.8.25.06.PM.mov |
Regression hunt (at
|
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #96971 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 danieldoglas has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/danieldoglas in version: 9.4.57-0 🚀
|
|
🤖 No help site changes required — no draft PR created. I reviewed the changes in this PR against the help site articles under What this PR changes: it fixes keyboard focus not returning to the ⋯ (3-dot) menu trigger after pressing Back, by adding a Why no docs are needed: the HelpDot articles document product features and workflows (how to duplicate a workspace, manage categories, etc.), not internal keyboard-focus behavior. Nothing in If you disagree and think a specific article should mention this, let me know which one and I'll draft the update. @Krishna2323, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀
Bundle Size Analysis (Sentry): |



Explanation of Change
Fixed Issues
$ #96971
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web_chrome_mac.mp4
web_chrome_windows.mp4
Monosnap.screencast.2026-08-18.19-50-46.mp4