Adds the admin-side surface for the Fase 18 list-title flow:
• `default_list_title` input — single line, save-on-blur (matches the
collective-name input shape from Fase 10.2). Optimistically patches
`currentCollective` so the next /lists modal prefill sees the value
without waiting for the realtime UPDATE to round-trip.
• Curated catalog list — one row per entry with an inline "Remove"
icon button. An "Add title" button opens a small modal (name input
+ Save) that calls `add_list_title` via the listTitles store.
Members see the whole section read-only — the input is `disabled`, the
"Add title" button is hidden, and a banner explains "Only admins can
curate these titles." Guests don't see the section at all (mirrors the
`canSeeCommonItems` gate from Fase 15).
The default-title `$effect` that mirrors `$currentCollective.default_list_title`
into the input draft is guarded against re-firing while the admin is
mid-edit — only sync when the input isn't focused — so realtime UPDATEs
from another tab don't clobber the unsaved edit.
E2E `tests/e2e/list-title-flow.test.ts` gains:
• LTF-02 — Ana adds the catalog prefix via the manage UI, sets the
default via the same UI, then drives the create-modal three times
and asserts the third list lands as `${prefix} #3`. Exercises the
full path: manage RPC → realtime/store update → modal auto-suffix
on submit → numbered list created.
• LTF-04 — Borja (member) opens manage, sees the section, no add
button, read-only banner visible, default-title input disabled.
Tests: 4 LTF e2e + 4 existing manage-collective e2e all green (8/8).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
7.8 KiB
7.8 KiB