[Fix] Workspace - Inconsistent workspace subtitle when approver is changed in offline mode#56770
Conversation
|
@mananjadhav 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] |
| }, [personalDetails, reports]); | ||
|
|
||
| const initializeOptions = useCallback(() => { | ||
| if (areOptionsInitialized.current) { |
There was a problem hiding this comment.
Would this cause any performance impact?
There was a problem hiding this comment.
Good question! The way I see it is the following - this functionality was missing, and it needed to be added, so the app can function properly, it's not like we are compounding the performance of an existing functionality, we are adding one.
Previously, these options would only be initialized on the very first render of the MoneyRequestParticipantsList and stay that way until you relog/restart, ignoring changes made to the reports/policies made by you and others.
There was a problem hiding this comment.
Yeah I don't have the best context on this one, so hence I am checking. May be @grgia could take a look as well.
There was a problem hiding this comment.
I don't have the full context on why we needed this initially
src/libs/OptionsListUtils.ts
Outdated
| const submitToAccountID = getSubmitToAccountID(policy, report); | ||
| const submitsToAccountDetails = allPersonalDetails?.[submitToAccountID]; | ||
| const subtitle = submitsToAccountDetails?.displayName ?? submitsToAccountDetails?.login; | ||
| const subtitle = getChatRoomSubtitle(report, {isCreateExpenseFlow: true}); |
There was a problem hiding this comment.
I am just trying to understand if something can break with the case with!subtitle || !config.isCreateExpenseFlow ?
There was a problem hiding this comment.
You're right, I'm reverting that change
| searchInServer(debouncedSearchTerm.trim()); | ||
| }, [debouncedSearchTerm]); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
does it cause any extra rerender? Do we have a way to check this?
There was a problem hiding this comment.
Based on my testing, this just adds a function call
|
@mananjadhav I checked and it looks like this PR won't solve #56609, it must be something else |
|
🚧 @grgia has triggered a test build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
I am still testing this. Will have this completed before Monday. |
|
I did a basic test on the web. But I need to test this more across all platforms, which I will get done by today/tomorrow |
…7-inconsistent-workspace-subtitle
|
@mananjadhav I just updated the branch with the latest main, let me know if there's anything you'd like me to change here! |
|
I'll have the checklist updated today |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-submits-to-offline.movAndroid: mWeb Chromemweb-chrome-submits-to-offline.moviOS: Nativeios-submits-to-offline.moviOS: mWeb Safarimweb-safari-submits-to-offline.movMacOS: Chrome / Safaridesktop-submits-to-offline.movMacOS: Desktopweb-submits-to-offline.mov |
|
In the videos you'll notice an unrelated Mapbox error due to some keys. It's a problem with my local setup. |
grgia
left a comment
There was a problem hiding this comment.
LGTM, As long as there are no major performance regressions, should be good to go
|
✋ 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.1.7-1 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.7-2 🚀
|
Explanation of Change
The options list has to be initialized on each render of
MoneyRequestParticipantsSelectorin order to reflect the latest changes, including changing the approver.Fixed Issues
$ #56507
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as Tests section above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
MacOS: Chrome / Safari
web-compressed.mov