Skip to content

[GPS] Update user location on GPS screen when there is no active GPS trip#91418

Merged
neil-marcellini merged 31 commits into
Expensify:mainfrom
software-mansion-labs:@GCyganek/gps/user-location-updates-gps-screen
Jun 22, 2026
Merged

[GPS] Update user location on GPS screen when there is no active GPS trip#91418
neil-marcellini merged 31 commits into
Expensify:mainfrom
software-mansion-labs:@GCyganek/gps/user-location-updates-gps-screen

Conversation

@GCyganek

@GCyganek GCyganek commented May 22, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Requested here

Summary: New GPSMapView that uses Mapbox internal location engine via followUserLocation Camera prop to smoothly follow user location instead of jumping from one spot to another during GPS location updates for the GPS trip.

List of changes:

New GPSMapView component

What: New native-only map component used on the GPS distance screen instead of DistanceMapView.
Why: GPS tracking needs different camera behavior (follow user, permissions, custom puck, route animation) than the manual distance map.
How: Handles foreground location permission, followUserLocation, center/recenter, fallback marker when permission is denied, and wires up waypoints, route, and location puck.

@rnmapbox/maps patch — immediate follow transition

What: Adds opt-in followUserLocationUseImmediateTransition to Mapbox Camera (iOS + Android).
Why: On first follow, Mapbox animates from world view (“fly-in from space”); there is no JS-only fix when followUserLocation is true.
How: Uses makeImmediateViewportTransition() on initial follow (no waypoints); later re-centers use the default animated transition.

GPSDirection + useAnimatedTrailingDirectionCoordinate

What: Smoothly animates the trailing end of the GPS route line as the user moves.
Why: Raw GPS updates make the line jump; animation keeps movement fluid during an active trip.
How: Interpolates the last segment endpoint over GPS_ROUTE_ANIMATION_DURATION_MS (1s) using requestAnimationFrame.

GPSWaypointLayer

What: Renders start/stop/waypoint markers as a Mapbox SymbolLayer instead of MarkerView.
Why: Markers must sit below the native location puck so the puck stays on top.
How: Uses belowLayerID with platform-specific puck layer IDs; remounts on Android when the puck layer becomes available.

Custom location puck (MapCurrentLocationPuck)

What: Custom SVG puck for Mapbox LocationPuck, plus shared blue fill color in CONST.
Why: Default Mapbox puck does not match Expensify design; puck geometry is tuned for Mapbox’s anchor.
How: Registers puck image via Mapbox.Images; hides default UserLocation marker and listens for updates for route animation.

Platform-specific locationPuckLayerId

What: Exports the native puck layer ID per platform (puck on iOS, mapbox-location-indicator-layer on Android).
Why: Layer IDs differ by platform and are required for correct z-ordering.

Extract useAccessToken hook

What: Shared hook for setting the Mapbox access token.
Why: Deduplicates logic between MapView and GPSMapView.
How: MapView now uses the hook instead of an inline useEffect.

GPS screen integration (IOURequestStepDistanceGPS)

What: Swaps DistanceMapView for GPSMapView; removes manual flyTo on each GPS update and the map ref.
Why: Follow mode and animated route line replace imperative camera moves; tracking state is passed via isTrackingGPS.

GPS draft segment handling

What:

  • removeLastSegment: clears the last segment when it is the only one (instead of removing it).
  • stopGpsTrip: removes the last segment when empty/single-point even if it is the only segment.
    Why: Avoids dropping the last segment entirely when stopping a trip with a single segment.

Types & constants

What: GPSMapViewProps, GPSDirectionProps, optional markerType on WayPoint; new WAYPOINTS layer IDs, GPS_ROUTE_ANIMATION_DURATION_MS, MAP_CURRENT_LOCATION_FILL_COLOR.
Why: Supports the new GPS map API and shared styling/animation values.

Map utils

What: areCoordinatesEqual, interpolateCoordinate; isSingleSegmentRoute no longer depends on is2dArray.
Why: Supports route animation and multi-segment GPS coordinates.

ESLint seatbelt

What: Adds GPSMapView.tsx to the seatbelt for react-hooks/set-state-in-effect.
Why: Keeps lint passing for intentional setState-in-effect usage.
isSingleSegmentRoute is fixed as it was returning true for [[]] which is a multi segment empty route

Fixed Issues

$ #85802
PROPOSAL: N/A

Tests

