Repository navigation
Fix distance e-receipt overlay showing after editing when cursor hovers over image - #93943
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d1c99d254
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| // the cursor is already over the receipt (e.g. after closing the RHP) or `onMouseEnter` fires | ||
| // while the receipt is still loading, no new `mouseenter` event occurs, so we re-sync on mouse move. | ||
| onMouseMove={() => { | ||
| setPointerMovedAfterLoad(true); |
There was a problem hiding this comment.
Ignore mouse moves while the receipt is still loading
Because this flag is set before checking isLoading, any small cursor movement over the receipt while the new map is still loading marks pointerMovedAfterLoad as true. In that scenario the distance overlay can appear during the reload or immediately when onLoad flips isLoading false, even though the user has not moved the pointer after the newly loaded map is ready, which defeats the guard added for edited distance receipts.
Useful? React with 👍 / 👎.
|
@QichenZhu 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] |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dd9a9fe91
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| return; | ||
| } | ||
| setIsLoading(true); | ||
| setPointerMovedAfterLoad(false); |
There was a problem hiding this comment.
Reset hover gate before pending regeneration clears
This reset only runs after receipt.source changes, but in the distance-edit path UpdateMoneyRequest clears the regeneration pendingFields on API success before the Pusher update that delivers the new receipt.source. If the user had already moved over the old map and keeps the cursor parked, pointerMovedAfterLoad remains true when canShowDistanceEReceipt flips back to true, so the overlay can still reappear automatically during that API-success→source-update gap; reset the gate when regeneration starts or while those pending fields are present, not only after the source changes.
Useful? React with 👍 / 👎.
This comment has been minimized.
This comment has been minimized.
|
@MelvinBot Review |
ReviewThe approach is sound and correctly fixes the issue. Gating ✅ LGTM on logic — a few non-blocking points below. Verification of the fix path
Non-blocking
Next Steps: Reply with |
Agreed with the bot's second point, otherwise this works well. Screen.Recording.2026-06-19.at.3.54.03.PM.mov |
QichenZhu
left a comment
There was a problem hiding this comment.
We have two separate components: one handles zoom and the other handles the map/receipt flip, and they update independently.
Should we make one control the other, or have one read the other's state, so there is a single source of truth and they are always in sync?
Good call! I've made |
|
@QichenZhu can you review again please |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen_recording_20260622_211342.webmAndroid: mWeb ChromeScreen_recording_20260622_211454.webmiOS: HybridAppSimulator.Screen.Recording.-.iPhone.17.-.2026-06-22.at.21.07.21.moviOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.17.-.2026-06-22.at.21.08.28.movMacOS: Chrome / SafariScreen.Recording.2026-06-22.at.9.05.36.PM.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. |
|
🚧 @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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.17-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no docs changes required. This PR is an internal UI bug fix. It adds a shared There are no user-facing changes — no new features, settings, tab names, button labels, or workflow changes — so nothing in No draft docs PR was created. |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
Explanation of Change
After a distance expense edit the receipt image reloads with a new source URL. If the cursor was already over the map image before the reload,
hoveredremainedtrueacross the loading cycle, causingHoveredDistanceEReceiptto flash immediately when the new map finished loading — without the user moving the pointer. AddedpointerMovedAfterLoadstate that resets on each source change and is set only ononMouseMove, so the overlay only appears after the cursor actively moves over the image.Screen.Recording.2026-06-18.at.17.11.34.mov
Fixed Issues
$ #93748
PROPOSAL:
Tests
Bug fix — overlay must not appear when cursor is parked under a newly-loaded map
HoveredDistanceEReceiptoverlay (e-receipt card with amount and waypoints) does not appear automatically.Regression — normal hover zoom still works
HoveredDistanceEReceiptoverlay.Offline tests
N/A — this change is purely a hover/UI interaction with no API calls or Onyx operations.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari