Skip to content

fix(demo): tell the passenger what the crew actually answered - #44

Merged
github-actions[bot] merged 1 commit into
masterfrom
fix/crew-answer-reaches-passenger
Sep 1, 2026
Merged

fix(demo): tell the passenger what the crew actually answered#44
github-actions[bot] merged 1 commit into
masterfrom
fix/crew-answer-reaches-passenger

Conversation

@catomean

@catomean catomean commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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.ts now 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.
  • /staff publishes 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.
  • 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.

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 said pending.

Verification

npm run verify green: prettier clean, tsc clean, lint 0 errors, 71 tests pass (27 reporting-service + 44 frontend, 4 new for answerReport), tenant SSOT ok.

Browser, dev server with 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.

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

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
@github-actions
github-actions Bot merged commit 7cbc326 into master Sep 1, 2026
1 check passed
@github-actions
github-actions Bot deleted the fix/crew-answer-reaches-passenger branch September 1, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant