Comments UI #92

Closed
opened 2026-07-04 14:52:50 +02:00 by fable-5 · 1 comment
Collaborator

Context

The reading/writing surface for page discussions.

Scope

Comments panel on the page (read mode; toggleable): threaded display with relative times and author names, composer with Markdown hints, edit/delete own, resolve with collapsed-resolved section, unread indication per page (since last visit, localStorage-based), pond setting UI for 'who may comment'.

Acceptance criteria

  • full comment lifecycle in e2e with two users
  • resolve collapses the thread; unresolve restores it
  • permission variants render correctly (composer hidden for not-allowed users with a hint)
  • panel is keyboard-accessible and localized

Technical notes

  • ADR 0012.

Dependencies

Depends on #91.

Size: ~1.5 days


Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add de and en), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.

## Context The reading/writing surface for page discussions. ## Scope Comments panel on the page (read mode; toggleable): threaded display with relative times and author names, composer with Markdown hints, edit/delete own, resolve with collapsed-resolved section, unread indication per page (since last visit, localStorage-based), pond setting UI for 'who may comment'. ## Acceptance criteria - [ ] full comment lifecycle in e2e with two users - [ ] resolve collapses the thread; unresolve restores it - [ ] permission variants render correctly (composer hidden for not-allowed users with a hint) - [ ] panel is keyboard-accessible and localized ## Technical notes - ADR 0012. ## Dependencies Depends on #91. **Size**: ~1.5 days --- *Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add `de` **and** `en`), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.*
fable-5 added this to the M9 — Comments & notifications milestone 2026-07-04 14:52:50 +02:00
fable-5 added the
frontend
label 2026-07-04 14:52:50 +02:00
Author
Collaborator

Implemented in e54aaf7 + fixes c7d3b20/30992a2 (pipeline green, 8/8).

Comments panel (apps/web/src/comments/, toggle next to the attachments button on every page): threaded display with author names and relative times (Intl.RelativeTimeFormat in the UI language), a Markdown composer with a hint line, per-thread reply composers, inline edit with an "(edited)" marker, delete for authors, and resolve moving the thread into a collapsed <details> "Resolved (n)" section with a reopen action — native disclosure/​form semantics keep the whole panel keyboard-accessible; texts live in the new comments namespace (de+en).

Unread badge — the toggle shows "n new" counting comments newer than the last panel visit and not authored by the viewer; purely localStorage-based per page, opening the panel marks it seen.

Permission-aware composerreaders policy: everyone who can see the page composes; editors: only when the collab token explicitly granted rw (conservative while it resolves). Barred viewers get a hint instead of the composer; reading always works.

Pond setting UI — "Who may comment" select in the pond settings (pond admins), riding the pond PATCH. This surfaced a real bug: PondsService.update silently dropped commentPolicy from the settings merge (the #91 DB test had set the policy via Prisma directly). Fixed; the DB test now goes through the real PATCH.

Acceptance criteria — Playwright pack comments.spec.ts (own CI step):

  • full lifecycle with two users — fixture-editor (reader) opens a thread, fixture-user replies, resolves, reopens, edits and deletes the reply; the reader deletes their root; the unread badge is asserted on the owner's first visit.
  • resolve collapses, unresolve restores — body hidden until the resolved section is opened; reopen returns the thread to the open list.
  • permission variantseditors policy: hint visible, composer absent for the reader.
  • keyboard-accessible + localized — native elements throughout, all strings from the i18n catalog (language-tolerant selectors in the pack).

CI lessons (two red runs): the pack must not share the fixture pond — earlier packs in the same job leave grants there, so it provisions its own pond (via the seeded additional-pond headroom; never lower that override — CI's accumulated fixture ponds count against it).

Implemented in `e54aaf7` + fixes `c7d3b20`/`30992a2` (pipeline green, 8/8). **Comments panel** (`apps/web/src/comments/`, toggle next to the attachments button on every page): threaded display with author names and relative times (`Intl.RelativeTimeFormat` in the UI language), a Markdown composer with a hint line, per-thread reply composers, inline edit with an "(edited)" marker, delete for authors, and resolve moving the thread into a **collapsed `<details>` "Resolved (n)" section** with a reopen action — native disclosure/​form semantics keep the whole panel keyboard-accessible; texts live in the new `comments` namespace (de+en). **Unread badge** — the toggle shows "n new" counting comments newer than the last panel visit and not authored by the viewer; purely localStorage-based per page, opening the panel marks it seen. **Permission-aware composer** — `readers` policy: everyone who can see the page composes; `editors`: only when the collab token explicitly granted `rw` (conservative while it resolves). Barred viewers get a hint instead of the composer; reading always works. **Pond setting UI** — "Who may comment" select in the pond settings (pond admins), riding the pond PATCH. This surfaced a real bug: **`PondsService.update` silently dropped `commentPolicy` from the settings merge** (the #91 DB test had set the policy via Prisma directly). Fixed; the DB test now goes through the real PATCH. **Acceptance criteria** — Playwright pack `comments.spec.ts` (own CI step): - *full lifecycle with two users* — fixture-editor (reader) opens a thread, fixture-user replies, resolves, reopens, edits and deletes the reply; the reader deletes their root; the unread badge is asserted on the owner's first visit. - *resolve collapses, unresolve restores* — body hidden until the resolved section is opened; reopen returns the thread to the open list. - *permission variants* — `editors` policy: hint visible, composer absent for the reader. - *keyboard-accessible + localized* — native elements throughout, all strings from the i18n catalog (language-tolerant selectors in the pack). **CI lessons (two red runs):** the pack must not share the fixture pond — earlier packs in the same job leave grants there, so it provisions its own pond (via the seeded additional-pond headroom; never lower that override — CI's accumulated fixture ponds count against it).
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stwaidele/dorfteich#92
No description provided.