Merge FB-02: hide idle Speed panel

# Conflicts:
#	docs/feedback/FB-02-hide-idle-speed-panel.md
This commit is contained in:
2026-08-24 16:01:45 -05:00
3 changed files with 132 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
# FB-02 — Hide the idle Speed panel until recording starts
**Depends on** — · **Size** S · **Status** Not started
**Depends on** — · **Size** S · **Status** Done
## Goal
The Record screen's idle (not-recording) state currently shows a live "SPEED" readout
@@ -191,3 +191,53 @@ content, it does not touch how the recording-state HUD widgets are laid out or s
The live-map-while-idle behavior itself (FB-01) — this ticket assumes it lands
separately; if FB-01 hasn't merged yet, the idle screen will just show today's
`(0,0)`/zoom-2 map, which is still a strict improvement over a blocking Speed panel.
## Outcome
Implemented exactly as designed. `record_screen.dart`'s idle `Center(child: GlassPanel(...))`
block (Speed/Status/Last ride) is gone; `HudEditOverlay` is now gated on `!ui.isIdle` and is
the Stack's only HUD-content branch. The dead `final (speedValue, speedUnit) = ...` line was
deleted; `BigStat`/`StatRow` are no longer referenced in the file (the `stats.dart` import
stays, since `confirmDialog` from the same file is still used for the discard dialog).
All five named tests were migrated per the ticket's Tests section:
- `'idle shows Ready and only START'` → renamed to `'idle shows only START'`, the `Ready`
assertion removed, START/PAUSE/STOP and `find.text('Distance')` checks kept.
- `'the headline is live speed, not max speed'` → now seeds a recording trip and asserts
against the HUD, same SPEED/MAX SPEED expectations.
- `'text is legible against the dark ground'` → now seeds a recording trip and descends into
`find.byKey(const ValueKey(HudMetric.speed))` instead of `Key('speed')`.
- The two mounted-mode tests (V3-05 scale/contrast, and UI-05 GlassPanel contrast) were
migrated to seed a recording trip and use `ValueKey(HudMetric.speed)`. The V3-05 test's
unrelated `Key('start')` height check was swapped for `Key('pause')`, since a recording
state has no START button. The GlassPanel-lookup test switched from
`find.byType(GlassPanel).first` (an ancestor of `Key('speed')` in the old layout) to
`find.descendant(of: find.byKey(const ValueKey(HudMetric.speed)), matching:
find.byType(GlassPanel))`, since in the new HUD tree the per-metric `GlassPanel` is a
*descendant* of the keyed widget (`DraggableResizableHudWidget`), not an ancestor.
- `'HUD widgets render over the map, not replacing it (UI-05)'` needed no change and still
passes.
**The risk the ticket flagged was real, in two parts, both now fixed:**
1. `_HudMetricValue` had no `scale` parameter at all — its label/value `fontSize`s were
hardcoded (10/18), so the old `BigStat`-based mounted-mode text-scale assertion
(`64 * mountedTextScale`) had no equivalent to migrate to. Added a `scale` field to
`_HudMetricValue`, threaded from `record_screen.dart`'s existing `mountedMode` local the
same way `BigStat` was driven (`mountedMode ? mountedTextScale : 1.0`), and multiplied
both font sizes by it. The migrated test now asserts `18 * mountedTextScale`.
2. Once (1) was fixed, the *second* mounted-mode test (GlassPanel contrast, UI-05) still
failed: `_HudMetricValue._valueColor`'s per-metric accent colours (`colors.primary` for
Speed, tuned for the dark HUD mockup) measure 4.43:1 against the mounted theme's
`GlassPanel` surface — just under the 4.5:1 AA threshold the test enforces. This is a
real, separate, pre-existing gap this migration exposed: `_HudMetricValue` never
accounted for mounted mode's own colour scheme in `_valueColor` at all (unlike `BigStat`,
which always named its headline colour explicitly as `colors.onSurface` rather than
trusting an accent). Fixed minimally by adding a `mountedMode` bool to `_HudMetricValue`
that, when true, forces `_valueColor` to `colors.onSurface` for every metric — reusing
`BigStat`'s own explicit-ink fallback — while leaving the dark-theme mockup's per-metric
accent colours (Speed: primary, Distance: secondary) untouched for the normal (non-mounted)
case. This is a colour-only override scoped to mounted mode; no other `_HudMetricValue`
behavior changed.
`flutter analyze`: clean (same 4 pre-existing `info`-level issues as baseline, none new).
`flutter test`: 374 passing (unchanged from baseline — no tests were added or removed, five
were migrated in place per the ticket).