Skip to content
This repository was archived by the owner on Jun 24, 2026. It is now read-only.

Show current segment in Route ID - #625

Open
Anay704 wants to merge 1 commit into
commaai:masterfrom
Anay704:route-id-current-segment
Open

Anay704 wants to merge 1 commit into
commaai:masterfrom
Anay704:route-id-current-segment

Conversation

@Anay704

@Anay704 Anay704 commented Jun 4, 2026

Copy link
Copy Markdown

Fixes #499

The Route ID in the Route Info panel now shows the current segment number, derived from the timeline/playback position, and live-updates as you scrub. Copying the Route ID copies the segment-qualified id as displayed.

Approach

  • Added a pure getRouteSegment(seekTime, maxSegment) helper (src/utils/format.ts) that maps a playback time (seconds) to its segment number (60s segments), clamped to the route's last segment via maxqlog. Unit-tested.
  • Passed seekTime from RouteActivity into RouteActions and derive the segment reactively, so the displayed/copied id updates as the timeline moves.

Notes

  • Display format is dongleId/dateStr/segment, matching the existing /-separated Route ID and UploadQueue's route/segment. Happy to switch to the canonical --N suffix if preferred — one-line change.
  • The useradmin onebox link intentionally still uses the base route id.

Testing

  • getRouteSegment unit tests, tsc, biome check, and the line/bundle gates all pass.
  • Verified manually in demo mode on route /1d3dc3e03047b0c7/000000dd--455f14369d: at playback 3:20 the Route ID reads …455f14369d/3, updating live while scrubbing.

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

Changes:

path lines diff
./utils/format.spec.ts 78 +16
./utils/format.ts 91 +8
./components/RouteActions.tsx 129 +6
./App.browser.test.tsx 41 +1

Total lines: 4769 (+31)

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

deployed preview: https://625.connect-d5y.pages.dev

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

Mobile

Desktop

@Anay704
Anay704 force-pushed the route-id-current-segment branch from ccfe04a to 7ac8a4d Compare June 4, 2026 23:49
The Route ID now includes the current segment number derived from the
timeline/playback position and live-updates as you scrub. Copying the
Route ID copies the segment-qualified id as shown.

Add a pure getRouteSegment(seekTime, maxSegment) helper that maps a
playback time to its segment number, clamped to the route's last
segment (maxqlog), with unit tests.

Fixes commaai#499
@Anay704
Anay704 force-pushed the route-id-current-segment branch from 7ac8a4d to 77ac59e Compare June 4, 2026 23:58
@Anay704

Anay704 commented Jun 5, 2026

Copy link
Copy Markdown
Author

Heads up on CI: the only failing check is geocode.spec.ts > getFullAddress > normal usage, which asserts a hardcoded street address against a live geocoding API ("133 Fleet Street" — the data now returns "131"). It fails on master too and is unrelated to this change; everything this PR touches passes. Happy to open a separate PR to mock that call if that'd be useful.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show current segment id in Route ID

1 participant