Skip to content

feat(mobile): GPS playback dev tool#81

Draft
cafca wants to merge 19 commits into
mainfrom
claude/crazy-benz-3ed736
Draft

feat(mobile): GPS playback dev tool#81
cafca wants to merge 19 commits into
mainfrom
claude/crazy-benz-3ed736

Conversation

@cafca
Copy link
Copy Markdown
Owner

@cafca cafca commented May 7, 2026

Summary

In-app GPS playback drawer for testing nav/TTS/reroute on real devices without riding. Replaces the location stream with a synthetic source the operator drives along the planned route.

  • 5-tap version row in Settings unlocks Developer mode (Android-style); Playback drawer switch enables.
  • Drawer: play/pause, restart, ±10 m step, speed cycle (0.5/1/2/5/10x), progress slider.
  • Synthetic red puck overlays the map; camera-follow tracks it via animateCamera.
  • Native myLocationEnabled disabled in playback mode so MapLibre's CL puck doesn't compete.
  • Works in release builds — no build-mode gating.

Architecture: mobile/lib/dev/{polyline_walker,playback_engine,playback_state,playback_controller,dev_mode,switchable_location_source}.dart + widgets/{playback_drawer,synthetic_puck_overlay}.dart. SwitchableLocationSource swaps real GPS ↔ engine stream when toggle flips.

Spec: docs/superpowers/specs/2026-04-25-gps-playback-tool-design.md. Plan: docs/superpowers/plans/2026-04-25-gps-playback-tool.md.

Test plan

  • flutter analyze clean (very_good_analysis preset)
  • flutter test 221/221 pass
  • Sim: unlock dev mode → enable drawer → plan route → play → puck advances, slider tracks, banner counts down, voice cues fire
  • Sim: speed cycle visible, step buttons jump 10 m, restart returns to 0
  • Sim: lock dev mode → drawer/section disappear, location source reverts to Geolocator
  • Release-on-device: same flow against prod backend

cafca added 19 commits April 25, 2026 10:32
Timer-driven 4 Hz engine with play/pause/seek/override and a broadcast
UserLocation stream; freezed PlaybackState holds all simulation fields.
preview.time is milliseconds (matches home_eta_provider, route_sheet usage).
Treating it as seconds made baseSpeed 1000x too small — at 10x multiplier,
slider advanced ~1m in 30s on a 2.5km route.
Add SyntheticPuckOverlay (blue 22px circle) that projects the playback
controller's current latlng to screen coordinates, and a ref.listen on
PlaybackState that animates the camera to the synthetic position on each
tick when in following mode. Gate myLocationEnabled and trackingCompass
calls by playback state so the native GPS puck is hidden during playback.
# Conflicts:
#	mobile/lib/providers/navigation_provider.dart
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