Camera behaviour:

  1. FAB > Track distance > GPS
  2. Verify that the map shows correctly current location marker with pulsing animation and smoothly animates following user location
  3. Move the map using gestures
  4. Verify that it stopped following user location
  5. Tap top-right map button
  6. Verify it animates smoothly to user location and starts following user location again
  7. Tap Start to start the GPS trip
  8. Verify the recorded route smoothly follows user location marker and camera follows user location marker
  9. Move the map
  10. Verify that it stopped following user location marker
  11. Tap top-right map button
  12. Verify it animates smoothly to user location and starts following user location again
  13. Stop GPS trip
  14. Verify it moves the map to show the whole recorded route on the map
  15. Move the map
  16. Tap top-right map button
  17. Verify it smoothly moves to show the whole recorded route on the map again
  18. Move the map and leave Track distance screen
  19. FAB > Track distance > GPS
  20. Verify it shows the whole recorded route on the map
  21. Discard the trip
  22. Verify it transitions smoothly to show the current user location and keeps following the marker

Foreground location permissions not granted yet (granted):
Prerequisites: foreground location permissions not granted, user can ask, precise location is on, last visited Track distance screen is GPS:

  1. FAB > Track distance > GPS
  2. Verify there is an os prompt asking for location permissions
  3. Tap Allow while using app (iOS) or While using the app with Precise location (Android)
  4. Verify it shows location marker that updates smoothly and that has pulsing animation

Foreground location permissions not granted yet (denied):
Prerequisites: foreground location permissions not granted, user can ask, precise location is on, last visited Track distance screen is GPS:

  1. FAB > Track distance > GPS
  2. Verify there is an os prompt asking for location permissions
  3. Tap Don't allow
  4. Verify it shows location marker without pulsing animation based on the last saved location or default location (San Francisco) that is not being updated as we do not have location permissions

Foreground location permissions not granted, GPS trip saved:

  1. FAB > Track distance > GPS
  2. Record a GPS trip
  3. Leave Track distance screen
  4. Change location permissions to Never (iOS) or Don't allow (Android) in app's settings
  5. Go back to the app
  6. Go back to GPS screen
  7. Verify it opens the map with the whole recorded route visible on the map
  8. Move the map
  9. Tap top-right map button
  10. Verify it transitions smoothly to recorded route
  11. Discard the GPS trip
  12. Verify it transitions smoothly to current user location marker that is not being updated because of no location permissions
  • Verify that no errors appear in the JS console

Offline tests

  1. FAB > Track distance > GPS
  2. Verify it shows Map pending screen in offline mode

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 any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Camera behaviour:

Screen.Recording.2026-06-16.at.18.36.09.mov

Offline

Screenshot 2026-06-16 at 18 41 39

Foregrund location permissions:

Screen.Recording.2026-06-16.at.18.38.40.mov
Screen.Recording.2026-06-16.at.18.40.12.mov
Screen.Recording.2026-06-16.at.18.37.58.mov
iOS: Native

Camera behaviour:

Screen.Recording.2026-06-16.at.18.20.18.mov

Offline:

Screenshot 2026-06-16 at 18 21 56

Foreground permissions

Screen.Recording.2026-06-16.at.18.26.41.mov
Screen.Recording.2026-06-16.at.18.27.04.mov
Screen.Recording.2026-06-16.at.18.27.04.mov
Screen.Recording.2026-06-16.at.18.27.42.mov
Screen.Recording.2026-06-16.at.18.28.20.mov

@GCyganek

Copy link
Copy Markdown
Contributor Author

@Expensify/design @JmillsExpensify so I added user's location updates every 5 seconds even if there is no active GPS trip, but in this case I feel like it would be better to not move the map to the updated location every time and staying on the recorded route is better than this IMO:

Screen.Recording.2026-05-22.at.12.50.29.mov

What do you think? And is 5 seconds ok?

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/CONST/index.ts 93.84% <ø> (ø)
...rc/components/Icon/chunks/expensify-icons.chunk.ts 0.00% <ø> (ø)
...rc/components/MapView/Icons/MapCurrentLocation.tsx 0.00% <ø> (ø)
src/components/MapView/MapView.tsx 55.76% <100.00%> (-1.64%) ⬇️
src/components/MapView/useAccessToken.ts 100.00% <100.00%> (ø)
...OURequestStepDistanceGPS/useGPSWaypointMarkers.tsx 0.00% <ø> (ø)
...nents/MapView/locationPuckLayerId/index.android.ts 0.00% <0.00%> (ø)
...omponents/MapView/locationPuckLayerId/index.ios.ts 0.00% <0.00%> (ø)
...rc/components/MapView/locationPuckLayerId/index.ts 0.00% <0.00%> (ø)
src/libs/GPSDraftDetailsUtils.ts 2.38% <0.00%> (ø)
... and 9 more
... and 337 files with indirect coverage changes

@shawnborton

Copy link
Copy Markdown
Contributor

Can you rephrase, I'm not quite following...

Copy link
Copy Markdown
Contributor

Hmm, yes I think I agree with Gabriel. Basically if we move to the updated location it's a bit jarring with the zoom. Then additionally, the blue dot sticks at the last recorded location. Is that what you mean?

@GCyganek

GCyganek commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, what I mean is currently because we do not update current location when GPS tracking is paused/not started the map shows the whole recorded route and user can freely move the map. But now when I added current location updates every 5 seconds when the tracking is not active, the map keeps moving to show latest location on every update, so user can't freely move the map or see the recorded trip without the map flying to latest location after a few seconds as you can see on the video.

IMO it would be better to:

  • when there is a recorded GPS trip, do not move the map on the current location updates to keep the recorded route in view on the map
  • or at least make sure that when user has moved the map or tapped map controls at the top right corner, the map does not move with the current location updates anymore

@shawnborton

Copy link
Copy Markdown
Contributor

Nice, yeah I think that makes sense then and I agree. The first bullet makes the most sense to try first, right?

@GCyganek

Copy link
Copy Markdown
Contributor Author

Nice, yeah I think that makes sense then and I agree. The first bullet makes the most sense to try first, right?

Yep, just wanted to confirm that you want it like this

Copy link
Copy Markdown
Contributor

Nice, I agree as well. Let's try the first one and we can always re-assess later.

@GCyganek

Copy link
Copy Markdown
Contributor Author

I'll push changes in a moment, but now it will work like this:

Screen.Recording.2026-05-25.at.11.16.51.mov

See it follows users location when there is no recorded trip and while recording it, but afterwards it does not follow the user, it just keeps showing the recorded route. When user moves the map and then taps map controls it moves it back to the recorded trip

@shawnborton

Copy link
Copy Markdown
Contributor

I think that looks good? Happy to help test as well.

@GCyganek

Copy link
Copy Markdown
Contributor Author

@codex review

@GCyganek

Copy link
Copy Markdown
Contributor Author

@shawnborton feel free to run build here to test and see if it works good for you

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94488137b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/components/MapView/MapView.tsx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@GCyganek

Copy link
Copy Markdown
Contributor Author

I found a bug in one edge case where it throws an error and I just fixed it, so it shouldn't appear in the next build, sorry for that in case you encounter it

@github-actions

Copy link
Copy Markdown
Contributor

🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@shawnborton

Copy link
Copy Markdown
Contributor

I will test this tomorrow at some point I hope, sorry for the delay!

@GCyganek

Copy link
Copy Markdown
Contributor Author

I will test this tomorrow at some point I hope, sorry for the delay!

No problem!

@shawnborton

Copy link
Copy Markdown
Contributor

This is feeling really good, just tested!

I will say that I don't think there's any perceivable changes related to this:

Verify that the user location marker on the map updates within ~5 seconds to reflect the new position.

For example, it didn't track me going around this circle here, it shortened it quite a bit:
CleanShot 2026-05-26 at 15 04 18@2x

Everything else seems good though!

@GCyganek

GCyganek commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Verify that the user location marker on the map updates within ~5 seconds to reflect the new position.

For example, it didn't track me going around this circle here, it shortened it quite a bit:

The only perceivable change on this PR is that now when the tracking is not active the current location marker is still being updated every 5 seconds. The screenshot you attached has recorded route and there were no changes according to how often we do location updates while recording the GPS trip. As Jason mentioned on related issue, we will probably experiment with location updates frequency once we will work on user's activity updates.

But I can change the frequency of user location updates while not recording a GPS trip if you want something else than 5 seconds

@shawnborton

Copy link
Copy Markdown
Contributor

Ah okay, apologies for the confusion! All good on my end then, looking forward to the route improvements :)

@dukenv0307

Copy link
Copy Markdown
Contributor

on it now

Comment thread src/components/MapView/GPSDirection.tsx Outdated
Comment on lines +19 to +25
if (!lastSegment) {
return directionCoordinates;
}

if (lastSegment.length === 0) {
return directionCoordinates;
}

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.

Suggested change
if (!lastSegment) {
return directionCoordinates;
}
if (lastSegment.length === 0) {
return directionCoordinates;
}
if (!lastSegment?.length) {
return directionCoordinates;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense

Comment thread src/components/MapView/GPSMapView.tsx Outdated

const centerMap = () => {
const waypointCoordinates = waypoints?.map((waypoint) => waypoint.coordinate) ?? [];
if (!isTrackingGPS && (waypointCoordinates.length > 1 || (directionCoordinates ?? []).length > 1)) {

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.

Suggested change
if (!isTrackingGPS && (waypointCoordinates.length > 1 || (directionCoordinates ?? []).length > 1)) {
if (!isTrackingGPS && (waypointCoordinates.length > 1 || directionCoordinates?.length > 1)) {

@dukenv0307

Copy link
Copy Markdown
Contributor
  1. Start tracking
  2. go back
  3. Click GPS tracking is progress... button
  4. Observe that the route isn't shown
Screen.Recording.2026-06-18.at.12.16.25.AM.mov

@GCyganek

Copy link
Copy Markdown
Contributor Author

@dukenv0307 should be fixed now, layering is very tricky with this LocationPuck component because its layer is not ready to be used as belowLayerID prop immediately, so I need to defer it for GPSWaypointLayer and GPSDirections:

Screen.Recording.2026-06-18.at.09.54.45.mov

I also added additional foreground location permissions check in useAppFocusEvent when user backgrounds the app and then foregrounds it again (in case they change location permissions in the meantime):

Untitled.mov

@dukenv0307

This comment was marked as resolved.

@dukenv0307

dukenv0307 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-06-18.at.10.08.13.PM.mov
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-06-18.at.9.23.04.PM.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari

Copy link
Copy Markdown
Contributor

Looks like we're back to Neil for final review.

@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.

Here is a very small review from Friday. I'll review more today.

Comment thread src/components/MapView/GPSMapView.tsx

@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.

The code looks good. Great work! I have a few non blocking items that could be improved in a quick follow up.

Comment thread src/components/MapView/GPSMapView.tsx
Comment thread src/components/MapView/useAnimatedTrailingDirectionCoordinate.ts
Comment thread src/components/MapView/utils.ts
- iOS — `ios/RNMBX/RNMBXCamera.swift`, `ios/RNMBX/RNMBXCameraComponentView.mm`, `ios/RNMBX/RNMBXCameraViewManager.m`
- Android — `android/src/main/java/com/rnmapbox/rnmbx/components/camera/RNMBXCamera.kt` and `RNMBXCameraManager.kt`

- Upstream PR/issue: 🛑

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: Why no upstream PR or issue?

@neil-marcellini neil-marcellini merged commit a43fa3f into Expensify:main Jun 22, 2026
50 of 51 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.17-0 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 I reviewed the changes in this PR against the help-site files under docs/articles, and no help-site documentation changes are required.

Why: This PR is an internal/native rendering and UX improvement to the GPS distance map — it does not change any documented user-facing workflow.

What the PR changes vs. what the docs cover

The PR's user-visible effects are all about how the map behaves, not what the user does:

  • New GPSMapView with smooth followUserLocation camera (no more jumpy fly-in)
  • Custom location puck (MapCurrentLocationPuck) with pulsing animation
  • Animated trailing route line as the user moves
  • Recenter ("top-right map button") behavior and foreground-permission fallback marker
  • A draft-segment edge-case fix in removeLastSegment / stopGpsTrip

The existing GPS documentation only describes the steps and outcomes, which are unchanged:

  • Distance-Expenses.mdHow to create a GPS Distance expense: Create → Track distance → GPS → Start → Stop → (Resume) → Save → Create expense; background tracking; iOS/Android only; receipt appearance.
  • Create-an-Expense.md — the same GPS step list.

None of these steps, platform notes, permission descriptions, or receipt descriptions change as a result of this PR. The map's camera/puck/animation behavior and the recenter button are not (and have not been) documented at that level of detail, so there's nothing to update or correct.

Since no changes are required, I did not create a draft help-site PR.

@GCyganek, please confirm you agree no help-site updates are needed. If you'd like a doc to call out the new map/recenter behavior, reply with @MelvinBot and I'll draft one.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀

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

@unzig21

unzig21 commented Jun 24, 2026

Copy link
Copy Markdown

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

@neil-marcellini

Copy link
Copy Markdown
Contributor

Noting that my NAB comments were resolved here. Thanks.

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

Labels

Hot Pick Ready for an engineer to pick up and run with

Projects

None yet

Development

Successfully merging this pull request may close these issues.