Repository navigation
Conversation
Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
I created this PR from an upstream branch because I don't have push access to To take ownership of the branch in your fork: git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-walletSpendRulesWorkspaceScope
git checkout -b claude-walletSpendRulesWorkspaceScope upstream/claude-walletSpendRulesWorkspaceScope
git push -u origin claude-walletSpendRulesWorkspaceScopeYou can then close this PR and open one from your fork if needed. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3d3f4a698
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const splitPayload = destinationStack ? getNestedAction(minimalAction, destinationStack).payload : undefined; | ||
| // jumpTo reuses the mounted split, so another workspace would keep the old sidebar. navigate creates a split with the requested scope instead. | ||
| if (activeSplit && splitPayload && isNamedActionPayload(splitPayload) && hasDifferentSplitScope(activeSplit, splitPayload)) { | ||
| navigate(backToRoute); |
There was a problem hiding this comment.
Avoid pushing history from a goBack redirect
When the destination workspace has a different scope, calling the forward-navigation API here changes goBack into a PUSH: linkTo pushes a new TAB_NAVIGATOR for the no-underlying-tab fixture and pushes a sibling workspace split when the underlying tab was uncovered. Consequently this redirect adds a browser/native history entry and leaves the Account/workspace-B route beneath workspace A, so Back returns to the route that initiated the disabled-feature redirect instead of unwinding it. Keep the scope correction within goUp using replacement/back-navigation semantics rather than calling navigate().
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🤖 Web test steps verification results: ❌ fail
Dev NewDot web remained blank, so the card-routing scenario could not be reached. Pushed 8fdca93, replacing forward navigation with guarded replacement; all 39 navigation tests, typecheck, changed-file lint/spelling, and Storybook passed, while full lint/Jest timed out.
| Step | Status |
|---|---|
| ❌ | |
Workspace B → Wallet → workspace A card → Edit spend rules; A sidebar and More features; Back behaviorBlocked by the blank app. Existing card fixtures could not be inspected; none were fabricated. |
❌ |
view run · no recording available
There was a problem hiding this comment.
@MelvinBot It seems not to be working the second time when we browser back to the wallet again.
Wallet -> Spend -> Correct workspace -> Back until wallet again -> again spend -> navigates to other workspace
There was a problem hiding this comment.
🤖 Web test steps verification results:
The test account has no workspaces or cards, so the browser-Back/retry sequence could not be reproduced. Existing tests pass but omit that round trip; no speculative fix was pushed—a two-workspace/card fixture is needed to verify the second redirect.
| Step | Status |
|---|---|
| ❌ | |
Wallet is reachableNot established: Account opened Profile, with no Wallet entry in captured navigation. |
❌ |
First redirect → browser Back to Wallet → second redirectBlocked by missing fixtures. Code tracing did not establish whether the second attempt requests the wrong workspace or restores stale navigation state; neither explanation is confirmed. |
❌ |
|
🤖 Web test steps verification results: Completed onboarding and created Workspace B on dev NewDot web. The required Workspace A/card fixture was absent, and Wallet was unavailable in Account; the spend-rule regression could not be tested.
|
|
🤖 Android test steps verification results: Recovered sign-in and opened standalone Android NewDot. Required Workspace A/Card fixture was unavailable: Workspaces showed “No workspaces yet”; no fixture data was fabricated.
|
|
Looks good from a product perspective. |
|
@Pujan92 is thiss ready? |
|
Not yet, reviewing it. |
|
@MelvinBot merge main and fix conflict |
Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
🤖 Web test steps verification results: ❌ fail Merged
view run · no recording available |
|
|
|
The failing Jest check is unrelated to this PR’s Wallet navigation changes.
No changes pushed: fixing this inherited test failure would be outside this PR’s scope. |
|
Rechecked: the only failing code check is still the same Jest failure. WorkspaceMembersTest.tsx:289 expects one “New” badge, but both Approve Only and Guest have one. This mismatch is inherited from No fix pushed because unrelated test failures must be addressed separately. The other failing checks require human checklist completion and independent approval. |
|
The checks are unchanged. The Jest failure comes from WorkspaceMembersTest.tsx:289: it expects one “New” badge, but two roles display it. This failure is inherited from |
Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
|
Pujan92
left a comment
There was a problem hiding this comment.
By mistake approved! still in review
|
Understood—the approval was accidental. Your latest review is “Changes requested”; no code changes are needed for this clarification. |
|
@MelvinBot The issue persists when you back to wallet again with browser back button and try to open edit spend rules. Condition: Card is in workspace A
Screen.Recording.2026-11-16.at.19.20.51.mov |
|
🤖 Web test steps verification results: ❌ fail Blocked on dev NewDot web: the supplied account shows “No workspaces yet,” so the required workspace/card fixtures are unavailable. The existing tests omit the browser-Back/retry sequence; the second redirect remains unverified, and no speculative fix was pushed.
|
|
@MelvinBot I debugged the second attempt locally. After browser Back, destinationStack, activeSplit and the preserved state for the Workspaces tab route are all undefined. Back rebuilds the state, so the tab route has no nested state and no preserved entry under its key. The scope check is skipped, jumpTo runs, and the tab restores workspace B. Please treat an unknown scope as different when the target is a scoped split. If activeSplit is undefined and jumpParams targets a split navigator whose sidebar has scope params (e.g. WORKSPACE_SPLIT_NAVIGATOR with policyID), use the same root REPLACE as the different-scope branch instead of jumpTo. |
Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
🤖 Web test steps verification results: ❌ fail Pushed 827be331: unknown scoped destinations now use root REPLACE, with all 44 GoBack tests, typecheck, targeted lint/spelling, and Storybook passing; full lint/Jest timed out. Browser verification remains blocked by a suspended session with no accessible UI, so the actual Back/retry sequence is unverified.
view run · no recording available |
|
|
|
@WojtekBoman Could you take a look at this PR's change in goUp? It builds on hasDifferentSplitScope from your #101180. Considering it is a navigation change, I think it is safer if you can take a look at these changes. |
|
@Pujan92 Sure! I'll check it out 👁️ |
|
Hey @Pujan92, I put together a draft PR that polishes this fix a bit #107263 What's different:
Tested on web, including your browser Back retry case. Let me know what you think! |
|
Thanks @WojtekBoman, I will check! |
|
Closing in favor of #107263 |











Explanation of Change
When Edit spend rules redirects from Wallet to another workspace's More features page, switching tabs must not reuse the previously opened workspace's sidebar. Check the destination split's scope and use normal navigation when it differs, preserving the existing modal-pop guards and same-scope tab switching.
Add two regression cases covering Account-to-Workspaces redirects with and without an underlying Workspaces tab navigator. Both assert that the sidebar and More features belong to the card's workspace.
AI Tests
Unknown destination scope after browser Back — 2026-11-16
Backward-navigation review fix — 2026-11-12
prettiernpm script.Main merge — 2026-11-12
0f60fbcf7c73b122d9d437cdd818fb052d155ced; resolved the sole import conflict by retaining both navigation-state helpers. Staged coding review found no violations.@formatjs/intl-datetimeformat. Full Jest encountered the same dependency errors and timed out after two minutes.expo-glass-effect, FormatJS and Appduct packages. Full lint timed out after two minutes. Changed spelling included main's files and reported 33 issues in 9 files.prettiernpm script.Original implementation checks (before main merge)
npm test -- --silent --runInBand tests/navigation/GoBackTests.tsx(39 tests, including both new regression cases).git diff --check.npm run prettier -- --log-level errorcannot run because this checkout has noprettierscript; direct Oxfmt check invocation was denied by the execution policy.origin/in this environment. No components or hooks were changed.Fixed Issues
$ #103751
PROPOSAL: #103751 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari