# Chrome gaps after the segmented-bar waves Follow-up to `notes/segmented-bar.md`, `notes/floating-tab-bars.md`, `notes/app-chrome-fixes.md`, `notes/pages-fixes.md` and `notes/chat-chrome-fixes.md`: the gaps those batches left. List rows, the chat thread/composer and the viewers (artifact viewer, diff/changes viewer, graph canvases, image viewer) were out of scope and are untouched. ## Shared pieces - `SegmentedBar.titleWidget` / `titleWidgetMaxWidth` (`lib/ui/adaptive/segmented_bar.dart`). The bar's main pill is a widget (a search field and its filters) in place of the title pill. It fills the row beside the leading piece and any actions, up to the cap, and starts at the leading edge. `title` is not drawn. A `backgroundColor` given as a `CupertinoDynamicColor` is now resolved against the context, so the scrim follows light/dark. - `ShellBarSpec`/`ShellBar` (`lib/shell/shell_bar.dart`) carry `titleWidget`, `titleWidgetMaxWidth` and `backgroundColor`, and the shell passes them to its bar. When a screen publishes a `titleWidget`, the shell drops its own Search action. - `TopGlassStrip` (`lib/ui/adaptive/top_glass_strip.dart`): a page's own controls as one frosted rounded piece under the top bar. It is placed with `FloatingBarOverlay(edge: FloatingBarEdge.top)`, so the content's top padding grows by the strip's height and the content scrolls behind it. It starts at the bar's 12px inset and is as wide as its content (up to `maxWidth`). Taps beside it pass through. ## 1. Templates - `templates_destination.dart`, `templates_frame.dart` (standalone) and `screen.dart` dropped the top `SafeArea` that a merge had brought back. Instead: - the page body is `SafeArea(top: false, bottom: false)`; - the connection gate is `BelowTopBar`; - the connection banner and the refused-refresh banner use `TopBarNotices`. - The gallery's `ListView`s use the default media padding, and the detail uses `withBarClearance`. Both start below the bar and scroll behind it. - There is still one bar: Back (`templates-page-back` / `template-detail-back`) and Refresh in the actions pill. - On Cupertino the page (and so the bar's scrim) is `AppColors.groupedBackground`, under the existing inset-grouped section. That gives inset-grouped rows on the grouped background, as in Settings, instead of white rows in a grey band on a white page. ## 2. Search field fills the bar - `SearchScreen` publishes `SearchBarControls` as the bar's `titleWidget` in both cases: as the shell tab through `ShellBar`, and standalone through its own `SegmentedBar`. There is no Search title pill and no actions pill. - The field is `Expanded` inside the pill, with Kind and the info button at its trailing end. - `kSearchPillMaxWidth` is now `kSearchContentMaxWidth` (840). The pill starts at x=12 and the result column at the same 12 inset with the same cap, so on a wide window the field and the results share both edges. On a phone the pill spans the bar. ## 3. Settings on Cupertino in the shell Embedded Settings under the shell publishes `ShellBar(backgroundColor: settingsCupertinoBackground)`. The shell's bar scrim (the opaque status inset and its fade) is then the grouped background, the same as the page's `ColoredBox` from the top edge down. This removes the white band and the seam under the bar. Material is unchanged. ## 4. Run detail header The slim header (status kicker, run actions, decision banner, refreshing/error notices) is now a `TopGlassStrip` floating just under the bar (key `run-detail-header`; the inner scroll keeps `run-detail-header-`). - Every tab fills the whole detail from the top edge and scrolls behind both the bar and the strip. Tab bodies already padded by the media top (`SliverTopBarClearance` / `withBarClearance`), so they clear the strip at rest. - The strip is content-width, or full width when the decision banner is shown. Its internal paddings went from 16 to 12. - The 40%/240px header limit still applies: the strip scrolls internally past it. - Pane-top tabs on a wide split now float below the strip. The two overlays nest. - The Graph canvas is `BelowTopBar`, and Changes stays `BelowTopBar`: both are viewers with fixed headers or controls. ## 5. Stage (visit) page `run_detail_visit*.dart`: - **Bar.** The page bar's title is the stage (key `run-visit-title`) and its subtitle is `Visit N · Run X · ` (`runVisitSubtitle`). The pane's own stage heading and `Visit N` / `Run X` line are gone, so nothing is duplicated. - **Body.** The body is `SafeArea(top: false, bottom: false)`, and the sections fill the page under the floating tabs (`FloatingBarOverlay`, keys `run-visit-tabs`, `run-visit-tab-` unchanged). - **Facts.** The facts, verdict and diagnostic (`run_detail_visit_facts_view.dart`, `RunVisitFactsView`) lead the Summary's scroll after a `SliverTopBarClearance`. They scroll behind the bar, and the Input/Output sticky headers pin under it. The fixed 40% facts block is gone. - **Other sections.** - Session (Material) and Definition (missing) pad with `withBarClearance`. - Cupertino Session and the field tabs already used the media padding. - Artifacts uses the gallery's `SliverTopBarClearance`. - Changes (a viewer) is `BelowTopBar`. ## 6. Schedules The search/filter/count toolbar is now a `TopGlassStrip` (key `schedule-toolbar`, at most 720 wide) floating under the bar, set inside `SchedulesListView`. - The list (`schedule-list`, still a `ListView`) pads its first row by `withBarClearance`. - The loading, empty and failure states are `BelowTopBar`. - The failed-refresh banner uses `TopBarNotices`, so the list keeps its ancestors and its scroll offset. - The strip keeps its place in every state, so a query that empties the list keeps the field's focus. The destination dropped its top `SafeArea`. ## Tests New: - `test/ui/adaptive/segmented_bar_title_widget_test.dart` (both hosts): - no title pill; - the pill fills a 390 bar at 12/378, and stops at its cap beside a Back with actions trailing at 1200; - a shell tab publishing a field gets it in place of the title, with no `shell.search`. - `test/features/search/search_bar_layout_test.dart`, new cases at 390 and 1200: the field's pill is the bar's only piece, starts at 12 and is `min(width − 24, 840)` wide, and the result row shares its left and right edges. - `test/application/templates_behind_bar_test.dart` (real app, both hosts): - the gallery reaches y=0, its first row is below the bar, and dragging moves it up; - Cupertino has the grouped scaffold background and the inset section; - the detail reaches y=0 with Create below the bar; - Refresh is in the one bar. - `test/features/settings/settings_shell_background_test.dart`: in the Cupertino shell the bar's scrim and the page are both the grouped background from y=0, with the groups below the bar. Material keeps the scaffold colour. - `test/features/runs/ui/run_detail_behind_bar_test.dart` (both hosts): - the header strip sits just under the bar at x=12, the tab body starts at y=0 with padding past the strip, and the content scrolls behind the strip; - the stage page's bar holds `run-visit-title` (the stage), Summary starts at y=0 with the facts below the bar, and the tabs float at the bottom. - `test/features/schedules/ui/list/schedules_behind_bar_test.dart` (both hosts): - the strip is under the bar and holds the field, the list starts at y=0 with its first row below the strip, and a drag moves rows behind it; - an emptying query keeps the field element and its focus. Updated for intentional changes: - `run_detail_finders.dart` `expectVisitHeading`: the stage and `Visit N` are in the page bar. - `run_detail_visit_test.dart`: heading in the bar with header semantics, the facts below it; the long stage fits the bar's one line at 2x. - `run_decision_wiring_test.dart`: the banner spans the header strip at its 12 inset, and the strip sits 12 in from the pane. ## Evidence Captures are in `/tmp/wave2-e-evidence/`, taken with headless Chrome via `/tmp/wave2-e-scripts/shoot.mjs` (a copy of `/tmp/fix-c-tools/shoot.mjs` with its fixture server). They come from a web build of `tool/templates_wiring_probe_entry.dart` (the real app, `?host=material|cupertino`). Spec: `/tmp/wave2-e-scripts/mkspec.py`. - Naming: `{m,c}-{search,settings,templates,template-detail,schedules,run1,run5,stage}-{560,1200}-{light,dark}` and `{m,c}-{settings,templates,schedules,search,run1,stage}-{560,1200}-scrolled`. - `run5` is the human-decision run (banner inside the strip). - `stage` is `/runs/1/stage/build`. - A second pass (`mkspec2.py`) gave the fixture copy 16 templates and 12 schedules. Its captures are `{m,c}-{templates,template-long,schedules}-{560,1200}-{light,dark}-scrolled` (rows and source behind the bar or strip), `{m,c}-{templates,schedules}-*-rest`, and `{m,c}-{run1,stage}-560-*-input-scrolled` (Input expanded, then scrolled behind the header strip). - `main-{run1,run5,stage,search,settings}-{560,1200}-{light,dark}` are the `lib/main.dart` web build over the same fixture. That build is Material on the web. ## Not done / notes - A standalone `SearchScreen` with an implied Back (tests only; the app mounts Search as a shell tab) starts its field after the Back. Its results still start at the 12 inset. - No device run: Android and iOS are unverified.