perf: extract components from IOURequestStepConfirmation#86865
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
No product review needed |
grgia
left a comment
There was a problem hiding this comment.
@OlimpiaZurek is there an issue or proposal for this change?
Hey @grgia! This is part of this issue: #81849. Here are the relevant comments: #81849 (comment) and #81849 (comment). Maybe it would be better to create a sub-issue for this effort, as there will be a few PRs here? |
src/pages/iou/request/step/confirmation/ReceiptFileValidator.tsx
Outdated
Show resolved
Hide resolved
Julesssss
left a comment
There was a problem hiding this comment.
Minor conflicts now unfortunately
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-04-08.at.1.09.57.AM.movAndroid: mWeb ChromeScreen.Recording.2026-04-08.at.1.13.33.AM.moviOS: HybridAppScreen.Recording.2026-04-08.at.1.04.36.AM.moviOS: mWeb SafariScreen.Recording.2026-04-08.at.1.14.05.AM.movMacOS: Chrome / SafariScreen.Recording.2026-04-08.at.12.42.38.AM.mov |
|
Hi @OlimpiaZurek, some conflicts here too. PR looks good to me, @cristipaval can hopefully give a final review tomorrow |
Hey! All conflicts resolved. |
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/cristipaval in version: 9.3.55-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. No help site updates are required. This PR is a pure internal performance refactoring of |
Explanation of Change
IOURequestStepConfirmationwas a 1,742-line monolith with 25 useOnyx subscriptions (including 2 full-collection subs), 9 useEffect hooks handling unrelated concerns, and 8 useCallback hooks. Two full-collection subscriptions (COLLECTION.REPORT_DRAFTandCOLLECTION.TRANSACTION_VIOLATIONS) caused the entire 18-component render tree to re-render on any change to any report draft or transaction violation app-wide.This PR:
COLLECTION.REPORT_DRAFTfull-collection subscription — getReportOrDraftReport already falls back to its module-level Onyx connection, so the component-level subscription was redundant and causing unnecessary re-renders on every draft change across the app.COLLECTION.TRANSACTION_VIOLATIONSfrom callback dependency arrays via ref — Previously, every violation change recreated all 7 submission callbacks, triggering prop updates to MoneyRequestConfirmationList. Now callbacks read violations from a ref at call time, breaking the cascade.Result: Create Expense flow
🟢 Duration Diff: -299.000 ms (-8.7%)
🟢 Commit Count Diff: -19
Result: Submit to Search
🟢 Duration Diff: -118.400 ms (-5.9%)
🟢 Commit Count Diff: -3
Fixed Issues
$ #86986, #81849
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
same as tests
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))npm run compress-svg)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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari