Skip to content

[GPS] Add stop address editing - #90002

Merged
neil-marcellini merged 38 commits into
Expensify:mainfrom
software-mansion-labs:@GCyganek/gps/edit-stop-test
Jul 28, 2026
Merged

neil-marcellini merged 38 commits into
Expensify:mainfrom
software-mansion-labs:@GCyganek/gps/edit-stop-test

Conversation

@GCyganek

@GCyganek GCyganek commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds an "Edit stop" screen to the GPS distance flow. After stopping a trip, users can trim it to an earlier stop point via a slider; the trimmed distance/endpoint are stored in Onyx in gpsDraftDetails and sent as modifiedDistance to TrackExpense/CreateDistanceRequest. Also modifying gpsCoordinates prop to include edited stop coordinates and waypoints to stop on the edited stop per backend request. Also refactors map markers from markerComponent to markerType for performance to make Slider UX smooth.

Fixed Issues

$ #95060, #85802
PROPOSAL: N/A

Tests

Do this flow for SelfDM and workspace expense:

  1. Start a GPS distance expense (FAB > Track Distance > GPS) and cover some distance
  2. Stop the trip. Verify a pencil "Edit" button appears next to the Discard button in the Distance row.
  3. Tap the Edit button. Verify the "Edit stop" screen opens showing the map route, a slider, and the total edited distance.
  4. Drag the slider left. Verify the route on the map shrinks live, the stop marker moves to the new endpoint, and the "Total distance" value decreases accordingly.
  5. Tap Save. Verify you return to the GPS screen, the displayed distance and end address reflect the trimmed stop.
  6. Tap Save again. Verify the confirmation page shows the trimmed distance and route correctly.
  7. Tap back button to go back to GPS screen.
  8. Tap Edit and drag the slider all the way to the right (full distance), Save. Verify the trim is reset and the original full distance is shown.
  9. Trim the trip again and Save so that there modified distance is not equal to the original one.
  10. Tap Resume and Stop after some time, verify that the trim is reset and the trip is fully shown on the screen with the correct distance.
  11. Trim the trip again and tap Save to go to confirmation page
  12. Tap Create expense
  13. Verify that created expense has correct data and receipt saved

Offline tests

  1. Turn off network connection with recorded GPS trip.
  2. Open Edit Stop screen, trim the route and Save.
  3. Verify the trimmed endpoint address falls back to coordinates (reverse geocode is skipped offline) and the distance updates correctly.
  4. Turn on network connection and verify that the trimmed endpoint address updates to human readable

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
iOS: Native
Screen.Recording.2026-07-21.at.15.54.14.mov
Screen.Recording.2026-07-21.at.16.12.30.mov
Screen.Recording.2026-07-21.at.15.52.01.mov

@melvin-bot

melvin-bot Bot commented May 8, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

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 --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 94.81% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
src/components/ConfirmedRoute.tsx 0.00% <ø> (ø)
...mponents/DistanceRequest/DistanceRequestFooter.tsx 82.50% <ø> (+1.54%) ⬆️
src/components/MapView/GPSWaypointLayer.tsx 0.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 66.66% <ø> (ø)
src/libs/actions/IOU/Split.ts 72.35% <100.00%> (+0.10%) ⬆️
src/libs/actions/IOU/TrackExpense.ts 79.52% <100.00%> (+0.06%) ⬆️
...stance/handleMoneyRequestStepDistanceNavigation.ts 82.79% <ø> (ø)
.../request/step/confirmation/useExpenseSubmission.ts 73.24% <100.00%> (+0.64%) ⬆️
... and 18 more
... and 29 files with indirect coverage changes

@dukenv0307

Copy link
Copy Markdown
Contributor

Yeah, LGTM

@neil-marcellini
neil-marcellini self-requested a review July 27, 2026 15:28

@neil-marcellini neil-marcellini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed most of this but not all of it. It's looking pretty good but I do think we should change some things based on my comments below. Also, please add unit tests.

Comment thread src/libs/GPSDraftDetailsUtils.ts Outdated
Comment thread src/pages/iou/request/step/IOURequestStepGPSTripEdit/index.tsx Outdated
Comment thread src/types/onyx/Transaction.ts Outdated
@neil-marcellini
neil-marcellini self-requested a review July 28, 2026 15:36
@neil-marcellini

Copy link
Copy Markdown
Contributor

Pls remember to re-request a review from me so I don't miss it 🙂

@neil-marcellini neil-marcellini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really solid, thanks! I'm excited to see it launch.

Comment thread src/styles/index.ts
...cursor.cursorPointer,
},

editedStopSliderKnob: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: For consistency editedStop... => editStop...

@neil-marcellini
neil-marcellini merged commit 7af4726 into Expensify:main Jul 28, 2026
37 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.4.46-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site changes required ✅

This PR adds a user-facing Edit stop feature to the GPS Distance expense flow (pencil Edit icon → Edit stop screen with a slider to trim the trip, showing Total distance, then Save). That behavior wasn't documented, so I've drafted the help site update.

Draft PR: #97379 — Docs updates for E/A#90002 Document GPS Edit stop trimming feature

What changed in Distance-Expenses.md:

  • Added an Edit stop step to the How to create a GPS Distance expense (Mobile only) section.
  • Added a FAQ: Can I shorten a GPS trip after I stop tracking?
  • Updated frontmatter keywords with the new feature terms.

All UI labels (Edit, Edit stop, Total distance, Save) were verified against the strings this PR adds in src/languages/en.ts and IOURequestStepGPSTripEdit, and follow the HelpDot naming and authoring guidelines. The PR is a draft, labeled HelpDot, and assigned to GCyganek.


@GCyganek, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@lanitochka17

Copy link
Copy Markdown

Deploy Blocker #97488 was identified to be related to this PR.

@izarutskaya

Copy link
Copy Markdown

@GCyganek Trimmed route disappear after Resume and Stop the trip on iOS. It doesn't exist in prod. Could you please check and let ne know if we need create issue for this?

Bug7221854_1785412624609.90002I.mp4

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@GCyganek

Copy link
Copy Markdown
Contributor Author

Trimmed route disappear after Resume and Stop the trip on iOS. It doesn't exist in prod. Could you please check and let ne know if we need create issue for this?

@izarutskaya I was not able to reproduce it on my iOS device and on simulator, is it reproducible for you or did it happen only once? The video doesn't tell me everything, if it's reproducible we should create a new issue

@izarutskaya

Copy link
Copy Markdown

Issue is not reproducible
Build 9.4.51

ScreenRecording_08-06-2026.19-32-22_1.MP4

@GCyganek

GCyganek commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for checking this and letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants