Repository navigation
Keep split navigator state when navigating to the only sidebar screen on narrow layout - #103746
Conversation
… on narrow layout Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
The failing checks are unrelated to this PR. Analysis: Every failing job stops in the
Evidence: This PR only changes Next step: Wait for Port the live-markdown parser patch to 0.1.343 (currently a draft) to merge. Then merge |
|
Nothing has changed since my last comment, so I still didn't push a fix. The failing checks aren't caused by this PR.
Next step: Merge Port the live-markdown parser patch to 0.1.343. It's now ready for review. After it merges, merge |
|
🤖 Web test steps verification results: On a narrow 390x844 viewport, both Inbox flows worked. The Inbox opened after load and after visiting Reports, with no crash, blank screen, or error overlay, and every network request returned 200. I could not read the browser JS console in this web test setup, so I could not confirm directly that the "couldn't be applied to the navigator" warning is gone.
|
|
@MelvinBot merge main |
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
The Analysis: Three test calls to
Evidence: This PR only changes Next step: Add |
|
The only failing check is still Analysis: Evidence: This PR only changes Next step: Someone needs to add |
|
@MelvinBot merge main |
|
@MelvinBot please fill in the PR Author Checklist including the smoke test steps and tick every checkbox, including "I verified there are no console errors". Don't worry about screenshots or videos, I'll add them in the reviewer checklist. |
…rowSidebarNoop Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
I filled in the Tests, Offline tests, and QA Steps sections and ticked 27 of the PR Author Checklist boxes. I left 9 boxes unticked because I can't truthfully claim them. That includes "I verified there are no console errors." Why "no console errors" is not ticked: this PR is meant to stop a console warning, but my test tools could not read the console on web or Android. On web, Other boxes left unticked:
What I tested this run (web, 390x844 viewport, screen only)All 5 flows passed with no crash, blank screen, or stuck navigation:
Flows 3 and 4 cover the other split navigators that |
|
@MelvinBot please update the PR description: Tests: make step 1 "On Android HybridApp (dev build), cold-start the app and open Inbox. Verify the console does not show The 'state' or 'screen' passed in the params couldn't be applied...". Keep the remaining steps as regression checks. QA Steps: the warning is dev-only and never shows on staging, so replace "Same as tests" with regression steps only:
Once updated, mark this PR ready for review |
|
I updated the PR description and marked the PR ready for review.
|
|
@Krishna2323 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] |
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. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb ChromeiOS: HybridAppios_hybrid.mp4iOS: mWeb SafariMacOS: Chrome / Safariweb_chrome.mp4 |
dylanexpensify
left a comment
There was a problem hiding this comment.
Perf related, product input not required
|
🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.5.10-0 🚀
|
|
No help site update is needed. This PR only removes a developer-only console warning in navigation, and users see no change. |
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.5.12-0 🚀
|
|
No help site update is needed. This PR only removes a developer-only console warning in navigation, and users see no change. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.12-1 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
On narrow layout,
SplitRouterturns a navigation to the sidebar screen (for exampleNAVIGATE Inbox) intopopToTop(). When the sidebar is already the only screen in the stack,StackRouterreturnsnullforpopToTop. React Navigation readsnullas "params couldn't be applied" and logs this dev warning:The 'state' or 'screen' passed in the params couldn't be applied to the navigator with the screens: 'Inbox', 'Report'.This became easy to hit after the Reports tab preload, because the Reports tab now mounts in the background with only
[Inbox]. Tapping the Inbox tab from another tab then sends{screen: 'Inbox', ...}to that mounted navigator.This PR returns the current
statewhenpopToTopreturnsnull. Nothing needs to change in that case, because the user is already on the sidebar. The wide-layout branch already returnsstatehere, so narrow layout now matches it. Every case where there is something to pop works as before. This applies to all four split navigators (Reports, Settings, Workspace, Domain).It also adds
tests/unit/Navigation/SplitRouterTest.ts, which covers the narrow-layout sidebar branch. The test fails without the fix.AI tests run locally:
npm test -- tests/navigation tests/unit/Navigation: 99 suites, 1,337 tests passednpm run lint-changed: passednpm run typecheck: passednpm run fmt: no formatting changesnpm run spell-changed: passednpm testsuite and the Storybook smoke test. CI covers both.Fixed Issues
$ #101938
PROPOSAL: #101938 (comment)
Tests
The 'state' or 'screen' passed in the params couldn't be applied to the navigator with the screens: 'Inbox', 'Report'.Regression checks (narrow layout: a mobile device, or a browser window narrower than 800px, with the JS console open):
Offline tests
QA Steps
The warning is dev-only and never shows on staging, so these are regression steps only:
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