Merge FB-06: always-interactive map with recenter control
# Conflicts: # docs/feedback/FB-06-always-interactive-map-recenter.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# FB-06 — Map is always pannable and zoomable, with a recenter control
|
||||
|
||||
**Depends on** — · **Size** M · **Status** Not started
|
||||
**Depends on** — · **Size** M · **Status** Done
|
||||
|
||||
## Goal
|
||||
The rider must be able to pan and zoom the map at all times. Today the map locks all
|
||||
@@ -151,3 +151,49 @@ Outcome section and make no code change for it.
|
||||
Any change to the Route Planner's own map (FB-07 covers its remaining issue). Any
|
||||
change to `PulsingLocationMarker`'s own animation code, unless the on-device check in
|
||||
this ticket finds it is genuinely not visible in one of the two states.
|
||||
|
||||
## Outcome
|
||||
Implemented the Design section exactly, in `lib/src/ui/components/ride_map.dart`:
|
||||
|
||||
- Removed the `hasPoints` gate on `interactionOptions`. The map now always uses
|
||||
`const InteractionOptions(flags: InteractiveFlag.pinchZoom | InteractiveFlag.drag)`,
|
||||
idle or recording.
|
||||
- Added a recenter button (`key: const Key('recenter-button')`), shown only when
|
||||
`widget.follow && !_following` — i.e. exactly when the rider has panned away from an
|
||||
actively-followed camera. It is a `GlassPanel` (borderRadius 999, matching the
|
||||
existing `FloatingPill`/`_OverflowMenu` circular-chrome pattern already used in
|
||||
`route_planner_screen.dart`) wrapping an `IconButton` with `Icons.my_location`,
|
||||
positioned bottom-right of the map (`Positioned(right: 16, bottom: 16, ...)` inside a
|
||||
`Stack` that now wraps the map).
|
||||
- Wired `onPressed` to a new `_recenter()` method: sets `_following = true`, then moves
|
||||
the camera to `widget.points.last` if points are non-empty, else
|
||||
`widget.ambientPosition` if non-null, else does nothing. Zoom is left untouched
|
||||
(`_controller.camera.zoom` is passed straight through to `_controller.move`), per the
|
||||
design's explicit "keep the current zoom level" requirement.
|
||||
- Made no changes to `PulsingLocationMarker` — see the marker verification note below.
|
||||
|
||||
No deviation from the design.
|
||||
|
||||
**Tests.** Added 7 new widget tests to `test/ride_map_test.dart` under a new
|
||||
`'always-interactive map + recenter (FB-06)'` group, covering: pan/zoom flags present
|
||||
with no points (idle) and with points (recording); no recenter button before any
|
||||
manual pan; no recenter button when `follow` is false even after a pan; a manual pan
|
||||
while following shows the button; tapping it recenters to the ambient position and
|
||||
hides the button again; tapping it recenters to the latest recorded point while
|
||||
recording. `flutter analyze` is clean (only the 4 pre-existing, unrelated infos in
|
||||
`crash_reporter.dart`/`map_connectivity.dart` — nothing new). `flutter test` is green:
|
||||
confirmed via both the default reporter and `--reporter json` (cross-checked test names
|
||||
directly) that the suite went from the 412-test baseline to exactly 419 real tests
|
||||
(412 + 7 new), all passing, none skipped or removed.
|
||||
|
||||
**On-device marker verification: skipped.** This environment has no Android
|
||||
tooling available — `adb` is not on `PATH`, there is no `ANDROID_HOME`/SDK, and
|
||||
`flutter devices` lists only `macOS (desktop)` and `Chrome (web)`, no emulator. Per the
|
||||
ticket's own risk-mitigation instructions (do not fight an unavailable/unstable
|
||||
emulator at length), the marker-pulse check was not attempted rather than spending
|
||||
time on a device that isn't reachable from this sandbox. `PulsingLocationMarker` was
|
||||
not modified — per the ticket, a code change there is only warranted if the on-device
|
||||
check finds the pulse genuinely missing, and that check could not be run. The relevant
|
||||
acceptance-criteria checkbox ("location marker's pulse animation is confirmed visible
|
||||
on-device...") is therefore left unchecked/unresolved and should be picked up in a
|
||||
follow-up pass that has emulator access.
|
||||
|
||||
Reference in New Issue
Block a user