feat(passenger): show what I reported and how it ended - #45
Merged
Conversation
7cbc326 got the crew's answer to the passenger, but only as a four-second toast. Look away, or have the phone asleep when the crew presses Gefunden, and there was no way to find out afterwards — the answer existed in storage and the passenger app never showed it. The Reisen tab now carries "Meine Verlustmeldungen" under the trips: what was reported, where, when, the status badge, and the crew's note when they left one ("Unter Sitz 42 gefunden, liegt beim Zugpersonal" is worth more to a passenger than the word Gefunden). It reads the same handover the toast reads, so there is no second copy of the answer, and it updates live — an answer landing in the crew tab flips the badge without a reload. Nothing renders before the first report: an empty box explaining its own emptiness has no business on a screen opened to see trips. lib/hooks/useDemoReports.ts holds the read, so the component stays render-only and the storage subscription is not duplicated per consumer. It starts empty and fills after mount — localStorage does not exist on the server, and reading during render would make the first paint disagree with the HTML Next sent. Verified in a browser against the dev server, no backend: reported "Kopfhörer, weiss, in Ladecase", saw it listed as Neu, answered Gefunden with a note from /staff in a second tab, watched the badge and note appear without a reload — then reloaded / and the record was still there, which is the whole point. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MT1aaWfJeDUZpTxZ3DfHg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was missing
#44 got the crew's answer to the passenger — but only as a four-second toast. Look away, or have the phone asleep when the crew presses Gefunden, and there was no way to find out afterwards: the answer sat in the handover and the passenger app never showed it.
What changed
components/passenger/MyReports.tsx(new) — "Meine Verlustmeldungen" in the Reisen tab, under the trips: what was reported, where, when, the status badge (fromNOTIFICATION_STATUS_CONFIG, the same SSOT the crew cards use), and the crew's note when they left one. "Unter Sitz 42 gefunden, liegt beim Zugpersonal" is worth more to a passenger than the word "Gefunden".lib/hooks/useDemoReports.ts(new) holds the read, so the component stays render-only and the storage subscription isn't duplicated per consumer. It starts empty and fills after mount —localStoragedoesn't exist on the server, and reading during render would make the first paint disagree with the HTML Next sent.lib/labels.ts; no new literals in components.Verification
npm run verifygreen: prettier clean, tsc clean, lint 0 errors (22 pre-existing warnings), 71 tests pass, tenant SSOT ok.Browser against the dev server with no backend: reported "Kopfhörer, weiss, in Ladecase", saw it listed as Neu, answered Gefunden with a note from
/staffin a second tab, watched the badge and note appear without a reload — then reloaded/and the record was still there, which is the whole point.No new tests: the status-badge lookup is already proven exhaustive by the compiler (
NOTIFICATION_STATUS_CONFIG[report.status]fails to typecheck if a status is unmapped), and the rest is render-and-subscribe plumbing covered by the browser pass.🤖 Generated with Claude Code
https://claude.ai/code/session_014MT1aaWfJeDUZpTxZ3DfHg