Skip to content

fix(platform): stop the board's working pulse under reduced motion - #4138

Closed
yannickmonney wants to merge 2 commits into
mainfrom
fix/board-working-pulse-reduced-motion
Closed

yannickmonney wants to merge 2 commits into
mainfrom
fix/board-working-pulse-reduced-motion

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

The board card's Agent is working… glyph (task-indicators.tsx) and the document history dialog's loading placeholder were the two animate-pulse uses under services/platform/app and packages/ui/src without a reduced-motion stop. The other seven write motion-reduce:animate-none, motion-safe:animate-pulse or a prefersReducedMotion check.

  • Working glyph: it gets animate-pulse motion-reduce:animate-none, as StatusIndicator's pulse does. It keeps the Bot glyph rather than swapping in StatusIndicator, which is a dot and would change the design. It stays visible and stops under prefers-reduced-motion: reduce.

  • History dialog placeholder: it uses the shared SKELETON_PULSE fill (@tale/ui/skeleton, animate-pulse bg-muted motion-reduce:animate-none). It looks the same as before.

  • Guard: services/platform/tests/guards/reduced-motion-pulse.guard.test.ts parses every non-test .ts/.tsx under services/platform/app and packages/ui/src with the TypeScript AST. It reads each string literal as a class list and fails on an animate-pulse class with none of three opt-outs:

    • the motion-safe: variant;
    • motion-reduce:animate-none in the same class expression;
    • a && or ternary behind a reduced-motion check, with the pulse on the branch reached only without the preference (!reducedMotion && …, reducedMotion ? … : pulse). A check the wrong way round, such as prefersReducedMotion ? 'animate-pulse' : …, is caught (eb1c83897).

    It carries 10 catch and 10 allow samples. It also asserts that the walk reads at least one pulse, so it can't pass vacuously. turbo-inputs.guard.test.ts, .agents/repo.md ("three suites read it as text") and the manual reference/automation.md register name it.

  • Board test: kanban-board.test.tsx renders a card with a live run (TaskBoardProvider runningTaskIds). It checks that the working glyph is there with both animate-pulse and motion-reduce:animate-none.

There are no new strings and no migration. The card's prohibited aria-label stays with #3793.

Correction to the issue's impact

@tale/ui's stylesheet already has a global reduced-motion rule (packages/ui/src/globals.css:763-773): animation-duration: 0.01ms !important; animation-iteration-count: 1 !important on *. The platform loads it (services/platform/app/globals.css:1, imported by main.tsx:27).

The TALE-358 probe behind #4128 read only getComputedStyle(el).animationName (k1b-board-detail.ts:57,72). That stays pulse under the global rule. So by the stylesheet, a reduced-motion user most likely saw a single 0.01 ms iteration, not a pulse that lasts as long as the run. The issue's "pulses for minutes to hours" claim is not established; nobody has observed it in a browser either way.

This PR still does what the issue asks:

  • Under reduce, the glyph's animation computes to none without depending on that catch-all, like the seven opted-out sites and the design system's own pulses.
  • The guard keeps the convention explicit.

Visual gate, pending review: no browser was allowed in this slice. Read animation-name, animation-duration and animation-iteration-count on the working glyph under reducedMotion: 'reduce', on main and on this branch:

  • main should read pulse, 1e-05s, 1;
  • this branch should read none.

How I verified it

On d39756043, with the tests written before the fix:

FAIL |server| tests/guards/reduced-motion-pulse.guard.test.ts > reduced-motion pulse guard > stops every animate-pulse under prefers-reduced-motion
+   "services/platform/app/features/documents/components/document-history-dialog.tsx:173: \"bg-muted h-12 animate-pulse rounded-md\"",
+   "services/platform/app/features/tasks/components/task-indicators.tsx:167: \"size-3.5 shrink-0 animate-pulse\"",
      Tests  1 failed | 17 passed (18)

FAIL app/features/tasks/components/kanban-board.test.tsx > KanbanBoard working card under reduced motion > keeps the working glyph and stops its pulse
Expected the element to have class:  animate-pulse motion-reduce:animate-none
Received:  lucide lucide-bot size-3.5 shrink-0 animate-pulse
      Tests  1 failed | 8 passed (9)

After the fix:

  • Guards: bunx vitest --run --project server tests/guards/reduced-motion-pulse.guard.test.ts tests/guards/turbo-inputs.guard.test.ts gives 2 files and 56 tests passed at eb1c83897.
  • Touched suites: bunx vitest --run --config vitest.ui.config.ts on kanban-board, task-indicators, task-indicators.repeat and document-history-dialog gives 4 files and 30 tests passed.
  • Importers: task-modal (access, draft, limits, repeat), tasks-list, and project-files-tab (both suites) give 7 files and 98 tests passed in jsdom. The *.browser.test.tsx suites were not run locally; CI runs them.
  • Lint: bunx oxlint --type-aware on the five changed TS files is clean.
  • Format: oxfmt --check is clean.
  • Manual gate: bun tools/lint-manual/cli.ts is ok.
  • Types: a scoped tsc over the changed files plus the platform's ambient types gives 2,927 files and exit 0. The whole-workspace tsc and bun run check were left to CI.

Closes #4128

The board card's "Agent is working…" glyph and the document history
dialog's loading placeholder were the two `animate-pulse` uses without a
reduced-motion stop; the other seven write `motion-reduce:animate-none`,
`motion-safe:animate-pulse` or a `prefersReducedMotion` check. Under
`prefers-reduced-motion: reduce` they still ran `pulse`, held to a single
0.01 ms iteration only by the global rule in `@tale/ui`'s stylesheet.

- The working glyph takes `motion-reduce:animate-none`, as
  `StatusIndicator`'s pulse does; it stays visible and stops.
- The history placeholder uses the shared `SKELETON_PULSE` fill.
- A guard walks every non-test `.ts`/`.tsx` under `services/platform/app`
  and `packages/ui/src` and fails on an `animate-pulse` class with none of
  the three opt-outs; the turbo inputs guard and the repo contract name it
  as a reader of `packages/ui/src`.
- The board test holds a working card to the glyph and its stop.

Closes #4128
The guard let any `&&` or ternary whose condition named reduced motion
through, whichever branch held the pulse, so
`prefersReducedMotion ? 'animate-pulse' : …` passed while it pulses only
for the people who asked for less motion. A pulse now opts out by a check
only on the branch reached without the preference: the right of a
`&&` chain holding `!reducedMotion`, the false branch of
`reducedMotion ? … : …`, the true branch of `!reducedMotion ? … : …`.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Closing this unmerged. This is the fleet manager (TALE-357, run 5dc45114), making the routine call the author asked for.

The reporter, agent #3, retracted the premise of #4128 after measuring origin/main 1ba77ed61 with a seeded live run (#4128 comment 5970303614).

  • Under prefers-reduced-motion: reduce: the working pulse resolves to 1e-05s and 1 iteration, and opacity stays at 1. The global rule in packages/ui/src/globals.css:763-773 already collapses every animation.
  • Under no-preference: it animates (2s, infinite).

This PR would only add an explicit opt-out and a guard for a case that already behaves correctly. Its exact head eb1c83897 was green, but it has no user-visible effect, and review capacity is the fleet's bottleneck today.

If the team later wants a lint rule for explicit opt-outs as house style, that belongs in its own issue.

@yannickmonney
yannickmonney deleted the fix/board-working-pulse-reduced-motion branch October 13, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(platform): the board's "Agent is working…" pulse keeps animating under reduced motion

1 participant