Merge FB-08: reflow HUD row widgets on hide/show

# Conflicts:
#	docs/feedback/FB-08-hud-reflow-on-hide.md
This commit is contained in:
2026-08-25 00:13:10 -05:00
3 changed files with 118 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
# FB-08 — HUD widgets reflow to fill the gap when one is hidden
**Depends on** — · **Size** M · **Status** Not started
**Depends on** — · **Size** M · **Status** Done
## Goal
Hiding a HUD metric must resize the remaining widgets in its row to fill the empty
@@ -136,3 +136,22 @@ metric starts at, only how a row's members redistribute space among themselves w
one of them is hidden or shown. Sequence FB-09 after this ticket merges, since both
touch `HudLayoutController`/`HudWidgetLayout` and a large simultaneous diff in both is
harder to review and merge than one after the other.
## Outcome
Implemented `_reflowRow` in `lib/src/hud/hud_layout_controller.dart` exactly as
specified in the Design section, and wired it into `setVisible` using the toggled
metric's `current.row` (its row before the toggle when hiding, its row after
`defaultFor`/`nextFreeSlot` placement when showing) — no deviation from the design.
Added four tests to `test/hud_layout_controller_test.dart` covering the four
acceptance-criteria scenarios: hiding one of four same-row metrics reflows the
remaining three to fill the row with no gap; hiding a metric alone in its row leaves
every other metric's `col`/`row`/`colSpan` untouched; showing a previously-hidden
metric into a row with an existing member reflows that row so their `colSpan`s sum to
`hudGridColumns`; and toggling a metric in one row leaves a different row's members'
`col`/`colSpan` unchanged.
`flutter analyze` stayed clean (only pre-existing, unrelated info-level lint notices in
`lib/src/crash/crash_reporter.dart` and `lib/src/tiles/map_connectivity.dart`, neither
touched by this ticket). `flutter test` is green with a final count of **416 tests**
(412 baseline + 4 new), no regressions.