[Odometer] Image stitching#83556
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Hey @jakubkalinski0, the linked PR was merged, is this ready for review? |
Yes it is. I will just test it and add videos to the PR description and we are good to go with the review |
|
@mjasikowski 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-13.at.18.42.51.movAndroid: mWeb ChromeScreen.Recording.2026-03-13.at.18.37.49.moviOS: HybridAppScreen.Recording.2026-03-13.at.18.41.06.moviOS: mWeb SafariScreen.Recording.2026-03-13.at.18.38.42.movMacOS: Chrome / SafariScreen.Recording.2026-03-13.at.18.30.00.mov |
|
@Expensify/design Could you take a look at the stitching image below? Do you think we should display it smaller so users can see it fully? Currently, the preview is cut off, and users can only see the full image by clicking on it. Screen.Recording.2026-03-13.at.18.30.00.movAnother case on mobile where the second image is only partially displayed. Screen.Recording.2026-03-13.at.18.38.42.mov |
|
@jakubkalinski0 The rest looks fine to me |
|
@DylanDylann Then I guess we wait for the designs decision. In the meantime I will implement the adjusted preview and have it ready on hand. |
|
@DylanDylann I've caught one small issue/bug, so I fixed it already. It's a very small change |
|
@Julesssss Maybe we should move that discussion to the followup and get this PR going? |
Yeah, exactly what I was thinking this morning. Unfortunately the failing test case does appear to be failng with the latest changes. Actually perhaps it's coincidentally related... Will rerun again 🤞 |
Julesssss
left a comment
There was a problem hiding this comment.
Approving the final commit
|
Tests passing. We'll merge this final feature and can discuss the image stitching alignment separately. |
Yeah I think it is. This test job has been acting up this week |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @Julesssss 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/Julesssss in version: 9.3.38-0 🚀
|
|
Deploy Blocker #85368 was identified to be related to this PR. |
|
Deploy Blocker #85365 was identified to be related to this PR. |
|
Deploy Blocker #85405 was identified to be related to this PR. |
|
Added the three issues to the main tracker as bugs. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.38-4 🚀
|



Explanation of Change
This PR implements the next part of the Odometer feature. It adds the image stitching/merging flow that automatically combines the start and end odometer photos into a single receipt image.
Image stitching library (
src/libs/stitchOdometerImages/):stitchLayout.ts- Calculates optimal layout: if both images are portrait (height > width), arrange vertically, if there is at least one landscape then we arrange them horizontally.index.ts(web) - Uses the HTML Canvas API to draw both images onto an offscreen canvas, exports as a blob URL. Revokes the previous blob URL to prevent memory leaks (only one URL is kept at a time).index.native.ts(native) - Uses@shopify/react-native-skiafor GPU-accelerated compositing. Fetches images as ArrayBuffers, renders to an offscreen Skia surface, encodes to base64, and writes to a temporary file. Deletes any previously stitched file before creating a new one to avoid accumulating temp files.IOURequestStepDistanceOdometer.tsxintegration:stitchOdometerImages(startImage, endImage)is called insidenavigateToNextPagesetMoneyRequestReceiptFixed Issues
$ #77267
PROPOSAL: N/A
Tests
Both images scenario:
FAB-> go to"Track distance"-> choose"Odometer"tab"Next"-> verify no error is shon and navigation proceeds normally"Save"-> verify the new stitched image now uses the updated start/end photoSingle image scenario:
"Next"-> verify navigation proceeds without errors and the single photo alone is used as the receiptDelete one image after adding both:
"Three dots menu"-> press"Delete"-> verify the thumbnail returns to the empty state -> press"Next"-> verify the end photo alone is used as the receiptOffline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
iOS needs to be tested on a physcical device
Android: Native
1to6.webm
7.webm
8.webm
Android: mWeb Chrome
1to6mweb.webm
7mweb.webm
8mweb.webm
MacOS: Chrome / Safari
1to6.mov
7.mov
8.mov