92b3f47d92
Keep pushed run detail and placeholder views consistent with the phone navigation behavior by hiding the shell bar. Add regression coverage and preserve the floating-bar motion test at its intended breakpoint.
95 lines
5.5 KiB
Markdown
95 lines
5.5 KiB
Markdown
# Phone bottom navigation bar
|
||
|
||
Replaces the floating round destination pill on phone-width windows (narrower
|
||
than the 600 px list-detail split) with a full-width Material 3 `NavigationBar`:
|
||
Pipelines, Runs, Chat, Search, Settings, each with icon, label and the rail's
|
||
badges. Wider windows keep the floating bar (the list beside an open item needs
|
||
it) and the rail keeps its existing layout.
|
||
|
||
## Changed paths
|
||
- `app/lib/shell/shell_navigation_bar.dart` (new): `ShellNavigationBar`, the
|
||
phone bar. Reuses `destinationDetails`, `shellTabDestinations` and the shell's
|
||
badge icon builder. Settings is its fifth destination. Wrapped in `SafeArea`
|
||
(bottom only). Returns nothing while the keyboard is open
|
||
(`viewInsets.bottom > 0`).
|
||
- `app/lib/shell/adaptive_shell.dart`: phone path uses the new bar; the floating
|
||
bar stays for wider non-rail windows; `hideNavigation` specs still hide the bar.
|
||
Pushed detail routes already cover the shell, so the bar stays hidden there.
|
||
- Tests: `test/shell/shell_navigation_bar_test.dart` (new, 7 cases),
|
||
`test/shell/shell_bar_test.dart`, `test/shell/floating_tab_bar_test.dart`,
|
||
`test/shell/attention_badge_test.dart`, `test/shell/navigation_rail_test.dart`,
|
||
`test/shell/split_destination_bar_test.dart`,
|
||
`test/application/settings_page_test.dart`, `test/widget_test.dart`,
|
||
`test/perf/background_work_bench_test.dart` (counts `ShellNavigationBar`
|
||
rebuilds now, since the pill is no longer built on phones).
|
||
|
||
## Behaviour decisions
|
||
- Re-tap: `ShellNavigationBar` calls `onSelected` on every tap, including the
|
||
shown destination, so `AdaptiveShell._select` (and its `onDestinationSelected`
|
||
callback) fires on re-tap. Run 404's hook is not in this branch; nothing to
|
||
rename.
|
||
- Settings selected: the bar marks Settings (index 4) while the Settings page is
|
||
open. The Pipelines gear stays in the Pipelines toolbar.
|
||
- Keyboard: the bar leaves whenever the keyboard is open on a phone, not only in
|
||
chat. Chat on phone already hides it through its workspace `hideNavigation`.
|
||
|
||
## Focused results
|
||
Command: `tool/memwatch/full.sh` with one quoted path list (new shell test, the
|
||
shell and application users of the bar, `widget_test`, two features/chat files,
|
||
perf bench). The verdict line named only those paths.
|
||
- Final run: 129 passed, 2 failed. Both failures are
|
||
`test/application/search_wiring_test.dart` ("field and artifact hits select
|
||
their run detail selection", "an abandoned selection does not replay on run
|
||
reopen"). They also fail on an untouched base worktree (HEAD 9bb87e51, detached
|
||
temporary worktree, removed afterwards), with the same `ok` EditableText
|
||
assertion. They are pre-existing and unrelated to the bar.
|
||
- New file alone: `shell_navigation_bar_test.dart` 7/7 passed.
|
||
- `tool/analyze.sh`: clean (0 errors, 0 warnings, 0 infos) after the final edits.
|
||
|
||
## Affected UI states (not captured here)
|
||
- Phone (390 px) bar, each of Pipelines, Runs, Chat, Search, Settings selected:
|
||
covered by widget tests for selection, not rendered.
|
||
- Badges: running count on Runs, unread on Chat (widget tests).
|
||
- Keyboard open: bar absent (widget test).
|
||
- Pushed detail route: bar absent (existing test, `shell_bar_test.dart`).
|
||
- Chat workspace: bar absent (existing `hideNavigation`).
|
||
- Light and dark captures: NOT produced. Capture belongs to ui-review.
|
||
|
||
## Limitations
|
||
- No device or browser verification of the bar. Its metrics (80 dp `NavigationBar`
|
||
height, SafeArea) and the gesture-inset clearance are verified only in widget
|
||
tests with the padding faked.
|
||
- Settings-as-destination on the phone bar is new behaviour; the Pipelines gear
|
||
is still present.
|
||
- Medium widths (600 px to the rail threshold) keep the floating pill, by design.
|
||
|
||
## Land-gate fix (visit 2)
|
||
- Failure: `test/ui/adaptive/floating_tab_motion_test.dart` ("switching the shell
|
||
tabs never replays the main bar's entrance") ran the shell at 560 px, which is a
|
||
phone now and shows the `NavigationBar`, so no `GlassPill` existed (`StateError:
|
||
No element`).
|
||
- Fix (test only): that one test now sets a 640 px window, above the 600 px split
|
||
and below the rail threshold, so it still exercises the floating bar it covers.
|
||
No expectation changed; the other six tests in the file are untouched.
|
||
- Focused result: `tool/memwatch/full.sh 'test/ui/adaptive/floating_tab_motion_test.dart'`
|
||
→ PASS 7 passed, 0 failed (verdict named only that path).
|
||
- `tool/analyze.sh`: clean.
|
||
- The full gate suite was not re-run here (the land stage runs it).
|
||
|
||
## Review fix (implement visit 3): run detail hides the phone bar
|
||
- Failure: on a phone, a run detail (loaded, and the loading/failed placeholder)
|
||
still showed the `NavigationBar`, because both `ShellBar`s in
|
||
`lib/features/runs/ui/run_detail_view.dart` lacked `hideNavigation`.
|
||
- Fix: `hideNavigation: true` on the detail `ShellBar` and on the placeholder
|
||
`ShellBar`. Nothing else changed.
|
||
- Regression test: new `test/features/runs/ui/run_detail_phone_navigation_test.dart`
|
||
mounts `RunDetailView` in `AdaptiveShell` at 390×844. It asserts no
|
||
`NavigationBar` for the loaded detail and for the placeholder, and keeps a
|
||
control that the runs list still shows the bar.
|
||
- Negative check: with the two `hideNavigation` lines removed, the two detail
|
||
tests fail and the control passes; the fix was then restored.
|
||
- Focused result: `tool/memwatch/full.sh 'test/features/runs/ui/run_detail_phone_navigation_test.dart test/features/runs/ui/run_detail_widget_test.dart'`
|
||
→ PASS 5 passed, 0 failed (verdict named only those two paths).
|
||
- `tool/analyze.sh`: clean.
|
||
- Not captured here (ui-review owns captures).
|