You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Area: SharedCross-tier packages (schemas, react-core, etc.) not covered by another areaArea: Webapps/web (clinician-facing React SPA)Difficulty: MediumStraightforward change, about a day or lessEnhancementType: an improvement to an existing feature, including performancePriority: LowNice to have, cosmetic or speculative
Still unimplemented on main (d86740e). Nothing in apps/web, apps/gateway, apps/playground or packages/react-core reads prefers-reduced-motion. The only match is the Interactive-With-React example instrument's App.css.
What animates, and what reaches it
motion/react 13.4.4 in app code.InstrumentShowcase.tsx:129-136 (cards rise 80 px on a 1.5 s spring), WalkthroughProvider.tsx:463-467 (the popover glides to each target), start-session.tsx:65-71 (scale 0.5 to 1), ToggledContent.tsx:25-28 (height), the playground Editor.tsx:88-91 (sidebar width), and the layout lists in dashboard.tsx and admin/instrument-repos/index.tsx. <MotionConfig reducedMotion="user"> covers all of these. In motion-dom 13.4.4 it makes transforms, width/height/top/left/right/bottom and layout animations instant, and keeps opacity fades.
CSS. libui's Dialog, Popover, Select, DropdownMenu and Tooltip use tw-animate-csszoom-in-95/slide-in-from-*, and the mobile nav Sheet (Navbar.tsx:39) slides in from the right over 500 ms. tw-animate-css 1.4.0 has no reduced-motion rule. The hover scales at dashboard.tsx:165,172,229,240,251,258,327,334 and InstrumentCard.tsx:139 are plain Tailwind. MotionConfig reaches none of this.
libui's own motion components. libui 6.16.1 depends on motion ^11.18.2, which pnpm resolves to a separate motion@11.18.2 copy. That copy has its own React context, so an app-level MotionConfig does not reach NotificationHub, DatePicker/Calendar (x/y slides) or the password strength bar.
Explicit smooth scrolling.scrollIntoView({ behavior: 'smooth' }) at InstrumentShowcase.tsx:65 and GroupEmailTemplates/CreateTemplateForm.tsx:38. Neither MotionConfig nor a stylesheet overrides an explicit behavior.
There is a trap in 3. NotificationHub dismisses each toast in onAnimationComplete of a width 0% to 100% bar timed to the timeout. Under reduced motion width jumps straight to 100%, so every toast would vanish as it appears. libui 6.18.0, the latest release, still does this. libui has to move dismissal onto a timer before it puts MotionConfig in CoreProvider.
These need nothing. useSpring (UploadProgressBar.tsx:12, libui StatisticCard) ignores MotionConfig, but it only smooths a number or a bar. Interactive instruments run in their own iframe (InteractiveContent.tsx:175) without the host's CSS, so none of this changes a task's stimulus timing. The recharts <Area>/<Line> draw-in (1.5 s) ignores the setting in recharts 2.15.4, but recharts 3.10.1, which #1660 brings in, defaults isAnimationActive to 'auto' and skips the animation under reduced motion.
Plan
In react-core, add a MotionPreferenceProvider (<MotionConfig reducedMotion="user">) and export it from src/index.ts. Render it inside CoreProvider in apps/web/src/routes/__root.tsx, apps/gateway/src/Root.tsx, apps/playground/src/App.tsx and apps/playground/src/preview/main.tsx; the preview frame is a separate React root. Because it lives in react-core, the gateway needs no direct motion dependency. Placing it inside CoreProvider also keeps NotificationHub outside it if libui ever shares the app's motion copy.
In packages/react-core/src/globals.css, add an unlayered @media (prefers-reduced-motion: reduce) block that resets --tw-enter-translate-x/-y, --tw-enter-scale, --tw-enter-rotate and their --tw-exit-* counterparts to identity on *, ::before, ::after. Unlayered rules beat Tailwind's utilities layer, so this overrides the libui classes while the fades still run. Avoid the usual animation-duration: 0.01ms !important reset: it would freeze animate-spin and libui's animate-spinner, which are the only loading signal. Rewrite the "three directives" line in packages/react-core/AGENTS.md in the same commit; the color-scheme rules already made it stale.
Prefix the hover scales listed above with motion-safe:.
Pass behavior: useReducedMotionConfig() ? 'auto' : 'smooth' to both scrollIntoView calls. That hook reads the provider, so the preference stays in one place.
Upstream in libui: timer-based dismissal, then MotionConfig in CoreProvider. Steps 1-4 do not wait on this.
I would follow the OS setting only. An in-app toggle could come later through the same provider.
Tests
Unit: packages/react-core/src/components/MotionPreferenceProvider/__tests__/MotionPreferenceProvider.test.tsx renders a probe that reads useContext(MotionConfigContext).reducedMotion and expects 'user'. Do not assert through an animation: motion caches the media query in a module singleton on first mount, and the shared skipAnimations setup file Upgrade happy-dom past 20.11, whose Element.animate leaks unhandled rejections #1621 proposes would make everything instant anyway. Extend apps/web/src/routes/__tests__/__root.test.tsx and apps/gateway/src/__tests__/Root.test.tsx with the same probe. In InstrumentShowcase.test.tsx and CreateTemplateForm.test.tsx, render under <MotionConfig reducedMotion="always"> and expect scrollIntoView to receive behavior: 'auto'.
e2e: a new testing/src/specs/reduced-motion.spec.ts with test.use({ reducedMotion: 'reduce' }).
On /instruments/accessible-instruments, li[data-instrument-index="2"] reaches transform: none within a 250 ms toHaveCSS timeout. Without the fix, its 0.3 s delay and 1.5 s spring keep it offset well past that.
The dashboard users dialog (dashboard-users-Modal-dialog) has --tw-enter-scale of 1.
A no-preference case for the same dialog shows that the reset only applies under the media query.
#1819 edits only the trend chart legend in dashboard.tsx, so it does not conflict. #1810 edits CreateTemplateForm.tsx close to the scrollIntoView call, so land step 4 after it. No other open PR touches these files.
Triage note written with Claude Code. Code references point at main @ d86740e.
Area: SharedCross-tier packages (schemas, react-core, etc.) not covered by another areaArea: Webapps/web (clinician-facing React SPA)Difficulty: MediumStraightforward change, about a day or lessEnhancementType: an improvement to an existing feature, including performancePriority: LowNice to have, cosmetic or speculative
Activity
[-]Respect prefers-reduced-motion[/-][+][Enhancement]: Respect prefers-reduced-motion[/+][-][Enhancement]: Respect prefers-reduced-motion[/-][+]Respect prefers-reduced-motion[/+]joshunrau commentedon Oct 26, 2026
Still unimplemented on
main(d86740e). Nothing inapps/web,apps/gateway,apps/playgroundorpackages/react-corereadsprefers-reduced-motion. The only match is theInteractive-With-Reactexample instrument'sApp.css.What animates, and what reaches it
motion/react13.4.4 in app code.InstrumentShowcase.tsx:129-136(cards rise 80 px on a 1.5 s spring),WalkthroughProvider.tsx:463-467(the popover glides to each target),start-session.tsx:65-71(scale 0.5 to 1),ToggledContent.tsx:25-28(height), the playgroundEditor.tsx:88-91(sidebar width), and thelayoutlists indashboard.tsxandadmin/instrument-repos/index.tsx.<MotionConfig reducedMotion="user">covers all of these. In motion-dom 13.4.4 it makes transforms,width/height/top/left/right/bottomand layout animations instant, and keeps opacity fades.tw-animate-csszoom-in-95/slide-in-from-*, and the mobile navSheet(Navbar.tsx:39) slides in from the right over 500 ms.tw-animate-css1.4.0 has no reduced-motion rule. The hover scales atdashboard.tsx:165,172,229,240,251,258,327,334andInstrumentCard.tsx:139are plain Tailwind.MotionConfigreaches none of this.motion ^11.18.2, which pnpm resolves to a separatemotion@11.18.2copy. That copy has its own React context, so an app-levelMotionConfigdoes not reachNotificationHub,DatePicker/Calendar(x/y slides) or the password strength bar.scrollIntoView({ behavior: 'smooth' })atInstrumentShowcase.tsx:65andGroupEmailTemplates/CreateTemplateForm.tsx:38. NeitherMotionConfignor a stylesheet overrides an explicitbehavior.There is a trap in 3.
NotificationHubdismisses each toast inonAnimationCompleteof awidth0% to 100% bar timed to the timeout. Under reduced motionwidthjumps straight to 100%, so every toast would vanish as it appears. libui 6.18.0, the latest release, still does this. libui has to move dismissal onto a timer before it putsMotionConfiginCoreProvider.These need nothing.
useSpring(UploadProgressBar.tsx:12, libuiStatisticCard) ignoresMotionConfig, but it only smooths a number or a bar. Interactive instruments run in their own iframe (InteractiveContent.tsx:175) without the host's CSS, so none of this changes a task's stimulus timing. The recharts<Area>/<Line>draw-in (1.5 s) ignores the setting in recharts 2.15.4, but recharts 3.10.1, which #1660 brings in, defaultsisAnimationActiveto'auto'and skips the animation under reduced motion.Plan
MotionPreferenceProvider(<MotionConfig reducedMotion="user">) and export it fromsrc/index.ts. Render it insideCoreProviderinapps/web/src/routes/__root.tsx,apps/gateway/src/Root.tsx,apps/playground/src/App.tsxandapps/playground/src/preview/main.tsx; the preview frame is a separate React root. Because it lives in react-core, the gateway needs no directmotiondependency. Placing it insideCoreProvideralso keepsNotificationHuboutside it if libui ever shares the app's motion copy.packages/react-core/src/globals.css, add an unlayered@media (prefers-reduced-motion: reduce)block that resets--tw-enter-translate-x/-y,--tw-enter-scale,--tw-enter-rotateand their--tw-exit-*counterparts to identity on*, ::before, ::after. Unlayered rules beat Tailwind'sutilitieslayer, so this overrides the libui classes while the fades still run. Avoid the usualanimation-duration: 0.01ms !importantreset: it would freezeanimate-spinand libui'sanimate-spinner, which are the only loading signal. Rewrite the "three directives" line inpackages/react-core/AGENTS.mdin the same commit; thecolor-schemerules already made it stale.motion-safe:.behavior: useReducedMotionConfig() ? 'auto' : 'smooth'to bothscrollIntoViewcalls. That hook reads the provider, so the preference stays in one place.MotionConfiginCoreProvider. Steps 1-4 do not wait on this.I would follow the OS setting only. An in-app toggle could come later through the same provider.
Tests
packages/react-core/src/components/MotionPreferenceProvider/__tests__/MotionPreferenceProvider.test.tsxrenders a probe that readsuseContext(MotionConfigContext).reducedMotionand expects'user'. Do not assert through an animation: motion caches the media query in a module singleton on first mount, and the sharedskipAnimationssetup file Upgrade happy-dom past 20.11, whose Element.animate leaks unhandled rejections #1621 proposes would make everything instant anyway. Extendapps/web/src/routes/__tests__/__root.test.tsxandapps/gateway/src/__tests__/Root.test.tsxwith the same probe. InInstrumentShowcase.test.tsxandCreateTemplateForm.test.tsx, render under<MotionConfig reducedMotion="always">and expectscrollIntoViewto receivebehavior: 'auto'.testing/src/specs/reduced-motion.spec.tswithtest.use({ reducedMotion: 'reduce' })./instruments/accessible-instruments,li[data-instrument-index="2"]reachestransform: nonewithin a 250 mstoHaveCSStimeout. Without the fix, its 0.3 s delay and 1.5 s spring keep it offset well past that.dashboard-users-Modal-dialog) has--tw-enter-scaleof1.no-preferencecase for the same dialog shows that the reset only applies under the media query.#1819 edits only the trend chart legend in
dashboard.tsx, so it does not conflict. #1810 editsCreateTemplateForm.tsxclose to thescrollIntoViewcall, so land step 4 after it. No other open PR touches these files.Triage note written with Claude Code. Code references point at
main@d86740e.