fix: reduce INP latency for receipt image interactions#96089
fix: reduce INP latency for receipt image interactions#96089nabi-ebrahimi wants to merge 3 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@marufsharifi 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] |
|
@nabi-ebrahimi, could you please address the AI comments? |
|
PR doesn’t need product input as a perf refactor PR. Unassigning and unsubscribing myself. |
|
Hi @marufsharifi, thank you for taking the time to review. I’ve addressed both AI comments by removing the manual Could you please review again when you have a chance? |
|
@MelvinBot review |
ReviewThe approach is sound and the change is minimal. Deferring A few non-blocking points worth a look: Details
Nothing here blocks merge from a code-correctness standpoint — items 1–2 are wording, 3–5 are polish. The perf claim itself (INP improvement) can't be verified from the diff; it relies on the before/after Web Vitals measurements in the test steps. |
Explanation of Change
This PR improves the slow
Receipt-ImageINP interaction on web.The
Receipt-Imageinteraction happens when a user taps a receipt image inReportActionItemImageto open the receipt preview modal. Previously, the press handler navigated to the receipt modal immediately, so heavier modal navigation work could begin before the browser had a chance to paint the receipt click feedback.This PR moves the receipt modal navigation into a stable callback and, on web, defers the
Navigation.navigate()call until after a doublerequestAnimationFrame()paint boundary. This gives the browser an opportunity to paint after the receipt click before starting the heavier modal navigation work. Native platforms keep the existing immediate navigation behavior.Fixed Issues
$ #85595
PROPOSAL: #85595 (comment)
Tests
First, build the app for the web.
Open the app in Chrome with the Web Vitals extension enabled.
Navigate to a report that has an expense with a receipt image.
Refresh the page to reset the current page INP measurement.
Click the receipt image to open the receipt preview modal.
After the receipt modal opens, check the Web Vitals extension and record the INP value for the receipt image interaction.
Do not measure the Back/Close interaction as part of this test. Record the receipt image result before clicking Back.
Repeat the same steps before and after the change for comparison.
Verify that the receipt preview modal opens successfully and the Receipt-Image interaction on the web shows improved INP (or no regression compared to the baseline). The Back/Close interaction should be excluded from this measurement.
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Screen.Recording.2026-07-15.at.10.57.03.AM.mov
Android: mWeb Chrome
Screen_Recording_20260715_115043_Chrome.mp4
iOS: Native
Screen.Recording.2026-07-15.at.11.52.29.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-07-15.at.11.56.41.AM.mov
MacOS: Chrome / Safari
Screencast.From.2026-07-15.10-05-10.mp4