fix(web): smooth settings sidebar transitions#9811
1 unresolved thread · Jump to file
apps/web/src/components/settings/SettingsSidebarNav.tsx · Earlier revision ff220453 · right 119–137
Original diff
@@ -114,6 +116,27 @@ function SettingsSectionIcon({ to }: { to: SettingsPath }) {
return <Icon className="mt-0.5 size-3.5 shrink-0 text-sidebar-muted-foreground/60" />;
}
+function SettingsSubmenuCollapse({
+ open,
+ children,
+}: {
+ readonly open: boolean;
+ readonly children: ReactNode;
+}) {
+ return (
+ <div
+ aria-hidden={open ? undefined : true}
+ inert={open ? undefined : true}
+ className={cn(
+ "grid transition-[grid-template-rows] duration-150 ease-out motion-reduce:transition-none",
+ open ? "grid-rows-[1fr]" : "pointer-events-none grid-rows-[0fr]",
+ )}
+ >
+ <div className="min-h-0 overflow-hidden">{children}</div>
+ </div>
+ );apps/web/src/components/settings/SettingsSidebarNav.tsx · right 119–137
Shared primitives over custom controls: this hand-builds an open/close collapse (grid-rows transition, inert/aria-hidden, overflow wrapper) that Collapsible + CollapsiblePanel in apps/web/src/components/ui/collapsible.tsx already provide. Consider rendering <Collapsible open={isActive}><CollapsiblePanel>…</CollapsiblePanel></Collapsible> instead, and adding a variant/class there if the settings sidebar needs a different duration.
Posted via Macroscope — UI Consistency
Addressed in 5949f65: the sidebar wrapper now uses the shared Collapsible and CollapsiblePanel primitives, with only the settings-specific 150 ms, ease-out, and reduced-motion classes.