mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Output of `node scripts/strip-planning-tags.mjs --write`: 3,157 comment lines in 1,308 files lose the work-item identifier at their head. Release versions and issue references stay; nothing outside comment text changes, which the script checks per file against a comment-free printout. healthlog/no-planning-tags is enabled at error level with this commit, so the tree it lands on is clean.
14 lines
606 B
TypeScript
14 lines
606 B
TypeScript
// v1.4.43 — single source of truth for `behavior` on the four
|
|
// programmatic `scrollIntoView` / `scrollTo` call-sites in the app.
|
|
// `prefers-reduced-motion: reduce` users were previously animated against
|
|
// their OS-level preference, which is a WCAG 2.3.3 violation. The helper
|
|
// returns `"auto"` whenever a window is unavailable (SSR) or when the
|
|
// reduced-motion media query matches.
|
|
|
|
export function scrollBehaviorForUser(): ScrollBehavior {
|
|
if (typeof window === "undefined") return "auto";
|
|
return window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
? "auto"
|
|
: "smooth";
|
|
}
|