# 086 - Hub Motion Language ## User Story As the operator, I want every element to leave with a short fade, working things to beat like a heart and confetti to fall over the whole screen, so that I see at a glance what changed, what works and what is done. ## Decisions (operator-confirmed 2026-11-27; do not re-litigate) 1. **Nothing vanishes abruptly, everywhere** (operator): one shared `vanish(el)` helper fades and collapses an element in about 180 ms before it leaves the DOM (cards, toasts, modals, chips, rows, menus); list re-renders run through View Transitions so leaving items fade too. A lint test refuses a bare `.remove()` or `replaceChildren()` on a visible element outside the helper. `prefers-reduced-motion` removes at once. Rejected: ghost clones kept in every render (more code, same effect). 2. **Heartbeat for working objects** (operator): one shared CSS class marks anything that works right now (running task, running queue job, busy agent, live deploy): a double beat ("lub-dub") about every 1.2 s of a slight scale and a soft glow in its state colour. Queued, waiting, stale and dead objects stay still. Reduced motion keeps the glow without the beat. 3. **Confetti over the whole screen** (operator): it starts just below the top control bar, spreads over the full viewport width, falls to the bottom edge, lies there, and fades to transparent after a few seconds. Rejected: confetti only inside the deck. ## Approach ```mermaid flowchart TD subgraph P["๐Ÿงญ 0 ยท Preparation"] P1["๐Ÿ“‹ Write requirement"] --> P2{"โœ… Operator approves?"} P2 -- "โœ๏ธ corrections" --> P1 end P2 -- "๐Ÿค– yes" --> A1 subgraph A["๐ŸŒซ๏ธ A ยท Fade-out"] A1["๐Ÿงฉ vanish() helper and View Transitions"] --> A2["๐Ÿ” Every removal site through it"] A2 --> A3["๐Ÿšซ Lint test against bare removal"] A3 --> A4{"๐Ÿงช Tests green?"} A4 -- "๐Ÿ”ด no: fix" --> A1 end A4 -- "๐ŸŸข yes" --> B1 subgraph B["๐Ÿ’“ B ยท Heartbeat and confetti"] B1["๐Ÿ’“ Shared working class"] --> B2["๐ŸŽŠ Full-screen confetti that lands and fades"] B2 --> B3{"๐Ÿงช Tests green?"} B3 -- "๐Ÿ”ด no: fix" --> B1 B3 -- "๐ŸŸข yes" --> BF{"๐Ÿ’ฌ Operator feedback on screenshots?"} BF -- "โœ๏ธ changes" --> A1 end BF -- "๐Ÿ‘ fits" --> D1["๐Ÿ Review, commit with operator OK, hand-over"] ``` ## Acceptance Criteria ### Fade-out - [ ] A removed card, toast, modal, menu and list row keeps an opacity between 0 and 1 for at least 100 ms before it leaves the DOM. - [ ] With `prefers-reduced-motion: reduce` it leaves at once. - [ ] The lint test fails on a template with a bare `.remove()` of a visible element outside `vanish()`. ### Heartbeat - [ ] Running tasks, running queue jobs and busy agents carry the working class; queued, waiting, stale and ended ones do not. - [ ] The working class animates scale and box-shadow; under reduced motion only the box-shadow. ### Confetti - [ ] Confetti pieces start below the bottom edge of the top control bar and spread over at least 90 % of the viewport width. - [ ] Pieces come to rest at the bottom edge and reach opacity 0 within 10 s, after which no confetti node or canvas remains. ### Tests - Unit: - [ ] The lint test over every template (`tests/test_page_motion.py`). - Integration: - n/a: no server change. - E2E: - [ ] `tests/e2e/test_hub_motion_e2e.py`: a dismissed toast and a released card fade, a running task beats, confetti lands and fades, reduced motion removes at once.