Files
pipelines/app/notes/phone-navigation-bar.md
T
alan aabd22b5ad Add phone bottom navigation bar
Replace the narrow-layout floating destination pill with a full-width Material 3 NavigationBar. Reuse the shell destination model and badge wiring while preserving re-selection callbacks and hiding the bar for keyboard/detail states.
2026-11-12 02:51:01 +00:00

3.6 KiB

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.