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:
@@ -0,0 +1,7 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "shopping_list_members" ADD COLUMN "icon" TEXT,
|
||||
ADD COLUMN "is_pinned" BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN "pinned_order" INTEGER;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "shopping_list_members_user_id_is_pinned_idx" ON "shopping_list_members"("user_id", "is_pinned");
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user