-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Workspace switcher: Expensify is no longer bolded and missing RBR after refreshing the page #40197
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 |
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
brickRoadsForPolicies
andunreadStatusesForPolicies
here without any variables in the dependency array, the functions usingOnyx.connect
outside of the component lifecycle caused the memoized functions to always return the data from whenallReports
is not populated yet, hencebrickRoadsForPolicies
andunreadStatusesForPolicies
don't contain any data -> causing:Given that both
getWorkspacesBrickRoads
andgetWorkspacesUnreadStatuses
WorkspacesSettingsUtils functions are only used within the WorkspaceSwitcherPage, we can make it such that we actually pass thereports
andpolicies
as arguments directly from the WorkspaceSwitcherPage component, keeping the memoization while leveraginguseOnyx
.The additional
reportActions
optional argument passed down togetWorkspacesBrickRoads
and the changes withinWorkspacesSettingsUtils
related to this were done because on Android / iOS mWeb the RBR / GBR wouldn't show up when refreshing the page because of thisOnyx.connect
logic.Small refactor bonus: as a clean-up after doing this we removed the
withOnyx
HOC and all the associated logic and types fromWorkspaceSwitcherPage
asuseOnyx
handles all that 😎Additionally, the
hasUnreadData
bold 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Note: On Android:mWeb the not found page appearing after refresh happens because of
ngrok
tunneling.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