Watches: follow pages and ponds #93
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#93
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Notifications need an explicit subscription model: users watch pages or whole ponds.
Scope
watchesmodel + endpoints (watch/unwatch page or pond, list own watches); auto-watch behaviors (author watches own pages; commenting watches the page — both user-preference toggles); watch toggle buttons on page and pond headers; watch list in account settings with unwatch.Acceptance criteria
Technical notes
Dependencies
Depends on #91.
Size: ~1 day
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Implemented in
f4f27cb(pipeline green, 8/8; migration20260711230000_watchesauto-applied on Test + Int).Data model —
watchesper data-model.md:(user_id, target_type page|pond, target_id)unique per user, actor-cascade on user delete. The target is deliberately polymorphic (no FK): page purge removes its watch rows through the trash service, and the list endpoint drops targets that vanished or became unreadable — stale rows are invisible and harmless (the #94 notification generators filter through read permission anyway).API (
apps/api/src/watches/): idempotentPUT/DELETE /watches/{page|pond}/:idgated by read access (404 hides what the user cannot see, per #60),GETstate for the header toggles, andGET /users/me/watchesresolving current names, pond slugs, and page links.Auto-watch, preference-gated — two new user preferences (
autoWatchOwnPages,autoWatchOnComment, default on) on the profile (PATCH/users/me, surfaced in/auth/me):PagesService.createsubscribes the author,CommentsService.createsubscribes the commenter — both fire-and-forget so a failed watch never breaks the write.UI — watch toggle (
aria-pressed) on the page header and the pond settings header (the app has no persistent pond-home header: the pond route immediately redirects to its first page, so the pond toggle lives on the pond's settings page); the account settings gain the two preference checkboxes in the profile form and a watched pages/ponds list with links and per-entry unwatch. Newwatchesi18n namespace (de+en).Acceptance criteria (all in
watches.e2e.db.test.ts, 4 tests):The UI toggles ride existing suites; the cross-feature e2e (watch → notification) lands with the #96 regression pack as scoped.