[Odometer] Image capture for mWeb#83236
Draft
jakubkalinski0 wants to merge 9 commits intoExpensify:mainfrom
Draft
[Odometer] Image capture for mWeb#83236jakubkalinski0 wants to merge 9 commits intoExpensify:mainfrom
jakubkalinski0 wants to merge 9 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
20 tasks
…eterPhotoInformation at the bottom of a camera
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
This PR implements the next part of the Odometer feature, aligned with Phase 1 task 1.D. This PR focuses on the mWeb implementation of the image capture flow.
src/pages/iou/request/step/IOURequestStepOdometerImage/index.tsx. We intentionally did not reuseIOURequestStepScanbecause that screen includes receipt‑specific behaviors (SmartScan, receipt state logic). The implementation covers all the following aspects:Due to duplicated logic across
IOURequestStepOdometerImageandIOURequestStepScanthere is a plan to introduce more abstraction for the camera related logic/features in a followup once the Odometer project is done.Fixed Issues
$ #77266
PROPOSAL: N/A
Tests
Important
Caution
Use Android emulator or a physical device for testing - explanation above ^
Prerequisites:
Turn off camera permissions for Expensify -> the most convenient for you would probably be to set
"Ask every time"FAB-> go to"Track distance"-> choose"Odometer"tab`Thumbnail-> you should see the screen shown below"Continue"-> verify that you are shown a native prompt asking you to allow Expensify to use the camera"Only this time"(pressing"While using this app"would behave the same but will require you to turn off camera permissions for Expensify once again later) -> verify that you now have access to the came (the screen from step 2 is gone and you see a working camera display like the one below)Important
If your device has no back camera then you will see a following screen (same behavior as in the scan component)

Important
If your device has no flash then the

Bolticon of flash in the top right corner will be hidden - in order to test the flash itself you have to do it on a physical deviceOdometer pagewith the photo you have just taken being displayed correctly in the thumbnailthumbnailonce again then you are brought to theImage Previewand it displays the photo correctlyThree dots menuand verify that when you press"Replace"then you are brought to theCamera photo captureand that it works correctly"While using this app"earlier)"Don't allow"when asked about camera permissions -> verify that you are shown this screen with further instructions"these instructions"and verify that you are brought to this"help.expensify"page"help.expensify", i.e. change your browser camera permissions accordingly and refresh the App pageCamera photo capture-> verify that it works properlyGalleryicon at the bottom left corner and verify that all the options work properlyImportant
Proper functionality for

Camera Camcorderwhen you try to submit a video is to show the following prompt as we do not allow videos for Odometer Image (same behavior as Scan)End odometer photo(although if everything worked properly forStart photothen it will work the same for theEnd photo)End odometer photoWarning
When testing
End odometer photoafter theStart odometer phot"your camera permissions forExpensifywere probably set to"Don't allow"after the step 9 so you will have to change it to"Ask every time"when testing the second photo flowOffline tests
Same as 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: mWeb Chrome
iOS: mWeb Safari