Repository navigation
Conversation
Contributor
|
|
2 of 38 tasks
This branch has not been deployed
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
Previously,
SubmitDetailsPagecalledsnapshotUserLocation()on mount and held a reactiveuseOnyx(ONYXKEYS.USER_LOCATION)subscription. Querying device GPS permissions and writing coordinates into Onyx inside theShareExtensionOpenSubmitFlowtelemetry span caused main-thread latency and triggered unnecessary component re-renders - even though GPS coordinates are only needed at submit time to attach to the expense payload, never during UI rendering.This PR optimizes the share extension flow by pre-warming location in
ShareRootPageand convertingSubmitDetailsPageto a one-shot lazy read viaOnyx.get:Onyx.get()API introduced in[email protected]PR #102135. Once PR #102135 is merged intomain, this PR will be rebased cleanly as a single commit containing only the GPS and Share Extension changes.src/pages/Share/ShareRootPage.tsx: Pre-warms device GPS viasnapshotUserLocation()in the background as soon as a scannable receipt file is processed, caching coordinates while the user picks a recipient.src/pages/Share/SubmitDetailsPage.tsx: Removes the mount-timesnapshotUserLocation()effect and drops the reactiveuseOnyx(ONYXKEYS.USER_LOCATION)subscription. Replaces it with a lazyawait Onyx.get(ONYXKEYS.USER_LOCATION)call insideonSuccessright when the user submits, keeping device queries off the open span and preventing late GPS writes from re-rendering the page.tests/: Addstests/ui/ShareRootPageLocationTest.tsxto verify early GPS caching and permission error resilience; updatestests/ui/SubmitDetailsPageTest.tsxto ensure neither opening the details page nor confirming reads the hardware device.Fixed Issues
$ #95335
PROPOSAL:
Tests
ShareRootPageto navigate toSubmitDetailsPage.gpsPoint) captured during pre-warming are attached to the expense request.Offline tests
QA Steps
ShareRootPageto navigate toSubmitDetailsPage.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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