Fix/63635 onyx lift money report view#65644
Conversation
|
@hoangzinh 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] |
|
Money Request Report |
|
I think perf will remain the same and won't be improved here as I mentioned in the PR description that this will be a single Created reportAction for the report. |
| const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true}); | ||
| const [transactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${updatedTransaction?.reportID}`, {canBeMissing: true}); | ||
| const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`]; | ||
| const chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReport?.parentReportID}`]; |
There was a problem hiding this comment.
Should we only pick reportID and errorFields as previously? To avoid recalcuate/render when unrelated chatReport data is changed.
There was a problem hiding this comment.
It will be rerender whenever allReports gets changed. I don't think picking specific fields help here to avoid rerendering.
There was a problem hiding this comment.
It will avoid reevalulate the useCallback here
Do you think it's worth to keep previous logic?
There was a problem hiding this comment.
hmm, makes sense. Reverted.
There was a problem hiding this comment.
Sorry if it's unclear. I mean we can retrieve chatReport from allReports but should pick reportID and errorFields as previously.
const chatReport = lodashPick(allReports?.[${ONYXKEYS.COLLECTION.REPORT}${parentReportID}], ['reportID', 'errorFields']);
Btw, I think it will always recreate new object. Hmm, can you revert to your original version? I think it's not a big deal in this case.
There was a problem hiding this comment.
Btw, I think it will always recreate new object
Yes.
can you revert to your original version? I think it's not a big deal in this case.
Done.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-07-14.at.21.10.46.android.movAndroid: mWeb ChromeScreen.Recording.2025-07-14.at.20.05.01.android.chrome.moviOS: HybridAppScreen.Recording.2025-07-14.at.21.19.39.moviOS: mWeb SafariScreen.Recording.2025-07-14.at.21.15.15.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-07-14.at.20.01.24.web.movMacOS: DesktopScreen.Recording.2025-07-14.at.20.02.54.desktop.mov |
|
✋ 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/luacmartins in version: 9.1.81-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.1.81-7 🚀
|
Explanation of Change
Part 2 - Improve ReportList performance by avoiding some of the Onyx connections from the MoneyRequestView component.
I think we don't really need to remove all onyx connections from
MoneyReportViewandMoneyRequestView. Bcoz these are the Views for a specific report and it(View action) will be only rendered once in any of the report. So, a single onyx connection for some of the keys will be fine here.Fixed Issues
$ #63635
PROPOSAL:
Tests
Same as QA
Offline tests
Same as QA
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))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
and7.webm
Android: mWeb Chrome
and8.webm
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-07-11.at.16.12.56.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-07-11.at.16.14.39.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-07-10.at.01.01.29.mov
MacOS: Desktop
Screen.Recording.2025-07-11.at.17.45.40.mov