Repository navigation
Closed
Labels
Description
Problem
The sidebar collapse toggle is currently the bottom-most element of the sidebar (below the user-profile row) and styled as a centered icon-only button with its own top border:
web/src/components/layout/sidebar.tsx:181-189
<div className="border-t p-2">
<Button variant="ghost" size="icon" className="mt-1 w-full" onClick={toggleCollapse}>
{isCollapsed ? <PanelLeftOpen className="h-4 w-4" /> : <PanelLeftClose className="h-4 w-4" />}
</Button>
</div>Two things to clean up:
- Position — the profile row is the natural "you are here" footer of the sidebar; the collapse toggle is chrome and should sit above it, not below.
- Visual weight — the bordered, full-width, centered icon button reads as a third nav surface rather than a small utility. A left-aligned ghost button with no top border blends in with the rest of the nav stack.
Proposed change
In sidebar.tsx:
- Swap the order: collapse-toggle container goes above the user-profile container.
- Drop the top border on the collapse-toggle container (
border-t p-2→p-2). The profile row below keeps itsborder-t, which gives the footer a single visual seam in the right place. - Restyle the button: use the regular
ghostvariant (notsize="icon"),h-9 w-fullwithjustify-startin the expanded state andjustify-centeronly when the sidebar is collapsed. Same height + horizontal rhythm as the nav rows above. - Swap the icons:
PanelLeftClose/PanelLeftOpen→ChevronsLeft/ChevronsRightfrom lucide-react. The chevrons map more directly to "shrink ←" / "expand →" and matches the visual register the user mentioned. Update the import block accordingly.
Reference diff
- import { Crown, Lock, PanelLeftClose, PanelLeftOpen } from 'lucide-react';
+ import { ChevronsLeft, ChevronsRight, Crown, Lock } from 'lucide-react';
- <div className="border-t p-2">
- <UserProfileNavItem collapsed={isCollapsed} />
- </div>
-
- <div className="border-t p-2">
- <Button variant="ghost" size="icon" className="mt-1 w-full" onClick={toggleCollapse}>
- {isCollapsed ? (
- <PanelLeftOpen className="h-4 w-4" />
- ) : (
- <PanelLeftClose className="h-4 w-4" />
- )}
- </Button>
- </div>
+ <div className="p-2">
+ <Button
+ variant="ghost"
+ onClick={toggleCollapse}
+ className={cn(
+ 'flex h-9 w-full items-center gap-2 px-2',
+ isCollapsed ? 'justify-center' : 'justify-start',
+ )}
+ >
+ {isCollapsed ? (
+ <ChevronsRight className="h-4 w-4" />
+ ) : (
+ <ChevronsLeft className="h-4 w-4" />
+ )}
+ </Button>
+ </div>
+
+ <div className="border-t p-2">
+ <UserProfileNavItem collapsed={isCollapsed} />
+ </div>Acceptance criteria
- Collapse toggle renders above the user-profile row in both expanded and collapsed sidebar states.
- No top border on the toggle container; profile row still has its
border-t. - In expanded mode the chevron sits at the left edge of the row; in collapsed mode it stays centered.
- Clicking the button toggles collapse exactly as before — store action is unchanged.
-
yarn tsc --noEmitandyarn lintclean.
Out of scope
- Hiding the toggle on mobile / reworking mobile nav.
- Persisting collapse state anywhere new — keep using the existing sidebar store.
- Reworking the user-profile row itself.
Activity
ux(sidebar): move collapse toggle above profile row + restyle (ansvis…