Files
pipelines/app/notes/background-tasks-ring.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

42 lines
2.1 KiB
Markdown

# 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.