An additional entry is added to the browser history when opening the app#67610
Conversation
2340a30 to
2a29f59
Compare
| function SidePanel() { | ||
| const {isSidePanelTransitionEnded, shouldHideSidePanel, sidePanelTranslateX, shouldHideSidePanelBackdrop, closeSidePanel} = useSidePanel(); | ||
|
|
||
| useSyncSidePanelWithHistory(); |
There was a problem hiding this comment.
Are you sure this is the right spot for this hook? It will be called even when side panel is not available/closed
There was a problem hiding this comment.
Yes, I need to open it when I go forward in the browser history, then the side panel is not rendered, so the hook will not be called if I call it from HelpModal
There was a problem hiding this comment.
It's the described case
Screen.Recording.2025-08-01.at.11.02.42.mov
|
@alitoshmatov 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] |
|
@alitoshmatov can you review please? |
|
@alitoshmatov friendly bump 😄 |
|
Working on it |
|
@alitoshmatov how is it looking? |
|
@WojtekBoman Is this supposed to happen? When info page is opened not as RHP it is not closing when pressing back button of the browser Screen.Recording.2025-08-11.at.9.58.40.AM.mov |
Yes, it's planned :) On this screen width, help panel is part of the page, on a smaller layout it's displayed as a separate RHP page - then we push a new entry to the history |
2a29f59 to
f2ab0af
Compare
Great catch! I added optional chaining to the |
|
@alitoshmatov can you please prioritize now |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb Chromenav-mweb.moviOS: HybridAppnav-ios.mp4iOS: mWeb Safarinav-safari.mp4MacOS: Chrome / Safarinav-web2.movMacOS: Desktopnav-desktop.mov |
mountiny
left a comment
There was a problem hiding this comment.
Thanks looks good, just requesting one more comment
76bd28c to
665c801
Compare
|
@mountiny all checks passed |
665c801 to
d9e55ac
Compare
d9e55ac to
e1dd0bf
Compare
|
@mountiny friendly bump |
|
✋ 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/mountiny in version: 9.1.96-0 🚀
|
|
I think this PR might have caused this console error: #68676 |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.96-2 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.96-2 🚀
|


Explanation of Change
This PR fixes an issue where an extra history entry was added when opening the app. It was caused by the old mechanism used to sync the side panel with the browser history. Now this mechanism has been refactored using the custom history system introduced in this PR.
How does the side panel sync with browser history?
A new history entry for the side panel is added when it is displayed as RHP.
Thanks to that it's possible to open/close the side panel with the browser arrow buttons.
When the browser window is resized to the wide layout when the side panel is no longer displayed as RHP, the side panel history entry is removed.
Fixed Issues
$ #66254
PROPOSAL:
Tests
Offline tests
QA Steps
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))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
Android: mWeb Chrome
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-08-01.at.12.23.06.mov
Screen.Recording.2025-08-01.at.12.18.52.mov
Screen.Recording.2025-08-01.at.12.17.17.mov
MacOS: Desktop
Screen.Recording.2025-08-01.at.12.27.54.mov