From 9a896bb5f6fc61e2161d1b228411aa04e91de6ce Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Wed, 10 Jun 2026 13:38:37 +0200 Subject: [PATCH] fix(web): honor prefers-reduced-motion; contain overscroll in modal surfaces (#71) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing in the app respected prefers-reduced-motion — the kit's data-open/closed animations, the skeleton pulse, and the sidebar width transition all ran unconditionally. Add a global base-layer rule that collapses animation/transition durations to a single frame when the OS asks for reduced motion; one rule covers current and future additions. Add overscroll-y-contain to the scrollable modal/popup surfaces (DrawerContent, SelectContent, ComboboxPopup) so flicking past the end of their content no longer chain-scrolls the page beneath, and to AlertDialogContent for when it gains scrollable content. Verified in the built CSS: the media query and overscroll-behavior-y:contain both compile into dist/assets. Closes #71 Co-Authored-By: Claude Opus 4.8 --- web/src/components/ui/alert-dialog.tsx | 2 +- web/src/components/ui/combobox.tsx | 2 +- web/src/components/ui/drawer.tsx | 2 +- web/src/components/ui/select.tsx | 2 +- web/src/index.css | 13 +++++++++++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/web/src/components/ui/alert-dialog.tsx b/web/src/components/ui/alert-dialog.tsx index ead776d..f4cdeee 100644 --- a/web/src/components/ui/alert-dialog.tsx +++ b/web/src/components/ui/alert-dialog.tsx @@ -50,7 +50,7 @@ function AlertDialogContent({ data-slot="alert-dialog-content" data-size={size} className={cn( - "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", + "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 overscroll-y-contain rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )} {...props} diff --git a/web/src/components/ui/combobox.tsx b/web/src/components/ui/combobox.tsx index 1f677ec..16c9b6b 100644 --- a/web/src/components/ui/combobox.tsx +++ b/web/src/components/ui/combobox.tsx @@ -62,7 +62,7 @@ function ComboboxPopup({ className, ...props }: ComboboxPrimitive.Popup.Props) {