Skip to content

Commit 104eadd

Browse files
committed
refactor(AppSidebar): improve layout and remove unused SidebarMenuBadge
1 parent 3cd87a5 commit 104eadd

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

apps/studio/src/components/app-sidebar.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {
4545
SidebarMenu,
4646
SidebarMenuButton,
4747
SidebarMenuItem,
48-
SidebarMenuBadge,
4948
SidebarMenuSkeleton,
5049
SidebarHeader,
5150
SidebarSeparator,
@@ -239,7 +238,7 @@ export function AppSidebar({
239238
<div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary text-primary-foreground">
240239
<SelectedPkgIcon className="h-4 w-4" />
241240
</div>
242-
<div className="flex flex-1 flex-col gap-0.5 leading-none overflow-hidden">
241+
<div className="flex flex-1 min-w-0 flex-col gap-0.5 leading-none overflow-hidden">
243242
<span className="truncate font-semibold text-sm">
244243
{selectedPackage ? (selectedPackage.manifest?.name || selectedPackage.manifest?.id) : 'ObjectStack'}
245244
</span>
@@ -327,8 +326,8 @@ export function AppSidebar({
327326
<SidebarGroup key={group.key}>
328327
<SidebarGroupLabel>
329328
<group.icon className="mr-1.5 h-3.5 w-3.5" />
330-
{group.label}
331-
<SidebarMenuBadge>{group.totalItems}</SidebarMenuBadge>
329+
<span className="flex-1 min-w-0 truncate">{group.label}</span>
330+
<span className="shrink-0 text-xs tabular-nums text-sidebar-foreground/50">{group.totalItems}</span>
332331
</SidebarGroupLabel>
333332
<SidebarGroupContent>
334333
<SidebarMenu>
@@ -350,9 +349,9 @@ export function AppSidebar({
350349
<CollapsibleTrigger asChild>
351350
<SidebarMenuButton tooltip={`${typeLabel} (${items.length})`}>
352351
<TypeIcon className="h-4 w-4" />
353-
<span className="truncate">{typeLabel}</span>
354-
<SidebarMenuBadge>{items.length}</SidebarMenuBadge>
355-
<ChevronRight className={`ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ${isExpanded ? 'rotate-90' : ''}`} />
352+
<span className="flex-1 min-w-0 truncate">{typeLabel}</span>
353+
<span className="shrink-0 text-xs tabular-nums text-muted-foreground">{items.length}</span>
354+
<ChevronRight className={`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ${isExpanded ? 'rotate-90' : ''}`} />
356355
</SidebarMenuButton>
357356
</CollapsibleTrigger>
358357
<CollapsibleContent>

0 commit comments

Comments
 (0)