Skip to content

feat: ride analysis phase 2 - embedded map with markers and animated replay#154

Merged
drzeeb merged 5 commits into
mainfrom
feat/ride-analysis-phase2
Jun 29, 2026
Merged

feat: ride analysis phase 2 - embedded map with markers and animated replay#154
drzeeb merged 5 commits into
mainfrom
feat/ride-analysis-phase2

Conversation

@drzeeb

@drzeeb drzeeb commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Phase 2 of the detailed ride analysis screen: a hero interactive map with an animated replay.

What's new

  • Embedded ride map at the top of the analysis screen, showing the ride's track on a green to red speed ramp (reusing RideSpeedSegments).
  • Markers dropped along the track: start (green), finish (red), top-speed (amber, via RideMaxSpeedPoint), stops (grey, at the midpoint of each standstill) and numbered kilometre markers.
  • Animated replay - a play button and a scrub slider drive a dot that retraces the ride. Frames are sampled by elapsed time, so the dot naturally slows and pauses where you stopped.

Implementation

  • New pure, off-main-thread builder buildRideMapData in core.analysis (track, markers, time-spaced replay frames). No Android dependency, fully unit-tested.
  • New RideReplayMap composable with self-contained MapLibre sources/layers (data-driven marker colour/size, a replay-dot circle layer), reusing the existing rememberMapViewWithLifecycle and updateTrackSpeedLayer/updateTrackLayer helpers.
  • Map data added to RideAnalysisUiState.Ready and computed in the ViewModel off the main thread; isDarkTheme threaded through the NavHost into the screen.
  • Only one MapLibre map is live at a time: navigating here disposes the main map's MapView (recreated on return), so the embedded map is cheap.

Tests

  • RideMapDataTest: start/finish markers, km markers, replay frame count and endpoints, stop-marker detection. All green.

i18n

  • New strings (map title, play/restart) localised across all eight supported languages.
    Next (optional phases): history comparison + PR badges, a shareable report card, and opt-in online data (weather / map-matching).

VeloSpot Dev added 5 commits June 29, 2026 23:51
…replay

Adds an embedded MapLibre map to the ride analysis screen: speed-coloured track, start/finish/top-speed/stop/kilometre markers and a play/scrub-driven animated replay dot (time-based, so it pauses at standstills). Geometry built purely off-main-thread in core.analysis (buildRideMapData, RideMapDataTest); rendered by a new RideReplayMap composable reusing RideSpeedSegments and RideMaxSpeedPoint. Localised in 8 languages.
…t avatar

Fixes the embedded analysis map being unresponsive inside the vertical scroll: a touch listener now asks the Compose parent to stop intercepting the gesture (requestDisallowInterceptTouchEvent) on touch-down, so pan/zoom work. Replaces the blue replay dot with the app's cyclist avatar, cycling pedal frames by distance (foot-down idle pose at stops) and rotating to the travel heading.
…ch bubble

Removes the cluttered per-kilometre dots from the analysis map and renders the top-speed marker as the same red speech-bubble pin used on the main map (createSpeedBubbleIcon + updateMaxSpeedMarker). Updates RideMapDataTest accordingly.
Drops the cluttered per-kilometre map dots and adds meaningful value bubbles instead: top speed (km/h), steepest gradient (%), high point (elevation) and longer stops (duration) — each a clean speech bubble like the main map's max-speed pin, tinted per type, with full alpha so they render. Start/finish stay as simple dots. The kilometre-split list on the analysis screen now collapses behind a 'show all (n)' toggle past eight rows. Updates RideMapDataTest.
…graphs

Adds createAnalysisBubbleIcon: a value bubble with a dark outline (crisp on the light basemap, the white keyline was invisible) and a leading white pictograph per type — speed gauge, ramp (gradient), mountain (high point) and pause bars (stop) — so a bare '128 m' clearly reads as a summit. RideReplayMap maps each value marker to its glyph.
@drzeeb drzeeb enabled auto-merge (squash) June 29, 2026 22:42
@drzeeb drzeeb merged commit 13fe0fb into main Jun 29, 2026
5 checks passed
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.

1 participant