Replace background task spinner with gear

Use an outlined settings gear with a running-count badge and slow linear rotation while background tasks are active. Preserve reduced-motion behavior, composer sizing, and tooltip coverage with updated focused tests and notes.
This commit is contained in:
2026-11-12 12:43:47 +00:00
parent 0bb3a5c5c6
commit a2a9a7e3c1
7 changed files with 332 additions and 224 deletions
+45
View File
@@ -0,0 +1,45 @@
# gear-icon-background-tasks — composer gear replaces the count ring
## What changed
The composer's background-tasks control now shows an outlined settings gear
(`Icons.settings_outlined`) instead of the progress ring with a count. While tasks
run the gear turns linearly, one turn per 4 s, and a Material `Badge` shows the
running count. When nothing runs the gear is upright, static and has no badge.
Reduced motion keeps the badge but never rotates the gear. Button size (16 px
square) and tooltip (`Background tasks (N running)`) are unchanged.
| File | Change |
| --- | --- |
| `lib/features/chat/conversation/chat_task_gear.dart` | New `ChatTaskGear` widget (replaces `chat_task_spinner.dart`, deleted) |
| `lib/features/chat/conversation/chat_background_tasks.dart` | Uses `ChatTaskGear`; comment updated |
| `test/features/chat/conversation/chat_task_gear_test.dart` | Renamed from `chat_task_spinner_test.dart`; rewritten for gear, badge, rotation, reduced motion, dark, size, composer tooltip |
| `test/features/chat/conversation/chat_background_tasks_test.dart` | Comment only: the count now sits on the badge; expectations unchanged |
## Behaviour
- `running > 0` and motion allowed: `AnimationController.repeat()` over
`ChatTaskGear.turnDuration` (4 s), linear, bound to `RotationTransition`.
- `running == 0`, or reduced motion: no ticker; a stop resets the turn to 0.
- Badge: `isLabelVisible: running > 0`, theme primary background and `onPrimary` text.
- Keys: `chat-background-tasks-gear` (box), `chat-background-tasks-badge`,
`chat-background-tasks-rotation`, `chat-background-tasks-count` (badge label).
- Automation-only state still shows the static `Icons.schedule` (unchanged).
## Focused results
Command: `tool/memwatch/full.sh 'test/features/chat/conversation/chat_task_gear_test.dart test/features/chat/conversation/chat_background_tasks_test.dart test/features/chat/conversation/chat_background_tasks_modal_test.dart test/features/chat/conversation/chat_automation_lifecycle_test.dart test/features/chat/conversation/chat_background_task_metadata_test.dart'`
Verdict: PASS, 34 passed, 0 failed, 0 skipped, peak 1167 MB, 5 s, exit 0.
`tool/analyze.sh`: clean, exit 0.
A first run failed because `_sync()` read `MediaQuery` from `initState`; it was
moved to `didChangeDependencies` (which runs after `initState`). The rerun is the
result above.
## Not verified here
- No light/dark captures and no visual check of the 16 px badge overlap. Owned by ui-review.
- No on-device check.
- The land gate has not been run.