Files
pipelines/app/notes/pages-fixes.md
T
alan 3704d98d4d Search field in the bar, refresh and Back as bar pieces, even Cupertino actions (F8/F28/F10/F11/F20/F1)
- Search: field, compact Kind menu and syntax help in the bar's actions pill;
  bounds shown only when truncated; rows with bold title, kind tag and one
  muted line; results run behind the bar in a start-aligned 840 column.
- AppSearchField: one search field per platform (Search, Schedules, Runs filter).
- BarIconButton: whole 44pt/48dp bar actions; Runs, bell and Pipelines icons
  use the same 44pt targets on Cupertino.
- Templates and Schedules pages put Refresh in the bar and use the shared
  round SegmentedBackButton; Templates shows one Back at a time.
- PipelineBackButton is the round segmented Back.
- notes/pages-fixes.md records the batch, tests and evidence.
2026-10-31 03:31:25 +00:00

151 lines
7.6 KiB
Markdown

# Search, Settings and page-chrome fixes (style review batch C)
Fixes from the whole-app style review (`/tmp/app-style-review/report.md`):
F8/F28 Search, F9 Settings, F10 refresh placement, F11 back/close, F20
Cupertino action spacing, and F1 for Search and Settings.
## Shared pieces
- `lib/ui/input/app_search_field.dart` — `AppSearchField`, the one search field
per platform: Cupertino's stock `CupertinoSearchTextField`; on Material a
stadium `TextField` (leading search icon, clear button once there is text,
no underline, no elevation). It is filled with `surfaceContainerHigh` on a
page; `inBar` drops the fill (Cupertino: the grey) inside a bar's glass pill.
It is used by Search, the Schedules toolbar and the Runs filter sheet. The
chat search fields were left alone because chat belongs to another lane.
- `lib/ui/navigation/bar_icon_button.dart` — `BarIconButton`, one icon action
of an actions pill. Material uses an `IconButton` (48dp, tooltip). Cupertino
uses a `CupertinoButton` with no padding and a 44pt square minimum. `busy`
shows the platform activity indicator in the same box.
## Search (F8, F28, F1)
- The bar is the shell's title pill (Search) plus one actions pill holding
`SearchBarControls` (`features/search/ui/search_bar_controls.dart`): the
field, a compact Kind menu, and an info button for the query syntax.
- Kind is a filter icon while every kind is searched, and a small chip once
the search is narrowed. Material uses a `PopupMenuButton` of
`CheckedPopupMenuItem`s; Cupertino uses an action sheet.
- The info button opens the syntax help in a dialog.
- As the shell's tab the screen publishes the controls through `ShellBar`.
Standalone, it gives them to its own `SegmentedBar`.
- The pill is at most 560 wide (`kSearchPillMaxWidth`).
- `SegmentedBar` keeps a 25% title share and right-aligns its actions, and
`lib/shell` and `lib/ui/adaptive` were out of scope. So the field sits
beside the Search title rather than replacing it.
- The bounds line (`N results · cap · scanned …`) now appears only when the
server truncated the answer. It is a muted note with an info icon
(`search_bounds_note.dart`, key `search.bounds`).
- Result rows: a bold title (up to 2 lines), a small kind tag at the trailing
edge (`SearchKindTag`), and one muted line: recency, then the snippet (match
in bold) or the kind's facts. The old bold kind line between title and
metadata is gone.
- `SearchScrollView` (`search_layout.dart`):
- There is no top `SafeArea`. The scroll view reaches the top edge and starts
its content below the bar's media padding.
- Each sliver is start-aligned at the bar's 12px inset, at most 840 wide.
- The view ends with the floating tab bar's clearance.
- Cupertino results are one inset section filled with `systemGrey6`, the
same grey as the bar pills, instead of a white card framed by a grey band
on the shell's white page.
- Keys kept: `search.field`, `search.kind`, `search.clear`, `search.retry`,
`search.result.<target>`. New keys: `search.help`, `search.bar`,
`search.bounds`.
## Settings (F9, F1)
Done in a separate worktree and fast-forwarded here (commit `3ec580c2`).
- Flat grouped sections:
- `SettingsGroup`/`SettingsGroupItem`: a Material primary header over a flat
`surfaceContainer` group with dividers; Cupertino
`CupertinoListSection.insetGrouped`.
- `SettingsRow` and `SettingsStatusRow` rows.
- Server rows show a check mark, the address and a trailing
Use/Edit/Remove menu (key `settings.server.<id>.menu`), plus an Add server
row.
- Templates and Schedules are chevron rows in a "Library" group.
- The ntfy rows use a `CupertinoSwitch` on Cupertino.
- The disabled Save workspace is a `FilledButton.tonal`.
- No elevated cards: `SettingsCard` was removed.
- Helper copy is shorter, and the trust warning is a section footer.
- `SettingsPageBody`: no top `SafeArea`. The page pads by the bar's height,
and its column is start-aligned at x=12 with a maximum width of 720.
## Refresh and Back (F10, F11)
- Templates:
- `TemplatesFrame` puts Refresh in the bar's actions pill. Standalone, it
draws its own `SegmentedBar`. Embedded, it publishes Back and Refresh
through `ShellBar`.
- `TemplatesDestination` owns a `ShellBarRegistry`/`ShellBarScope` for its
page and builds its one `SegmentedBar` from what the gallery publishes.
- The round leading piece is the page Back (`templates-page-back`) on the
gallery and the detail Back (`template-detail-back`) on an open template,
so there is only ever one Back. The body back row in `TemplateDetail`
remains only with no bar above, as a `SegmentedPill` +
`SegmentedBackButton`.
- Schedules: `SchedulesDestination` uses `SegmentedBackButton` (new key
`schedules-page-back`) and puts `ScheduleRefreshAction` in the actions pill.
The toolbar shows Refresh only when no bar carries it
(`SchedulesListView.refreshInToolbar`; the standalone `SchedulesScreen`
still shows it in the body).
- `PipelineBackButton` is now the round `SegmentedPill` + `SegmentedBackButton`
(semantics "Back to pipelines" kept).
## Cupertino action spacing (F20)
The Runs stats/filter/sort actions, the Needs-you bell, and the Pipelines
filter and sort icons all use no padding and a 44pt square target. They are
evenly spaced, and the last one no longer touches the pill's edge.
## Tests
- New:
- `test/features/search/search_bar_layout_test.dart`, on both hosts:
- the controls are in the bar, with no SearchBar or dropdown
- the help is hidden until the info button is tapped
- stats show only when truncated
- rows have a kind tag and one line
- at 1200 the scroll view reaches y=0, rows start below the bar inside
the 12 inset and the 840 cap, and the pill is no wider than 560
- `test/ui/navigation/bar_icon_button_test.dart`: 44/48 targets that abut;
one stadium search field with a clear button; no Material under Cupertino.
- Updated:
- `search_screen_test.dart` and `search_screen_states_test.dart`
(`TextField` instead of `SearchBar`, the Kind menu item)
- `templates_wiring_test.dart` (Refresh and the single Back are in the bar;
one extra frame for the bar to hand Back back)
- `schedules_destination_test.dart` (Back and Refresh are bar pieces)
- the Settings tests listed in commit `3ec580c2`
## Evidence
The captures are in `/tmp/fix-c-evidence/`.
- Setup:
- Web build of `tool/templates_wiring_probe_entry.dart` (the real app with
`?host=cupertino`).
- Served by a copy of `tool/runs_probe_server.mjs` in `/tmp/fix-c-tools/`.
The copy adds fixture `list_templates`/`list_schedules` replies and marks
a search containing "many" as truncated.
- Driven by `/tmp/fix-c-tools/shoot.mjs` (headless Chrome).
- Files: `{m,c}-{search,settings,templates,schedules}-{560,1200}-{light,dark}`,
`{m,c}-search-560-{idle,truncated}`, `{m,c}-runs-560-light`,
`{m,c}-settings-560-scrolled`.
- The Settings worktree's own captures are `settings-app-*` and
`settings-probe-*`.
## Known gaps
- In the shell, Search and Settings content still stops below the bar: the
shell wraps each tab in a top `SafeArea` (`lib/shell`, out of scope). Both
pages already pad by the media padding, so they will run behind the bar once
the shell stops consuming it. A standalone `SearchScreen` (not mounted by
the app, only by tests) already runs behind its own bar.
- The Search field shares the bar with the Search title pill. Making it fill
the whole bar needs a `SegmentedBar`/shell change.
- The Cupertino Templates gallery still draws white rows in a grey band on the
white page (gallery styling was not part of this batch).
- No device run: Android and iOS are unverified.