fix(sidebar): give sessions the spare height and cap the menu section

Sessions now fills the remaining sidebar height while the Menu section is
capped at 40% and scrolls internally. Menu rows use a denser variant of
SidebarItem, cutting each row from 44px to 32px.
This commit is contained in:
Chris Scott committed 2026-10-06 21:30:47 -04:00
1 parent a81c0becfa
commit f4d2221d46
2 files changed
+9 -5

No files matched your search

@@ -15,6 +15,7 @@ import {
SidebarItem,
} from '@/components/ui/sidebar'
import { FolderGit2 } from 'lucide-react'
import { cn } from '@/lib/utils'
const ACCOUNT_ITEM_KEYS = new Set(['settings', 'logout'])
@@ -110,7 +111,7 @@ export function DesktopSidebar() {
label="Sessions"
collapsed={!isSectionOpen('sessions')}
onToggle={() => toggleSection('sessions')}
className="border-t border-border"
className={cn('border-t border-border', isSectionOpen('sessions') && 'flex-1')}
>
<DesktopSessionTree />
</SidebarCollapsibleSection>
@@ -119,16 +120,17 @@ export function DesktopSidebar() {
label="Menu"
collapsed={!isSectionOpen('menu')}
onToggle={() => toggleSection('menu')}
className="flex-1 min-h-fit border-t border-border"
className={cn('border-t border-border', isSectionOpen('sessions') ? 'shrink-0 max-h-[40%]' : 'flex-1')}
contentClassName="overflow-y-auto"
>
<div className="flex flex-col gap-1 p-2 pt-0">
<div className="flex flex-col gap-0.5 p-2 pt-0">
{toolItems.map((item: MoreDrawerItem) => (
<SidebarItem
key={item.key}
icon={item.icon}
label={item.label}
collapsed={false}
dense
onClick={() => handleItemClick(item)}
danger={item.danger}
/>