feat: show book counts per library and lens in sidebar

This commit is contained in:
neon
2026-02-01 15:17:09 -06:00
parent 738b9b6146
commit 33208254d9
7 changed files with 42 additions and 5 deletions
+6
View File
@@ -113,6 +113,9 @@ onMounted(() => {
<span :class="activeLibraryId === lib.id ? 'font-medium text-sidebar-foreground' : 'text-sidebar-foreground/70'">
{{ lib.name }}
</span>
<span v-if="lib.bookCount !== undefined" class="ml-auto shrink-0 rounded-full bg-sidebar-foreground/10 px-2 py-0.5 text-xs tabular-nums text-sidebar-foreground/70 group-data-[collapsible=icon]:hidden">
{{ lib.bookCount.toLocaleString() }}
</span>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
@@ -146,6 +149,9 @@ onMounted(() => {
<span :class="activeLensId === lens.id ? 'font-medium text-sidebar-foreground' : 'text-sidebar-foreground/70'">
{{ lens.name }}
</span>
<span v-if="lens.bookCount !== undefined" class="ml-auto shrink-0 rounded-full bg-sidebar-foreground/10 px-2 py-0.5 text-xs tabular-nums text-sidebar-foreground/70 group-data-[collapsible=icon]:hidden">
{{ lens.bookCount.toLocaleString() }}
</span>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem v-if="lenses.length === 0">
@@ -10,6 +10,7 @@ export interface Lens {
filter: GroupRule | null
defaultSort: SortSpec[]
isPublic: boolean
bookCount?: number
createdAt: string
updatedAt: string
}