Repository navigation
feat: show full distance e-receipt on hover for map distance requests v2 - #93102
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.
|
a61304b to
fcbf593
Compare
fcbf593 to
673cb40
Compare
|
@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] |
| transaction: Transaction; | ||
| }; | ||
|
|
||
| function HoveredDistanceEReceipt({transaction}: HoveredDistanceEReceiptProps) { |
There was a problem hiding this comment.
Hey, should we rewrite HoveredDistanceEReceipt to use Reanimated? The scale calculation could move off the JS thread with useSharedValue + useAnimatedStyle, avoiding re-renders on layout changes. Is there a plan to use this on mobile too? That would make it more worth it.
There was a problem hiding this comment.
I think we can keep it as-is for now — the scale isn't animated, it's computed once from the initial layout, so there isn't really any per-frame work to move off the JS thread. The component is also hover-only, so it won't be used on mobile for now. If we ever build a mobile preview for it, Reanimated would definitely be worth revisiting 🫡
|
LGTM 🚀 |
|
Video above looks good to me 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-06-12.at.1.49.51.AM.movAndroid: mWeb ChromeScreen.Recording.2026-06-12.at.1.50.56.AM.moviOS: HybridAppSimulator.Screen.Recording.-.iPhone.17.-.2026-06-12.at.01.48.03.moviOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.17.-.2026-06-12.at.01.49.45.mov |
| // Keep `hovered` in sync while moving over the receipt so the distance e-receipt overlay | ||
| // (rendered below when `hovered`) stays visible while zooming. | ||
| onMouseMove={() => { | ||
| if (isLoading || hovered) { | ||
| return; | ||
| } | ||
| hoverBind.onMouseEnter(); | ||
| }} |
There was a problem hiding this comment.
NAB, but the comment doesn't read as related to the regression: Distance - Only the map appears when hovered after closing RHP #93004.
There was a problem hiding this comment.
I rewrote it :) Please take a look if it's ok now
| * local `receipt.source` only refreshes once the Pusher push arrives. While any of these edits are pending the stored | ||
| * map image is stale and can't be regenerated locally. | ||
| */ | ||
| function hasPendingDistanceReceiptRegeneration(transaction: OnyxInputOrEntry<Transaction>): boolean { |
There was a problem hiding this comment.
Can you add unit test for this?
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 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.9-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review — no changes required I reviewed the changes in this PR against the help site articles under Why:
Because no documentation changes are needed, I did not create a draft help site PR. @WojtekBoman, please confirm whether you agree this hover-zoom enhancement doesn't warrant a help site update. If you'd like me to document it anyway (e.g., a short note in the Distance Expenses article), let me know and I'll create the draft help site PR. |
|
Which steps should we QA? There is no "Tests" section as such. |
|
Deploy Blocker #93748 was identified to be related to this PR. |
|
@kavimuru seems like these are the tests:
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.9-0 🚀
|
Explanation of Change
On hover over a map distance receipt, overlay the full distance e-receipt (map + amount + waypoints) scaled to fit the box, magnified by
ReceiptHoverZoom. Gated to map/route distance only viaisMapBasedDistanceRequest(excludes odometer/manual); kept visible while moving the cursor during zoom; and hidden viahasPendingDistanceReceiptRegenerationwhile the receipt regenerates so no stale map shows.Screen.Recording.2026-06-10.at.10.57.49.mov
Fixed Issues
$ #90793 (comment)
PROPOSAL:
This PR re-lands the reverted feature and must verify the three deploy blockers that caused the revert no longer occur: #93001, #93004 and #93010.
Offline tests
QA Steps
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