fix(webui): smooth sidebar collapse — no reflow, centered icons, pin button

The hover-rail flipped its content to a collapsed layout instantly while the
width animated, so on every expand/collapse icons jumped toward the top-left and
labels flashed in, wrapped super-tall, then settled — and the collapsed rail
leaked the first glyph of every label plus hard-clipped highlight bars.

Lay the rail content out at a fixed width and let the aside clip it: nothing
reflows during the width animation. Icons live in a fixed centered column (never
move); labels stay mounted with nowrap and just fade out when collapsed (no
wrap, no leak); the active pill and update banner render their background as an
absolute layer that becomes a centered squircle on the rail instead of a
hard-clipped bar.

Adds the promised pin toggle to the sidebar footer (desktop) — mirrors the
「钉住侧栏展开」 appearance setting: pinned keeps the rail open, unpinned returns
to hover-to-peek.
This commit is contained in:
DrSmoothl committed 2026-06-28 23:29:25 +08:00
1 parent 7ec74f2928
commit 5dc3ec88d4
2 files changed
+97 -52

No files matched your search

@@ -66,7 +66,13 @@ export function MainLayout({ status, onLogout, children }: MainLayoutProps) {
}}
className="relative h-full shrink-0 overflow-hidden"
>
<Sidebar collapsed={showCollapsed} />
{/* Fixed-width inner: the rail's content is ALWAYS laid out at the
expanded width and the aside simply clips it as `width` animates.
Nothing reflows during the transition, so icons never shift and
labels never wrap — they're revealed/clipped, not re-laid-out. */}
<div className="h-full w-[248px]">
<Sidebar collapsed={showCollapsed} />
</div>
</motion.aside>
)}