feat(user-interviews): celebrate end of interview with hogfetti#60750
feat(user-interviews): celebrate end of interview with hogfetti#60750pauldambra wants to merge 4 commits into
Conversation
Trigger Hogfetti when the interview call transitions to `ended`, so a completed interview feels like a small celebration instead of a quiet text panel. The same celebration applies whether the agent or the interviewee ends the call — the trigger is driven by the `ended` state transition rather than the specific event source. Also tidies the benign end-of-call error matcher: lift the list of known Vapi/Daily normal-completion messages to a module-level constant, add `Worker has ended call` and `Call ended`, and keep the connected gate so a pre-connection failure that happens to mention any of these phrases still surfaces as a real error. Generated-By: PostHog Code Task-Id: ca1def5b-16e1-4444-8eb0-eaeca394b62e
|
Hey @pauldambra! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
A 20-second bail-out shouldn't trigger a celebration — it reads as desperate rather than thankful. Only fire Hogfetti when the call was actually substantive, i.e. the interviewee stayed on for at least two minutes after the call connected. Tracked via a `callStartedAtRef` timestamp captured at the same point we currently flip `callConnectedRef`, reset alongside the other per-attempt refs in `start()`. Generated-By: PostHog Code Task-Id: ca1def5b-16e1-4444-8eb0-eaeca394b62e
|
Size Change: 0 B Total Size: 80.8 MB ℹ️ View Unchanged
|
pauldambra
left a comment
There was a problem hiding this comment.
QA Swarm review complete. See inline comments and the summary comment posted separately.
Note
🤖 Automated comment by QA Swarm — not written by a human
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: qa-team (specialists + generalists), paul-reviewer, xp-reviewer, security-audit Verdict:
|
| Reviewer | Assessment |
|---|---|
| 🔍 qa-team | HIGH — generalists both flagged the resize re-trigger; frontend flagged reduced-motion + particle count. |
| 👤 paul | Stamp anyway with one ask — add the posthog event so we can tune the floor with data, not vibes. 🚢 |
| 📐 xp | One-shot guard fixes the only real concern. Constant naming + benign-message extract read well. Ship after the guard. |
| 🛡 security-audit | No findings — purely cosmetic client-side change, no new sinks or auth surface. |
Automated by QA Swarm — not a human review
…tion Address qa-swarm review findings: - One-shot guard for the celebration. `useHogfetti`'s `trigger` is a `useCallback` whose deps include the hook's internal `dimensions` state, which re-sets on every window resize. The previous effect listed `triggerHogfetti` in its deps, so a resize after the interview ended would re-run the effect and re-fire confetti. Now `hogfettiFiredRef` flips to `true` the first time we pass the threshold and the effect short-circuits on subsequent runs; the ref resets alongside the other per-attempt refs in `start()`. - Skip the burst when the user has set `prefers-reduced-motion`. Still flip the one-shot guard so a later media-query change doesn't reopen the celebration window. - Drop `'Call ended'` from the benign-end-of-call substring list. It was broad enough to swallow legitimate post-connect failures like "Call ended unexpectedly: codec mismatch"; the two documented Vapi/Daily phrases plus the more specific `'Worker has ended call'` cover the real cases. Generated-By: PostHog Code Task-Id: ca1def5b-16e1-4444-8eb0-eaeca394b62e
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f93cea10df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
frontend/src/exporter/scenes/ExporterInterviewScene.tsx:15-19
**`Call ended` mentioned in description but absent from constant**
The PR description says both `Worker has ended call` and `Call ended` were added to the benign-message list. The code only adds `Worker has ended call`. If `Call ended` is a real Vapi/Daily normal-completion signal and was intended to be suppressed, its omission means the error panel would still flash for that signal. Could you confirm whether excluding `Call ended` was intentional (e.g. deemed too broad) or an oversight?
Reviews (1): Last reviewed commit: "fix(user-interviews): make hogfetti a on..." | Re-trigger Greptile |
Collapse `BENIGN_END_OF_CALL_MESSAGES` onto a single line per oxfmt — now that `'Call ended'` has been dropped, the three remaining entries fit within the formatter's line-length budget. Generated-By: PostHog Code Task-Id: ca1def5b-16e1-4444-8eb0-eaeca394b62e
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
There was a problem hiding this comment.
Small, focused frontend-only change adding a confetti celebration to interview end. All substantive review concerns (resize re-triggering, prefers-reduced-motion, overly broad error substring) were addressed in the current head and all inline comments are resolved.
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
Problem
User interviews use Vapi for the voice conversation. Vapi's
errorevent channel doubles as a normal-completion signal — Daily.co (Vapi's transport) reports the local participant being evicted from the room as an error message likeMeeting ended due to ejection: Meeting has ended. The current scene already swallows that benign error so the danger panel doesn't flash as the interview wraps up, but the resultingendedstate is just a quiet "thanks for taking the time" text panel — a slightly anticlimactic end to a multi-minute voice conversation we just asked someone to give us.Changes
ended. The trigger is driven by the state transition, so the celebration fires whether the agent ended the call, the interviewee clicked End interview, or Vapi raised a benign end-of-call error that flowed intocall-end.BENIGN_END_OF_CALL_MESSAGESmodule-level constant and addWorker has ended callalongside the existing two phrases. ThecallConnectedRefgate stays in place so a pre-connection failure that happens to contain one of these phrases (e.g. joining an already-ended room) still surfaces a real error with the retry affordance.hogfettiFiredRef) so a window resize afterstate === 'ended'does not re-fire the animation (useHogfetti'striggeridentity changes whenever its internaldimensionsstate updates).prefers-reduced-motionset.No new dependency —
useHogfettiis the existing in-house particle effect already used byPostOnboardingModal,SourcesModal,ExperimentView/PageHeader, etc.How did you test this code?
I'm an agent — I have not manually run this in a browser. The changes are a small additive React effect, a one-shot ref guard, a
prefers-reduced-motioncheck, and a refactor of an inline closure helper into a module-level constant + function. I did not add or run automated tests.Suggested manual verification for a human reviewer:
EndedPanelrenders.EndedPanelshould still render, no confetti.prefers-reduced-motionenabled at the OS level —EndedPanelrenders, no confetti.already_repliedpayload — no confetti (state never reachesended).Automatic notifications
Docs update
n/a — public interview scene only, no docs page describes the benign-error suppression.
🤖 Agent context
Authored by Claude Code via the PostHog Slack code tool. Triggered by a user-interview replay where the interviewee saw 7 console errors during the call — investigation showed those were the documented Vapi/Daily benign "Meeting has ended" ejection signal, not a real failure, but the ending of the call still rendered as a text-only panel.
Refinements applied after a qa-swarm self-review (qa-team, paul-reviewer, xp-reviewer, security-audit) flagged convergent issues:
triggerHogfettiis auseCallbackwhose deps include the hook's internaldimensionsstate. Added a one-shothogfettiFiredRefguard.prefers-reduced-motionaccommodation. Added awindow.matchMediacheck.'Call ended'had originally been included inBENIGN_END_OF_CALL_MESSAGESbut two reviewers convergent-flagged it as too broad (would swallow legitimate post-connect failures like "Call ended unexpectedly: codec mismatch"). Dropped.One open thread is deferred for the human reviewer: paul-reviewer asked for a
posthog.captureon call end with duration +hogfetti_triggeredso the 2-minute floor can be tuned with data. Left out of this PR because it needs a design call on whetherposthog-jsis initialized in the exporter scene context and what the event shape should be.