Repository navigation
Fix back button loop on Profile after copiloting into an agent - #100686
chuckdries merged 1 commit into
Conversation
|
@eVoloshchak 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] |
trjExpensify
left a comment
There was a problem hiding this comment.
simple navigation fix 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppscreen-20260911-141913-1789129133752.mp4Android: mWeb ChromeScreen.Recording.2026-09-11.at.13.08.43.moviOS: HybridAppScreen.Recording.2026-09-11.at.13.10.58.moviOS: mWeb SafariScreen.Recording.2026-09-11.at.12.57.51.movMacOS: Chrome / SafariScreen.Recording.2026-09-11.at.12.54.01.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 chuckdries 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/chuckdries in version: 9.4.80-0 🚀
|
Help site review for this PRThe fix itself needs no help site change — it's a navigation correction with no new feature, setting, or copy. But reviewing it surfaced a real gap in the agents article, so I opened a draft PR for that: Docs updates for E/A#100686 Document all agent Copilot entry points ( What was missingCreate and Use Agents documents only one of the three ways to start a Copilot session with an agent — the Copilot button on the agent's row. The flow this PR fixes (chat header → Copilot into account) isn't described anywhere on the help site, and neither is the Edit agent page path. The docs PR adds a UI label verification and what I checkedI verified every label against the running app on web rather than trusting the existing article. Confirmed exact strings:
The article's existing step "click Copilot" is accurate — that pill really is labelled Copilot. Nothing existing needed correcting; the gap was omission only. I also checked the rest of the article against this PR. The Written against Two things to fix on the docs PR
@yusufdeveloper2903, 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/luacmartins in version: 9.4.80-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Copiloting into an agent from the agent chat header leaves 4 root stack entries, two of which hold owner-only screens guarded by
withAgentAccessDenied. The redirect to Profile only dismissed the topmost modal, and because it started from the Reports tablinkTo's cross-tab rule turned the REPLACE back into a PUSH, discardingforceReplace. So the stale guarded routes survived underneath, and pressing back re-focused one, which firedredirectAgentAwayand pushed Profile again — the loop.Calling
Navigation.popRootToTop()before the redirect drops every root entry created during the owner's session, so nothing guarded is left to re-fire andforceReplacecan finally replace the guarded pane: root entries go 4 → 1, the split under Profile becomes[Settings_Root, Settings_Profile], and back lands on the Account page instead ofHome.dismissModalis kept so the RHP still animates away, andlinkTois untouched. Addedtests/navigation/AgentCopilotRedirectTests.tsx, which fails onmainwithExpected: 1, Received: 4.Fixed Issues
$ #99074
PROPOSAL: #99074 (comment)
Tests
Precondition: an account with an agent created under Account > Agents.
Offline tests
Copiloting is blocked while offline (
useSwitchToDelegatorshort-circuits when the network is offline), so this flow cannot be started offline and the change has no offline-specific behavior.QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Before fix:
REC-20260909124538.mp4
After fix Native:
REC-20260909124657.mp4
Android: mWeb Chrome
REC-20260909130201.mp4
iOS: Native
After fix:
REC-20260909125401.mp4
iOS: mWeb Safari
After fix:
REC-20260909125617.mp4
MacOS: Chrome / Safari