Skip to content

fix(dashboard): Stop CSS motion under reduced motion and run e2e with it - #4026

Merged
dcramer merged 4 commits into
mainfrom
fix/dashboard-e2e-reduced-motion
Nov 22, 2026
Merged

dcramer merged 4 commits into
mainfrom
fix/dashboard-e2e-reduced-motion

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Browser journeys kept acting on UI that was still animating, transitioning, or scrolling. #3918, #3925, #3928, #3321, #3589, and #3984 each worked around this for one widget.

Under prefers-reduced-motion: reduce, one base-layer rule now stops every CSS transition, makes animations 0.01ms with one iteration, and turns off smooth scroll. Before, only components that remembered motion-reduce: stopped. People who ask for reduced motion get the same result.

Transitions are turned off, not shortened. A short transition-duration on * also applies to the default transition-property: all, so every style change becomes a transition, and code that measures right after a change reads the old value. Base UI waits on getAnimations(), so it does not need transitionend. Animations keep a short duration, so animationend still fires.

Playwright now emulates reduced motion for every dashboard journey through contextOptions.reducedMotion, because Playwright has no top-level reducedMotion option. Specs do not override it, and a new ast-grep rule enforces that. Motion is for visual QA.

via @dcramer.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 22, 2026 09:54
Reduced motion now stops every CSS transition, animation, and smooth
scroll in the dashboard, so a component cannot forget motion-reduce.
The dashboard e2e suite runs with reduced motion, so journeys act on UI
that has stopped moving. Tests of motion opt back in.

Co-Authored-By: David Cramer <[email protected]>
The touch test made its own browser context, so it skipped the mock reset,
the API stubs, and reduced motion that every other journey gets.
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 22, 2026 6:42pm UTC

Request Review

@dcramer
dcramer marked this pull request as ready for review November 22, 2026 18:22
@sentry-junior
sentry-junior Bot requested a review from dcramer November 22, 2026 18:22
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 22, 2026

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure writing motion tests into a spec is going to be effective or the right spend of our CI budget, let alone I don't like the idea of embedding this emulate media all over the place just to fix these tests

Motion-only checks read inline transform styles or slowed animations,
which says little about how motion looks. Delete them, run the rest only
under the reduced-motion default, and block reducedMotion overrides in
e2e with an ast-grep rule. Visual QA covers motion.

Co-Authored-By: David Cramer <[email protected]>
@sentry-junior

sentry-junior Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@dcramer Done (head a5b596a, merged with main):

  • Deleted the 6 motion-only tests: the 3 magnifier scale tests, "cards grow near the pointer", "an open ask holds its pull request still under the pointer", and the slowed-animation Snooze and Wake test.
  • The no-preference/reduce loops in inbox-motion.spec.ts and inbox-stacks.spec.ts are now one test each.
  • No spec sets reducedMotion now, and the new ast-grep rule e2e-no-reduced-motion-override blocks it under packages/junior-dashboard/e2e/**.
  • policies/testing.md now says e2e does not test motion, and visual QA covers it.

The global CSS rule and contextOptions.reducedMotion: "reduce" stay. inbox-motion.spec.ts keeps its name. main now has a test-architecture baseline keyed by file path, and its check forbids renames that move entries. So I only lowered the entries this change shrank.

…uced-motion

Co-Authored-By: David Cramer <[email protected]>

# Conflicts:
#	policies/testing.md
@dcramer
dcramer enabled auto-merge (squash) November 22, 2026 18:48
@dcramer
dcramer merged commit 2f6d5a2 into main Nov 22, 2026
56 checks passed
@dcramer
dcramer deleted the fix/dashboard-e2e-reduced-motion branch November 22, 2026 18:50

This branch was successfully deployed

1 active deployment
Preview – junior-docs — a5b596a5 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant