Files
fdbck/src/routes/api/public/feedback/[slug]
mAi 778df213da mAi: #4 - single-submission follow-up fixes
Four bugs from m's smoke pass on the just-shipped single-submission feature:

1. Reload showed the legacy "you can submit again" branch instead of the
   read-only summary, because the client never refetched its previous
   submission. Fix: page server load now does an IP+UA backstop lookup so
   first paint is correct; client onMount supplements with a session_id
   lookup against the new GET ?session_id= variant for the
   cleared-cookies-but-same-browser case. Renamed JSON field
   previous_submission to keep server/client shape symmetric. Same parametised
   .eq() pattern as the submit handler — no PostgREST .or() with a
   user-controlled session id.

2. Trailing colon in "Du hast schon abgesendet. Du kannst trotzdem nochmal
   antworten:" reads like an unfinished sentence. Rewrote as a question:
   "Du hast bereits abgesendet. Möchtest du eine weitere Antwort senden?"
   The branch is now also gated on !singleSubmission — when the toggle is
   on it never fires (the previous_submission branch wins).

3. The .fb-already card looked like a form replica (boxes around values).
   Replaced with a confirmation summary: ✓-icon header ("Antwort gesendet"
   + timestamp), then a definition list with muted labels above plain
   values, no input outlines. On ≥560px the rows become a two-column grid
   with light dividers.

4. The "Noch eine Antwort senden" ghost button on the success card was
   misleading when single_submission is on (clicking it 409s on next
   submit). Hidden when singleSubmission is true; the success banner
   alone now stands.

bun check 0 errors, bun test 25 pass, bun build OK.
2026-05-06 15:44:36 +02:00
..