-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[Home Page][Bug] Two Nav Bars shown on inbox page on desktop #80701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Home Page][Bug] Two Nav Bars shown on inbox page on desktop #80701
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@codex review |
|
🚧 @mountiny 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! 🧪🧪
|
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ 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". |
|
@ZhenjaHorbach 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] |
| } | ||
|
|
||
| navigation.reset(navigation.getState()); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ CONSISTENCY-5 (docs)
The ESLint rule disable lacks justification explaining why react-hooks/exhaustive-deps is disabled. The effect now uses hasLayoutBeenExpanded (which depends on previousShouldUseNarrowLayout), navigation, and calls isRoutePreloaded, but the dependency array only includes shouldUseNarrowLayout.
Suggested fix:
Add a comment explaining the reasoning:
// eslint-disable-next-line react-hooks/exhaustive-deps
// We only want to reset navigation when shouldUseNarrowLayout changes, not when navigation or other derived values changeOr better, fix the dependencies to be complete and add proper memoization if needed.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef0f28f183
ℹ️ 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".
| // If the ReportsSplitNavigator has been preloaded on a narrow layout, the Report page won't be displayed on a wide screen. | ||
| if (hasLayoutBeenExpanded && isRoutePreloaded(NAVIGATORS.REPORTS_SPLIT_NAVIGATOR)) { | ||
| const currentState = navigation.getState() as StackNavigationState<ParamListBase> & {preloadedRoutes?: NavigationPartialRoute[]}; | ||
| const stateWithoutPreloadedInbox = { | ||
| ...currentState, | ||
| preloadedRoutes: currentState.preloadedRoutes?.filter((route: NavigationPartialRoute) => route.name !== NAVIGATORS.REPORTS_SPLIT_NAVIGATOR), | ||
| }; | ||
| navigation.reset(stateWithoutPreloadedInbox); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep layout reset from being skipped in other navigators
Because isRoutePreloaded checks the root state, this early return can fire in every navigator that uses this hook (split/search/root) whenever ReportsSplitNavigator is preloaded. In split navigators that rely on a reset to rehydrate their state for the new layout, this short‑circuits the normal layout reset and can leave the current tab in its narrow‑layout state (no sidebar) after widening the window. Example: open Settings on a narrow layout, wait for the inbox preload (1s), then resize wide — the settings split can stay single‑pane because its reset was skipped. Consider limiting this to the root navigator or still performing the layout reset for non‑root navigators after filtering preloaded routes.
Useful? React with 👍 / 👎.
…narrow layout to wide
ef0f28f to
9139281
Compare
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-01-28.11.16.45.movAndroid: mWeb Chrome2026-01-28.11.18.15.moviOS: HybridApp2026-01-28.11.16.45.moviOS: mWeb Safari2026-01-28.11.18.15.movMacOS: Chrome / Safari2026-01-28.11.10.39.mov |
|
LGTM |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.3.11-0 🚀
|
Explanation of Change
This issue occurs when
ReportsSplitNavigatoris preloaded on a small screen and then the browser window is resized to a wide layout. When preloading on a narrow layout, the report page is not added toReportsSplitNavigator.To fix that,
ReportsSplitNavigatoris removed frompreloadedRouteswhen expanding the browser window.Fixed Issues
$ #80679
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
MacOS: Chrome / Safari
Screen.Recording.2026-01-27.at.16.29.38.mov