Refine Settings destination shell integration

Keep Settings navigation independent while preserving shell actions and destination-specific state. Add the reviewed chat, run-entry, layout, and regression-test updates needed by the destination behavior.
This commit is contained in:
2026-11-12 11:21:26 +00:00
parent 95902e3e49
commit 26bb583f10
49 changed files with 2386 additions and 483 deletions
+41
View File
@@ -0,0 +1,41 @@
# Background tasks ring (composer)
Replaces the rotating layers icon in the composer's background-tasks button.
## Behaviour
- `chat_task_spinner.dart`: `ChatTaskSpinner(running:)`, 16 px square in every state.
- `running > 0`: Material `CircularProgressIndicator` (indeterminate, stroke 2,
primary colour) with the running count centred inside (`FittedBox` scales
the digit down under large text scaling).
- reduced motion (`MediaQuery.disableAnimations`): the same ring holds one
static quarter segment (`value: 0.25`) instead of spinning.
- `running == 0`: static `Icons.layers_outlined`, no ring.
- `chat_background_tasks.dart`: automation-only state keeps its static schedule
icon. Tooltip with running tasks is `Background tasks (N running)`; without
running tasks it keeps the caption label (e.g. `1 automation`, `Tasks`).
Semantics label is unchanged.
- Button size, padding and caption are unchanged.
## Tests (memwatch, from app/)
| Run | Paths | Result |
|---|---|---|
| 1 | `chat_task_spinner_test`, `chat_background_tasks_test`, `chat_background_tasks_modal_test`, `chat_background_task_metadata_test`, `chat_background_tasks_gui_test`, `chat_background_tasks_controller_test`, `chat_automation_lifecycle_test` | FAIL 37/38 (`chat_background_tasks_test` "combined caption..." — my test's `find.descendant` on the count key; fixed) |
| 2 | same seven paths | PASS 38/38, exit 0 |
`tool/analyze.sh`: clean, exit 0.
Test expectation changes (all from the requested behaviour):
- `chat_task_spinner_test.dart` rewritten for the ring: indeterminate value,
stroke 2, primary colour (light and dark), count text, same 16 px size in
every state, reduced-motion static segment, tooltip on the composer button.
- `chat_background_tasks_test.dart`: tooltip `2 tasks, 12 automations` became
`Background tasks (2 running)`; the composer count now also appears inside the
ring, so the caption check expects two `2` texts and the ring's count is checked
by its key.
## Not verified here
- Light/dark captures and rendered checks were not done in this stage; ui-review owns them.
- No device or browser run.
+75
View File
@@ -0,0 +1,75 @@
# Narrow chat header: title priority, settings in More, floating window
Run 415, stage 01-implement. Source only under `app/`. Not committed, not captured
(ui-review owns captures).
## Problem
- At 430px the chat title pill shrank to ~46x44 (a dot): `SegmentedBar` let the
non-overflowable selector island take up to 90% of the bar, leaving the title
its 10% floor.
- The harness mark was squeezed by the title pill's `FittedBox` leading.
- In a floating chat window the inner title repeated the window's own title.
## Changes
- `lib/ui/adaptive/segmented_bar.dart`: optional `titleShare`. When set, the title
keeps that share of the bar (its floor and the actions' ceiling). Default null
keeps the old shares for every other bar.
- `lib/features/chat/conversation/chat_thread_header.dart`:
- `showTitle` (default true). False omits the title pill and folder.
- Below 600 logical px (text-scaled, `chatHeaderNarrowWidth`): title keeps
`chatHeaderTitleShare` = 0.6 of the bar; the model/mode/thinking controls leave
the bar for one `Chat settings` entry in the More menu, which opens them in a
sheet with their labels; overflowable actions (Files, terminal, ...) join More.
- Wide (600+) layout unchanged.
- `lib/features/chat/conversation/chat_thread_view.dart`: `showTitle: !inWindow`
(floating window bar names the chat; More keeps `Chat details`); the three
controls pass `showLabel: true` (no effect at 600+, where they already show labels).
## Focused results (memwatch, from app/)
- Header, chat-bar and segmented-bar focused set (`chat_thread_header_test`,
`chat_effort_header_test`, `chat_mode_control_test`, `chat_model_picker_test`,
`chat_floating_chrome_test`, `chat_bar_tint_test`, `chat_pane_presentation_test`,
`segmented_bar_*`): 83/83 pass.
- Those plus the users of the changed header/keys (chat screen mode/model, floating
pane, list shortcuts, pane move, conversation and shell tests, terminal
bar-action tests, `chat_registration_test`), in one final run: 199 pass, 4 fail.
The 4 failures are `test/application/chat_registration_test.dart` (retap and
folded-workspace cases). The same 4 fail on untouched HEAD in a detached
worktree, so they are pre-existing and not caused by this change.
- `tool/analyze.sh`: clean.
New behavioural tests (`chat_thread_header_test.dart`, group "narrow title priority
at 430px"): short title whole (no truncation); long title ellipsized with the
title pill >= 60% of the bar; harness mark >= 20px beside the title; More opens
the controls in a sheet; Files moves into More; floating bar shows no title pill.
## Affected UI states (for ui-review to capture)
- 430px phone, chat bar: Back | title (>= 60% for long titles) | More.
Before: Back | ~46px title dot | model | mode | Files | More.
- 320px at 2x text: same shape (Back | title | More).
- More > Chat settings: sheet with model, mode and thinking controls, labelled.
- Floating chat window (any width): bar has no inner title; More has Chat details.
- 600px and wider: unchanged.
## Test expectation changes (narrow behaviour the task asked to change)
- `chat_thread_header_test.dart`: narrow bar expects the settings entry, not the
selector island/icons; wide branch keeps the old checks.
- `chat_floating_chrome_test.dart`: at 560px Files is in More (not in the bar).
- `chat_model_picker_test.dart`, `chat_screen_model_test.dart`,
`chat_screen_mode_test.dart`: phone tests open More > Chat settings to reach the
model/mode controls. Expected values are unchanged; `_shown` is now async.
## Limitations
- Phone users reach model/mode/thinking through More > Chat settings (two taps, was
one). Files is also in More on phones. The 60% title floor needs this at 430px
with 48px touch targets.
- The settings sheet holds the controls as built when opened. Server changes while
it is open show after reopening; each control's own accepted change updates at once.
- Harness mark size is asserted at >= 20px; no pre-change baseline was run for that test.
- Not verified on a device or in a browser; nothing captured here.
+3 -3
View File
@@ -21,9 +21,9 @@
- **More menu Stop.** `chat_thread_view.dart` adds a `Stop` item to the header's
More menu while a turn runs (`key chat-thread-stop-menu`). It is shown on every
platform, so touch devices without a keyboard can stop.
- **Tasks spinner.** `chat_task_spinner.dart` turns the layers icon once per
2.5 s while at least one background task runs; static otherwise and under
reduced motion. Automation-only state keeps its static schedule icon.
- **Tasks spinner.** Superseded: `chat_task_spinner.dart` now draws a progress
ring with the running count instead of turning the layers icon. See
`notes/background-tasks-ring.md`.
## Focused tests (memwatch, from app/)
+40
View File
@@ -0,0 +1,40 @@
# Dim inactive chat panes
## Change
- `lib/features/chat/workspace/chat_pane_dim.dart` (new): `ChatPaneDim` lays an
`IgnorePointer` surface scrim over a pane's content. The scrim is the theme's
`colorScheme.surface` at `chatPaneDimOpacity` (0.35), so content reads at
about 65% emphasis in light and dark. Its colour fades over `Motion.standard`;
`Motion.of` returns zero under reduced motion, so the change is immediate.
- `lib/features/chat/workspace/chat_workspace.dart`: `_paneContent` wraps each
pane's built content in `ChatPaneDim(dimmed: paneCount > 1 && !active)`.
Pointer activation (the pane `Listener`), focus and the action bar's
existing tint (`ChatPaneActivity`) are unchanged. The scrim ignores pointers,
so a tap reaches the content beneath it and still activates the pane.
- The optional primary outline is not added. The active pane already has its
chat-coloured foreground border (`chat_screen_workspace.dart`).
## Tests
- `test/features/chat/workspace/chat_pane_dim_test.dart` (new, 7 tests):
two panes dim only the inactive one; three panes dim both inactive panes;
a single pane is never dimmed; a tap on an inactive input activates it and
focuses its editable text; a tap on bare space in an inactive pane activates
it; reduced motion gives a zero duration and an immediate switch; default
motion uses `Motion.standard`.
- Existing users of `ChatWorkspace` also run: `chat_workspace_test`,
`chat_pane_move_test`, `chat_center_stage_test`, `chat_switch_styles_test`,
`chat_mobile_panes_test`, `chat_peek_identity_test`, and
`test/features/settings/quick_switch_preview_test.dart`.
Command (from `app/`):
`tool/memwatch/full.sh 'test/features/chat/workspace/chat_pane_dim_test.dart test/features/chat/workspace/chat_workspace_test.dart test/features/chat/workspace/chat_pane_move_test.dart test/features/chat/workspace/chat_center_stage_test.dart test/features/chat/workspace/chat_switch_styles_test.dart test/features/chat/workspace/chat_mobile_panes_test.dart test/features/chat/workspace/chat_peek_identity_test.dart test/features/settings/quick_switch_preview_test.dart'`
Result: `PASS: 70 passed, 0 failed, 0 skipped; peak 1329 MB; 11s; exit 0`.
Analyzer (`tool/analyze.sh`): clean, exit 0.
## Not done here
- No captures. The 2- and 3-pane light and dark captures belong to ui-review
(`tool/capture/`), and no UI was built or run in this stage.
- No test or capture covers the chat screen's full path (`chat_screen_workspace.dart`).
The dim comes from `ChatWorkspace`, which that screen uses, so it applies there too.
+73
View File
@@ -0,0 +1,73 @@
# Rail top strip and empty top-right island
Two shell chrome defects on the wide layout (run 20261112-1022).
## Causes
- **White strip above the rail (96x8 at y=0).** On a wide window
`WindowMargins` adds `wideExtraTop` (16 - 8 = 8 px) to `MediaQuery` top
padding. `ShellNavigationRail` pads its rail by that top inset with a plain
`Padding`, so the 8 px above the rail's Material surface was never painted
and showed the canvas behind it (white in both themes).
- **Empty circular pill (top right of Search and Settings).**
`pipelines_app.dart` put `WindowsMenuButton` in `barActions` on every tab.
The button returns `SizedBox.shrink()` with no open window, but
`SegmentedBar` counted it as an action, so the trailing island was drawn
around nothing.
## Changes (app/)
- `lib/shell/navigation_rail.dart`: the rail is wrapped in a `ColoredBox`
(key `shell.navigation-rail.surface`) in the theme surface, and the
`NavigationRail` gets the same `backgroundColor`. The top inset still moves
the rail's content down; the inset itself is painted.
- `lib/shell/windows/windows_menu_button.dart`: new static
`WindowsMenuButton.hasWindows(manager)`, the single predicate for "a window
is listed".
- `lib/shell/adaptive_shell.dart`: new optional `windowManager` parameter.
The shell adds the Windows button to the bar's actions only when
`hasWindows` is true, and merges the manager into the top bar's listenable
so the island appears and disappears with windows.
- `lib/application/pipelines_app.dart`: the Windows button is no longer in
`barActions`; `windowManager: _windows` is passed to the shell instead.
## Tests (focused, run through tool/memwatch/full.sh)
Paths: `test/shell/navigation_rail_surface_test.dart`,
`test/shell/shell_bar_empty_actions_test.dart`,
`test/shell/navigation_rail_test.dart` (existing, affected by the rail
change), `test/shell/windows/window_conveniences_test.dart` (existing, uses
`WindowsMenuButton` directly).
- Result: `PASS: 28 passed, 0 failed, 0 skipped; peak 1128 MB; 4s; exit 0`.
- Rail surface, light and dark: the cover is at y=0, its colour equals the
theme surface, the rail's background equals it, the rail content starts at
the 8 px inset, and the strip above it is inside the cover.
- Action island: Search, Settings and Pipelines at 1000 px and 430 px draw no
`segmented.actions` island with no window; a shell with no window manager
draws none; the Windows button is the island only while a window is open
and goes away when it closes.
`tool/analyze.sh`: clean, exit 0.
Not run: the land gate and the full app suite (owned by the gate stage).
Pre-existing failures listed in the memory note were not checked here.
## Affected UI states (for ui-review to capture)
- Wide window (1600x1000), light and dark: rail top (should now be the
surface colour, not white), on every tab and on Settings.
- Wide and narrow (430x900), Search and Settings: no empty pill at top right.
- Wide window with one or more floating windows open: the Windows button is
shown in the top-right island.
Before-captures exist in `/tmp/ui-review/` (`base-dark-1600x1000/12-settings.png`,
`base-light-430x900/11-search.png`, and others). No after-captures were
taken in this stage, per the stage rules; ui-review owns capture.
## Limitations
- The "rail top colour equals rail surface" check is a widget-tree check
(colour and rect), not a pixel read from a rendered frame.
- `WindowMargins` (the source of the 8 px) is untouched; the fix is at the
rail, so the rail's content position is unchanged.
+72
View File
@@ -0,0 +1,72 @@
# Settings destination: Back only when pushed; one Settings entry per screen
Run 20261112-1022 (stage 01-implement). Not committed.
## Rule
- Settings opened from a shell control (rail item, phone bar item) is a
destination: no Back arrow. The Pipelines item leaves it for the Pipelines body.
- Settings opened any other way (a first load / deep link to `/settings`, a route
change that is not a shell control, the Pipelines gear) is a pushed page: Back
returns to Pipelines.
- The Pipelines bar's gear is kept only where the floating tab bar is the shell's
sole navigation (window width at least 600 and below the rail's 697; see
`showsFloatingTabBarOnly`). There the floating bar lists tabs only, so the gear
is the one Settings entry. The phone bar and the rail both offer Settings, so the
gear is gone there.
## Changed paths (app/)
- `lib/shell/adaptive_shell.dart`: `_navigatingTo` / `_settingsPushed`; `_noteShown`
is called on a shown-destination change; Back is built only when Settings is
pushed.
- `lib/shell/navigation_rail.dart`: `showsFloatingTabBarOnly(context)`.
- `lib/shell/destination.dart`: doc comment only.
- `lib/features/pipelines/screen.dart`: the bar's gear is shown only when
`showsFloatingTabBarOnly`; the rail check is gone. The non-shell paths keep the gear.
- `lib/application/pipelines_app.dart`: `_selectDestination` leaves Settings for the
Pipelines body (`_bodyRoutes`) instead of re-selecting the Settings route filed
under the Pipelines tab (the nav-only Settings has no Back, so without this the
Pipelines item would trap the user on Settings).
- Tests, new: `test/shell/settings_back_test.dart` (nav selection has no Back; route
push has Back and returns; first load has Back; nav after pushed clears Back);
`test/features/pipelines/pipelines_settings_gear_test.dart` (phone and rail: no
gear; floating band: gear present and its handler opens Settings).
- Tests, changed: `test/application/settings_page_test.dart`,
`test/application/tab_location_navigation_test.dart`,
`test/application/settings_registration_test.dart`,
`test/shell/navigation_rail_test.dart`. They now tap the nav item instead of the gear
and expect no Back on nav-opened Settings.
## Focused results (memwatch, from app/)
- New shell + gear tests and shell/rail/bar files: 54 passed, 0 failed.
(`settings_back_test`, `pipelines_settings_gear_test`, `navigation_rail_test`,
`shell_bar_test`, `tab_history_back_test`, `shell_navigation_bar_test`,
`split_destination_bar_test`, `pipelines_screen_filter_test`)
- Final run over all affected files (12 paths): 60 passed, 7 failed. The 7 are all
app-level tests that fail on HEAD for the same reason (see below). None is new.
- `settings_page_test`: "390 ... no gear ..." and "1200 ... rail ..."
- `tab_location_navigation_test`: "Settings is retained ...", "a delayed read ...",
"an explicit root URL ...", "Settings does not clear ..."
- `settings_registration_test`: "Settings shares socket and one native bar"
- Baseline check: a copy of app/ with HEAD's versions of the edited files fails the
same tests in the same way (`Expected: '/settings' Actual: '/pipelines'` after a
nav tap, and `Found 0 widgets with key 'segmented.more'` for the gear at 390).
`templates_wiring_test` passes on both.
- `tool/analyze.sh`: clean (0 errors, 0 warnings, 0 infos).
## Limitations
- App-level Settings navigation is not verified by these tests: a tap on the Settings
nav item does not change the route in this harness, on HEAD or on this change. The
behaviour is covered at shell level (`settings_back_test`) and by the gear test.
- System Back on a nav-opened Settings still closes to Pipelines (the shell's
PopScope is unchanged).
- The mid-width band keeps the gear by design (the floating bar has no Settings
entry). Adding Settings to the floating bar would remove it; not done here.
- Not built or captured here (ui-review owns that). States to re-capture:
- `base-light-430x900/12-settings.png` and `circle/01-hover.png`: Settings from the
nav has no Back arrow.
- `base-light-430x900/01-pipelines.png`: no Settings gear in the Pipelines header.
- A width between 600 and 696: the gear stays, and it opens Settings with Back.
+21
View File
@@ -90,3 +90,24 @@ Focused results (memwatch, two files): 24 passed, 0 failed. Analyzer: clean.
Known, not changed: Schedules opened from Pipelines still returns to Settings
(`openSchedules` sets the return route to Settings), so Settings shows under it.
## Land re-entry: main moved
`main` gained `77a88d09` (Settings as a top-level destination, from another
run). Its `shellTabFor` mapping is gone here: Settings is its own destination,
so the shell no longer maps it to Pipelines. The merge was taken as a squash
(`git merge --squash main`), left staged and not committed, as this stage
requires.
Conflicts resolved:
- `app/lib/shell/destination.dart`: this branch's doc comment (Settings selected
alone, no tab highlighted). `shellTabFor` stays removed; no `app/lib` or
`app/test` file uses it.
- `app/test/application/tab_location_navigation_test.dart`: Settings opened from
its nav item has no `shell.back`; leaving it for Pipelines uses the nav item,
not a system Back. The unused `systemBack` helper is removed.
Focused results (memwatch, 7 files, one quoted list): 53 passed, 0 failed:
`settings_page_test`, `tab_location_navigation_test`, `tab_locations_test`,
`tab_history_back_test`, `settings_back_test`, `navigation_rail_test`,
`pipelines_settings_gear_test`. Analyzer: clean.
+98
View File
@@ -0,0 +1,98 @@
# Starting a run: labelled entry points
## Change
- Pipeline detail: the icon-only play button in the top bar is now a labelled
`FilledButton.icon` "Run" (same key, `runPipelineActionKey`). In a narrow bar
it moves into the More menu with its label, via the existing
`SegmentedOverflowAction`.
- Runs: an extended "New run" button (`runs-new-run`) floats over the list's
bottom-right corner while the list is the visible view (phone list, or the
desktop list pane). It sits above the shell's bottom bar: the button's bottom
is lifted by the body's bottom padding, the same inset the list clears. While
it is shown, the list's bottom padding also reserves its band (`_newRunBand`
in `lib/features/runs/screen.dart`), so the last row should rest above the button (no test covers this; ui-review to confirm).
It opens a searchable picker of active pipelines (archived ones are
withheld), reads the chosen pipeline's latest version, then opens the same
start dialog the Run button opens.
- The start flow moved out of `RunPipelineAction` into
`lib/features/pipelines/ui/run_pipeline_flow.dart` (`openRunPipelineFlow`),
so both entry points share one submit, pending-intent and accept path.
- The pending-intent store on Runs uses the same endpoint scope as Pipelines
(`lib/application/pending_run_scope.dart`).
- Walkthrough step 3 now reads: "Press Run on a workflow, or New run on the
Runs tab, to start one."
## Fix for ui-review rejection (visit 1)
- Defect: on a phone the "New run" button sat beneath the bottom navigation
(semantics rect y=928-984 at 430x900), so it was hidden and a tap reached
Settings.
- Cause: the button was the last child of a column under the list, and the
shell's body extends under the bar (`extendBody`), so the bottom of the
column was under the bar.
- Fix: the button is now an overlay positioned above the body's bottom inset,
and the list reserves the band. Desktop uses the same overlay.
- Tried first and rejected: wrapping the list in a `Column` with the button as
a second child (in both an `Expanded` and an outer form). It fixed the phone
position but broke row selection on desktop (`list_detail_consistency_test`
"selected rows" at 640 wide: row 1 kept its selected flag after row 2 was
opened). The overlay keeps the list as a direct child and passes that test.
## Files
- Source: `lib/features/pipelines/ui/run_pipeline_action.dart`,
`lib/features/pipelines/ui/run_pipeline_flow.dart` (new),
`lib/features/runs/screen.dart`, `lib/features/runs/ui/new_run_button.dart`
(new), `lib/features/runs/ui/new_run_flow.dart` (new),
`lib/features/runs/ui/new_run_picker.dart` (new),
`lib/application/pending_run_scope.dart` (new),
`lib/application/pipelines_destination.dart`,
`lib/application/runs_destination.dart`,
`lib/features/walkthrough/walkthrough_steps.dart`.
- Tests: `test/features/runs/ui/new_run_test.dart` (new),
`test/features/pipelines/ui/run_pipeline_launch_test.dart` (one case added),
`test/features/runs/ui/runs_list_refresh_test.dart` (finder scoped to the list
rows; its expectations are unchanged).
## Regression coverage for the rejection
- `new_run_test.dart` "New run clears the bottom bar and opens the picker on a
phone": the screen sits in a scaffold with `extendBody` and a NavigationBar,
as the shell does. It asserts the button's bottom is at or above the bar's
top, and that a tap on the button opens the picker. Before the fix it failed
(button bottom 884, bar top 820).
## Focused results (visit 2)
Command: `tool/memwatch/full.sh` with 19 test files (the new-run and launch
tests plus every test file that builds RunsScreen, the Pipelines Run action, the
Pipelines screen, Settings, or the walkthrough).
- 119 passed, 1 failed. Verdict named only the intended paths.
- Failing: `test/application/run_start_wiring_test.dart` "an accepted launch
opens the returned run and re-reads the runs list exactly once". It also fails
on untouched `main` (checked in a temporary main worktree, since removed): it
times out waiting for `get_pipeline` after tapping `pipeline-row-1`.
- `list_detail_consistency_test.dart`: passes (it failed with the rejected
`Column` layout; see Fix above).
- `new_run_test.dart`: 5 passed, including the phone bottom-bar case.
- `tool/analyze.sh`: clean (exit 0).
## Affected UI states (for ui-review to re-capture; not captured here)
1. Pipeline detail, wide bar: labelled "Run" next to the list and more icons.
2. Pipeline detail, narrow phone bar: Run should move into More, labelled.
3. Runs list, phone (430x900): "New run" floats above the bottom bar, clear of
the last row at rest. This is the rejected state; it must be re-captured.
4. Runs list, desktop: "New run" floats over the list pane's bottom-right.
5. New run picker: default, searching, no match, no active pipelines, error+retry.
6. Start dialog reached from the picker.
7. Walkthrough step 3 copy.
Before captures: `/tmp/ui-review/pipe-light-430x900/01-pipeline-detail.png`
(play icon unlabelled) and `/tmp/ui-review/base-light-430x900/03-runs.png`
(no New run).
## Limitations
- No UI was built or captured in this stage (per the stage instructions);
rendering is unverified. The phone position is verified only by the widget
test's layout geometry under a scaffold that mirrors the shell.
- `_newRunBand` is a fixed reservation (16 + 56 + 16). If the extended button
grows with text scale, the last row may need more room. Measuring it would
need a size callback; not done.
- The Runs picker reads only the current endpoint scope. Pending intents stored
under legacy endpoints are not offered by New run (Pipelines still offers them).
- Not run on web, a device or the Fold.