feat(library): anonymous seed-lesson SSR detail (share funnel last step) #87

Merged
KnallerKalle merged 4 commits from fix/library-public-detail into dev 2026-08-18 22:19:15 +00:00
KnallerKalle commented 2026-08-16 18:38:46 +00:00 (Migrated from github.com)

Plan

Anonyme Besucher (Landing-Card, Share-Link) laufen auf /[locale]/library/[id] in ein Dead-End: SSR zeigt nur "Lektion wird geladen…", der Client-Fallback /api/lessons/list 401t, dann "nicht gefunden". Die Lektion muss ohne Konto les- und hörbar sein; OG-Preview muss den echten Titel zeigen, ohne den Per-User-Store zu lesen.

Outcome

Neuaufbau der PR-#87-Linie auf aktuellem dev (alter Branch: 27+ Commits Drift, Konflikt mit inzwischen gemergtem #85):

  • page.tsx: SSR via getPublicSeedLessonDetail (Allowlist-Projektion, nie PersistentMap/User-Store) + initialLesson-Prop
  • LessonDetailClient: initialLesson + isReadOnly — per-user Flächen versteckt (Edit/Delete/Share/Favorit, Status-Writes, Notizen, Voice-Settings), Play-Button bleibt (anonym hören via public audio URL; Produkt-Entscheidung auf #85-Basis)
  • Autonomie-freundliche Anmelde-Einladung (anon_invite/anon_sign_in, 9 Locales)
  • /api/lessons/[id]: Volltext statt Preview

Impact

Share-Funnel erstmals komplett: Landing-Card → lesbare + hörbare Lektion in Session 1, ohne Login-Wall. Blackbox +6 Checks (Test 27, 113→119), Unit +13 (411→424). OG-Privacy: User-Lektionen erscheinen nie in anonymen Metadaten.

Blackbox

  • rot auf testing bewiesen (114/119; 27a/b/c/d/e rot = die Diagnose)
  • lokal prod-build: Test 27 voll grün; 93/102 — alle 9 Rot = dokumentierte Sandbox-Baseline
  • Unit 424/424 (45→48 Dateien), tsc clean, prod build grün
  • Hinweis: account-weiter GitHub-Actions-Billing-Fehler macht CI seit ~17:33 nutzlos (auch auf dev HEAD); lokales Äquivalent (npm ci → test → build) grün

Six-perspectives check

  • Product: Aha-Moment (Lektion hören) in Session 1, kein Login-Wall
  • Engineering: Allowlist-Projektion; minimaler diff auf dev-Basis; Tests decken Anonym- und Authed-Pfad ab
  • Psychology: Einladung statt Druck ("wenn du möchtest"), keine Streak/Guilt-Mechanik
  • Biomechanics: Cue-Texte unverändert
  • Anatomy: unverändert
  • Feldenkrais: kein Urteil, keine Korrektur — Lesen und Hören frei

Risk

Authed-Pfad unverändert (isReadOnly löst sich bei Store-Hit auf, Test pinnt es); Rollback = Revert, keine Migration. Residual: testing rot bis Deploy (erwarteter Pre-Deploy-Zustand).

Checklist

  • Branch auf neuestem dev aufgebaut
  • Conventional Commits (test → feat → docs)
  • Patchlog angehängt
  • Roadmap aktualisiert
  • Keine Secrets / Binaries
## Plan Anonyme Besucher (Landing-Card, Share-Link) laufen auf `/[locale]/library/[id]` in ein Dead-End: SSR zeigt nur "Lektion wird geladen…", der Client-Fallback `/api/lessons/list` 401t, dann "nicht gefunden". Die Lektion muss ohne Konto les- und hörbar sein; OG-Preview muss den echten Titel zeigen, ohne den Per-User-Store zu lesen. ## Outcome Neuaufbau der PR-#87-Linie auf aktuellem dev (alter Branch: 27+ Commits Drift, Konflikt mit inzwischen gemergtem #85): - `page.tsx`: SSR via `getPublicSeedLessonDetail` (Allowlist-Projektion, nie `PersistentMap`/User-Store) + `initialLesson`-Prop - `LessonDetailClient`: `initialLesson` + `isReadOnly` — per-user Flächen versteckt (Edit/Delete/Share/Favorit, Status-Writes, Notizen, Voice-Settings), Play-Button bleibt (anonym hören via public audio URL; Produkt-Entscheidung auf #85-Basis) - Autonomie-freundliche Anmelde-Einladung (`anon_invite`/`anon_sign_in`, 9 Locales) - `/api/lessons/[id]`: Volltext statt Preview ## Impact Share-Funnel erstmals komplett: Landing-Card → lesbare + hörbare Lektion in Session 1, ohne Login-Wall. Blackbox +6 Checks (Test 27, 113→119), Unit +13 (411→424). OG-Privacy: User-Lektionen erscheinen nie in anonymen Metadaten. ## Blackbox - [x] rot auf testing bewiesen (114/119; 27a/b/c/d/e rot = die Diagnose) - [x] lokal prod-build: Test 27 voll grün; 93/102 — alle 9 Rot = dokumentierte Sandbox-Baseline - [x] Unit 424/424 (45→48 Dateien), tsc clean, prod build grün - Hinweis: account-weiter GitHub-Actions-Billing-Fehler macht CI seit ~17:33 nutzlos (auch auf dev HEAD); lokales Äquivalent (npm ci → test → build) grün ## Six-perspectives check - [x] Product: Aha-Moment (Lektion hören) in Session 1, kein Login-Wall - [x] Engineering: Allowlist-Projektion; minimaler diff auf dev-Basis; Tests decken Anonym- und Authed-Pfad ab - [x] Psychology: Einladung statt Druck ("wenn du möchtest"), keine Streak/Guilt-Mechanik - [x] Biomechanics: Cue-Texte unverändert - [x] Anatomy: unverändert - [x] Feldenkrais: kein Urteil, keine Korrektur — Lesen und Hören frei ## Risk Authed-Pfad unverändert (`isReadOnly` löst sich bei Store-Hit auf, Test pinnt es); Rollback = Revert, keine Migration. Residual: testing rot bis Deploy (erwarteter Pre-Deploy-Zustand). ## Checklist - [x] Branch auf neuestem dev aufgebaut - [x] Conventional Commits (test → feat → docs) - [x] Patchlog angehängt - [x] Roadmap aktualisiert - [x] Keine Secrets / Binaries
KnallerKalle (Migrated from github.com) reviewed 2026-08-16 18:42:32 +00:00
KnallerKalle (Migrated from github.com) left a comment

Verdict: P2 — Self-review, requesting human review.

Self-review against the P0–P3 rubric:

  • P0: none. No red tests introduced — vitest 226/226 green, next build exit 0, tsc --noEmit clean. The single red blackbox check ("Lesson audio field present") is pre-existing on testing and belongs to open #85. No Feldenkrais-principle violations (no correction/judgement language; logged-out copy is neutral and open-ended). No push to dev/main.
  • P1: none. Patchlog entry and roadmap tick included in-branch. Scope kept to one deliverable. Allowlist projection means new Lesson fields cannot leak anonymously.
  • P2 (accepted, non-blocking): audio_url is duplicated from #85's helper rather than imported, deliberately — importing it would break the build on current dev since that export lands with #85. The two are byte-identical and trivially converge on merge.
  • P3: none.

Blackbox: 12/13 on testing (unchanged; single red pre-existing, owned by #85).
Roadmap impact: "Lessons catalog & seed" [~] → [x].

One convergence note for the reviewer: this PR and #85 both emit audio_url on lesson payloads — this one on the detail projection, #85 on the catalog + audio route. They are intentionally contract-identical, so merging in either order is safe.

This review was created by an AI agent (OpenHands) on behalf of the ATM team.

**Verdict: P2 — Self-review, requesting human review.** Self-review against the P0–P3 rubric: - **P0:** none. No red tests introduced — vitest 226/226 green, `next build` exit 0, `tsc --noEmit` clean. The single red blackbox check ("Lesson audio field present") is pre-existing on testing and belongs to open #85. No Feldenkrais-principle violations (no correction/judgement language; logged-out copy is neutral and open-ended). No push to `dev`/`main`. - **P1:** none. Patchlog entry and roadmap tick included in-branch. Scope kept to one deliverable. Allowlist projection means new `Lesson` fields cannot leak anonymously. - **P2 (accepted, non-blocking):** `audio_url` is duplicated from #85's helper rather than imported, deliberately — importing it would break the build on current `dev` since that export lands with #85. The two are byte-identical and trivially converge on merge. - **P3:** none. Blackbox: 12/13 on testing (unchanged; single red pre-existing, owned by #85). Roadmap impact: "Lessons catalog & seed" `[~]` → `[x]`. One convergence note for the reviewer: this PR and #85 both emit `audio_url` on lesson payloads — this one on the detail projection, #85 on the catalog + audio route. They are intentionally contract-identical, so merging in either order is safe. _This review was created by an AI agent (OpenHands) on behalf of the ATM team._
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
Kalle/ATM!87
No description provided.