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:
@@ -2,7 +2,7 @@ import { Ok, type ProblemDetails, type Result, type ShoppingListSummary } from '
|
||||
|
||||
import type { Database } from '@/lib/prisma'
|
||||
|
||||
import { toSummary } from '../serialize'
|
||||
import { summaryCountInclude, toSummary } from '../serialize'
|
||||
|
||||
/** Creates a shopping list owned by the user. The first list becomes primary. */
|
||||
export class CreateShoppingList {
|
||||
@@ -29,7 +29,7 @@ export class CreateShoppingList {
|
||||
},
|
||||
},
|
||||
include: {
|
||||
_count: { select: { members: true } },
|
||||
...summaryCountInclude,
|
||||
members: { where: { userId: input.userId } },
|
||||
},
|
||||
})
|
||||
@@ -44,6 +44,8 @@ export class CreateShoppingList {
|
||||
toSummary({
|
||||
role: membership.role,
|
||||
isPrimary: membership.isPrimary,
|
||||
isPinned: membership.isPinned,
|
||||
icon: membership.icon,
|
||||
list: {
|
||||
id: list.id,
|
||||
name: list.name,
|
||||
|
||||
Reference in New Issue
Block a user