[NOQA] perf: extract MoneyRequestReportPreview carousel and message-animation hooks#94675
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
07c3ee0 to
b3898e9
Compare
b3898e9 to
9013f10
Compare
|
@abzokhattab 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] |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
PR doesn’t need product input as a performance PR. Unassigning and unsubscribing myself. |
|
reviewing |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-06-29.at.00.45.24.mov |
abzokhattab
left a comment
There was a problem hiding this comment.
the changes looks good to me .. i flagged one issue that we need to confirm
other than that ... i validated the change using the following test steps:
- Go to a chat that has an expense report preview card with 2 or more expenses
- On the preview card, tap the left/right arrows to scroll through the expenses
- Tap Submit on the preview card
- Watch the animation play on the preview card after submitting ... verify that the animation works well.
|
@OlimpiaZurek more conflicts |
|
🚧 mountiny 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! 🧪🧪
|
| const previewMessageStyle = useAnimatedStyle(() => ({ | ||
| opacity: previewMessageOpacity.get(), | ||
| })); | ||
| const checkMarkScale = useSharedValue(iouSettled ? 1 : 0); |
There was a problem hiding this comment.
NAB: checkMarkScale and thumbsUpScale are set here but I don't see anything reading them (no .get(), no animated style, no icon) — looks like dead code already on main. The docstring also says this hook plays "checkmark / thumbs-up animations", but nothing renders them. Since this is a cleanup refactor, should we just remove them (and fix the docstring), or were these animations supposed to be wired up?
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.25-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.4.25-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
This is the first step in breaking up MoneyRequestReportPreviewContent — the ~800-line component that does several jobs at once (loading state, the preview-message animation, the header, the transaction carousel, and the hold menu).
This PR pulls the two biggest chunks of logic out into their own hooks and uses them directly in the component, so behavior is unchanged but the file gets noticeably smaller and easier to follow:
MoneyRequestReportPreviewContent goes from ~810 to ~570 lines and just calls these two hooks. Later PRs introduce the context/provider and split the remaining UI (header, carousel, total, hold menu) into their own components.
Fixed Issues
$ #94603
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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