long press account switch#29454
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a “long press to switch accounts” affordance to the native navigation header avatar, including remembering/restoring the previously-selected tab after an account switch on mobile.
Changes:
- Introduces shared account-switch utilities (MRU selection + pending tab remember/consume/clear) with unit tests.
- Adds a native header avatar component that supports press (open switcher) and long-press (switch to most-recent account), and wires it into the native stack header options.
- Adjusts People and Files headers to use the new shared header avatar behavior/components.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| shared/router-v2/router.tsx | Adds native header-left avatar on root screens and consumes/clears pending post-switch tab selection on navigation ready. |
| shared/router-v2/account-switcher/index.tsx | Remembers the current tab before initiating a mobile account switch via the account switcher UI. |
| shared/router-v2/account-switch.tsx | New helpers for MRU account selection and storing/consuming a pending tab to restore after account switch. |
| shared/router-v2/account-switch.test.tsx | Unit tests for MRU selection and pending-tab behavior. |
| shared/router-v2/account-switch-header-avatar.native.tsx | New native header avatar with press-to-open and long-press-to-switch-to-MRU behavior (with haptics + a11y strings). |
| shared/router-v2/account-switch-header-avatar.desktop.tsx | Desktop stub for the header avatar module. |
| shared/people/routes.tsx | Removes per-route header avatar now handled at the router header level. |
| shared/fs/nav-header/mobile-header.tsx | Adds the header avatar into the custom Android Files header layout and keeps the title centered via spacing. |
chrisnojima-zoom
approved these changes
Jul 21, 2026
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.
@mmaxim @chrisnojima