feat(lists): pin lists with an icon and a live pending badge

Each member can pin up to four lists and pick an icon for them (per-user
settings on shopping_list_members, PATCH /api/lists/:listId/preferences).
Pinned lists stay visible with their pending count, kept live over each
list's SSE stream: a chip bar above the bottom nav on mobile and a "Fijadas"
group in the sidebar on desktop. GET /api/lists now returns pendingCount,
isPinned and icon.

The page padding, install prompt and dictation button now read
--bottom-nav-height, which grows with the pinned bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-25 09:24:13 -03:00
parent dd9cf4ce43
commit b9c6ab92e3
28 changed files with 965 additions and 49 deletions

View File

@@ -168,11 +168,18 @@ model ShoppingListMember {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
role ListRole @default(collaborator)
isPrimary Boolean @default(false) @map("is_primary")
/// Per user: the list is pinned to the always-visible bar (at most 4 per user).
isPinned Boolean @default(false) @map("is_pinned")
/// Position among the user's pinned lists (pin order); null when not pinned.
pinnedOrder Int? @map("pinned_order")
/// Per user: key of the icon chosen for the list (see `LIST_ICONS` in `@superlist/shared`).
icon String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@unique([listId, userId])
@@index([userId, isPrimary])
@@index([userId, isPinned])
@@map("shopping_list_members")
}