- pnpm 10 workspace + TypeScript strict + ESLint flat + Prettier - CLAUDE.md as canonical brief - docs/tasks/ — 22 task briefs broken out by phase for sub-sessions - docs/decisions/ — ADR scaffold Implements task 01 (repo-init).
2.0 KiB
2.0 KiB
11 — Lists module (shopping + task)
Goal
Implement the lists module supporting two list types out of the box (shopping, task), with the schema designed so additional types can be added later without migration.
Depends on
- 04, 07
Scope
Schema
lists:id,household_id,type(text — not an enum, to allow extension),name,archived,created_at.list_items:id,list_id,text,doneboolean,qtytext nullable,notestext nullable,due_attimestamptz nullable,assignee_idfk users nullable,positionint (for ordering),created_at,updated_at.
Seed: one default list of each type per household on first access (idempotent).
Server
listLists({ type? }),getList(id),createList,renameList,archiveList.addItem,toggleItem,updateItem,deleteItem,reorderItems.
UI
/listsindex showing all lists grouped by type./lists/[id]— fast keyboard-driven entry: focus stays in input, Enter adds, checkbox toggles, swipe-left (mobile) deletes.- Realtime: SSE subscription on the list id; updates from the other user appear without refresh. (Implementation detail: Postgres
LISTEN/NOTIFYchannellist:<id>; thin SSE route handler bridges it. Document the pattern indocs/decisions/.)
Manifest
- Entity type
lists.list(shareable read+write via share token),lists.item(not directly shareable; inherits via list). - Quick-adds: "Add to shopping", "Add to tasks" (each adds a single item to the default list of that type).
- Dashboard widget: top 5 unchecked shopping items + open tasks assigned to me.
Out of scope
- Reordering across lists.
- Per-item images.
- Recurring tasks (use reminders module later if needed).
Acceptance criteria
- Both default lists are auto-seeded.
- Adding an item on one device appears on the other within ~1s via SSE.
typeistextnotenum— adding a third type works without a migration.- Playwright: add item → check it off → archive list.