fix(demo): tell the passenger what the crew actually answered - #44
Merged
Merged
Conversation
651ce50 carried the report to the crew view; the answer never came back. The passenger app fired "Personal sucht aktiv nach Ihrem Gegenstand" five seconds after every report and said nothing else — so when the crew pressed "Nicht gefunden", the passenger screen was not merely silent, it was claiming a search that had already been called off. The bus now runs both ways. The crew's answer is written onto the notification it answers — one key, one shape, no second type and no second copy of the same fact to drift — and the passenger view announces it: found as a success toast, not found as an honest one that names the Fundbüro. Answers already in storage seed the seen set on mount, so a reload does not replay old news, and the scripted "searching" beat stands down when an answer is already in, since with two devices the crew can answer inside those five seconds. `publishResponse` ignores any id that is not in the handover, which is what keeps it off the staged cold-open notification (nobody reported that one) and off anything the backend owns. Falling out of it: answering a handed-over report now survives a reload of /staff, which it did not before — the answer lived only in component state. The three passenger-facing strings moved to lib/labels.ts, where the rest of the UI text lives; "Personal sucht aktiv…" had been a literal in the page. Verified in a browser against the dev server, no backend running: reported three items on /, answered them from /staff in a second tab, and watched the passenger tab receive "Gefunden! Das Personal hat Ihren Gegenstand." and "Personal konnte den Gegenstand nicht finden — Ihre Meldung geht ans Fundbüro." for the matching reports. 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 broken
#43 carried the report to the crew view. The answer never came back:
/fired "Personal sucht aktiv nach Ihrem Gegenstand" five seconds after every report and said nothing else — so when the crew pressed Nicht gefunden, the passenger screen wasn't merely silent, it was claiming a search that had already been called off. Step 4 of the demo flow in CLAUDE.md ("Passenger gets update → status change notification") was the last scripted hop.What changed
lib/demo-bus.tsnow runs both ways.answerReport()(pure, unit-tested) writes the crew's answer onto the notification it answers — one storage key, one shape, no second type and no second copy of the same fact to drift.publishResponse()is the browser plumbing./staffpublishes when it answers a handed-over report. Ids not in the handover are ignored, which keeps it off the staged cold-open notification (nobody reported that one) and off anything a backend owns./subscribes and announces: found → success toast, not found → an honest one naming the Fundbüro. Answers already in storage seed the seen set on mount, so a reload doesn't replay old news; the scripted "searching" beat stands down when an answer is already in, since with two devices the crew can answer inside those five seconds.lib/labels.tswhere the rest of the UI text lives —"Personal sucht aktiv…"had been a literal in the page.Falls out of it: answering a handed-over report now survives a reload of
/staff. It didn't before — the answer lived only in component state while storage still saidpending.Verification
npm run verifygreen: prettier clean, tsc clean, lint 0 errors, 71 tests pass (27 reporting-service + 44 frontend, 4 new foranswerReport), tenant SSOT ok.Browser, dev server with no backend running: reported three items on
/, answered them from/staffin a second tab, and watched the passenger tab receive "Gefunden! Das Personal hat Ihren Gegenstand." and "Personal konnte den Gegenstand nicht finden — Ihre Meldung geht ans Fundbüro." for the matching reports.Known limitation
The answer is announced as a toast and nothing more — a passenger whose screen is asleep when the crew answers has no record of it afterwards. A "meine Meldungen" surface on
/is the honest next step; noted in the roadmap, not in this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_014MT1aaWfJeDUZpTxZ3DfHg