-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Workspace switcher: Expensify is no longer bolded and missing RBR after refreshing the page #40197
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
Conversation
…er refreshing the page
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemobile-chrome.moviOS: Nativeios.moviOS: mWeb Safarimobile-safari.movMacOS: Chrome / Safari0-web.mp4MacOS: Desktopdesktop.mov |
eh2077
left a comment
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.
Looks good and tested well!
|
@iwiznia I'll handle the conflicts since there's been some changes to the |
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.64-6 🚀
|
Details
Because we used to memoize the
brickRoadsForPoliciesandunreadStatusesForPolicieshere without any variables in the dependency array, the functions usingOnyx.connectoutside of the component lifecycle caused the memoized functions to always return the data from whenallReportsis not populated yet, hencebrickRoadsForPoliciesandunreadStatusesForPoliciesdon't contain any data -> causing:Given that both
getWorkspacesBrickRoadsandgetWorkspacesUnreadStatusesWorkspacesSettingsUtils functions are only used within the WorkspaceSwitcherPage, we can make it such that we actually pass thereportsandpoliciesas arguments directly from the WorkspaceSwitcherPage component, keeping the memoization while leveraginguseOnyx.The additional
reportActionsoptional argument passed down togetWorkspacesBrickRoadsand the changes withinWorkspacesSettingsUtilsrelated to this were done because on Android / iOS mWeb the RBR / GBR wouldn't show up when refreshing the page because of thisOnyx.connectlogic.Small refactor bonus: as a clean-up after doing this we removed the
withOnyxHOC and all the associated logic and types fromWorkspaceSwitcherPageasuseOnyxhandles all that 😎Additionally, the
hasUnreadDatabold style applied to the Workspace switcher workspaces that have unread data was fixed based on #39928 (comment).Fixed Issues
$ #39928
PROPOSAL: #39928 (comment)
Tests
Precondition: There are a few read / unread workspaces, some with RBR (can be invoked by creating scan request with invalid receipt).
Offline tests
TLDR: same as Tests.
Precondition: There are a few read / unread workspaces, some with RBR (can be invoked by creating scan request with invalid receipt).
QA Steps
TLDR: same as Tests.
Precondition: There are a few read / unread workspaces, some with RBR (can be invoked by creating scan request with invalid receipt).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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: Native
android.mov
Note: On Android:mWeb the not found page appearing after refresh happens because of
ngroktunneling.Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-11.at.02.46.15.mov
MacOS: Desktop
desktop.mov