Files
pipelines/app/notes/composer-running-border.md
T
alan 4fba2794eb Replace background task spinner with count ring
Show the running-task count inside a primary-colour progress ring while preserving the composer button size and reduced-motion behavior. Update the related widget and integration tests and document the new indicator.
2026-11-12 10:51:44 +00:00

76 lines
4.4 KiB
Markdown

# Composer running state: border, Escape stop, tasks spinner
## Changes
- **Stop button removed.** The composer no longer shows a Stop control while a
turn runs; Send stays as before (queued/steered prompts unchanged).
`chat_stop_icon.dart` and its test are deleted (their only user was the button).
- **Running border.** `composer_running_border.dart` draws a sweep highlight
(theme primary = chat focus accent, tertiary) once around the pill's rounded
edge, 4 s per lap, with a faint blur glow. Mounted only while `running`, so
disposal stops the ticker when the turn ends. Reduced motion
(`MediaQuery.disableAnimations`) draws a static highlighted border and never ticks.
- **Escape stop.** `chat_escape_stop.dart` wraps the conversation column in
`chat_thread_view.dart`. Two plain Escape presses within 1 s stop a running turn
(`composer.stop()`); the first shows the snackbar "Press Esc again to stop".
Escape is consumed only while running; a descendant that handles Escape first
(command palette, notice) never counts. Held Escape counts as one press.
- **`/stop`.** Already existed (`chat_commands.dart`); unchanged. Typing `/stop`
and sending runs it on the first send. A partial word (`/sto`) still
completes the palette row first (`_paletteCompletes`).
- **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.** 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/)
| Run | Paths | Result |
|---|---|---|
| 1 | `chat_escape_stop_test`, `chat_task_spinner_test`, `chat_composer_running_test`, `chat_thread_stop_menu_test`, `chat_composer_bar_state_test`, `chat_command_palette_test` | PASS 46/46 |
| 2 | Affected users: `chat_background_tasks_*` (4), `chat_thread_view_test`, `chat_thread_header_test`, `chat_composer_*` (bar, focus ring, enter, paste, attachment send, bottom margin), `chat_busy_resume`, `chat_response_pending`, `chat_live_reasoning`, `chat_floating_chrome`, `chat_server_queue`, `chat_delivery`, `composer_focus_restore`, `chat_unfocused_paste_routing`, `chat_floating_pane`, `chat_next_chat`, `chat_shell_composer`, `glass_bar` | PASS 169/169 |
`tool/analyze.sh` (whole app): clean, exit 0.
## Land-gate fix (visit 2)
`chat_permission_card_test.dart`: "a turn waiting on a pending card hides the
running indicator but keeps Stop" asserted a `Stop` tooltip on the composer,
which this change removes by design. It now asserts no `chat-composer-stop`
and that Stop is in the More menu, before and after the permission resolves.
Expectations for behaviour this change did not touch are unchanged.
| Run | Paths | Result |
|---|---|---|
| 3 | `chat_permission_card_test`, `chat_thread_stop_menu_test` | PASS 15/15 |
| 4 | all six focused paths above (escape, spinner, running, stop menu, bar state, permission card) | PASS 44/44 |
`tool/analyze.sh`: clean, exit 0.
## Affected states (widget tests)
- Running: no `chat-composer-stop`; Send present; border present; no interrupt sent.
- Turn ended: border gone; no animation ticker left.
- Reduced motion while running: border present, zero tickers.
- `/stop` (one send) interrupts; the notice shows.
- Esc once: hint shown, no interrupt. Esc twice (within 1 s): one interrupt.
Esc idle: nothing. Esc with palette open: palette closes and does not count.
- Transcript-level focus: Esc twice stops (`ChatEscapeStop` unit test). A
descendant-handled Esc never counts.
- More menu: Stop present while running and triggers the interrupt; absent when idle.
- Tasks icon: spins while a task runs; static at rest; reduced motion never turns.
## Limitations
- Not captured or reviewed visually (ui-review owns that). The border's colours
and glow strength in light and dark are unverified by eye.
- Escape stop is verified with synthetic key events in widget tests, not on a
physical keyboard or a device. Touch devices are covered by the More menu item
only; no device was tested.
- The More menu Stop item is shown on every platform while running, not only on
touch devices.
- A partial command word (`/sto`) still needs two sends (palette completes, then
runs); a fully typed `/stop` runs on one send.