feat(webchat): customizable CSAT rating in chat widget#52
Draft
rgrjnr wants to merge 1 commit into
Draft
Conversation
Collaborator
Author
|
Status check (2026-07-14 branch audit): Feature is complete and coherent (~550 insertions across 29 files: Next steps:
|
Show a 1–5 emoji satisfaction rating when a conversation ends. The prompt
("How would you rate the support you received today?") and an enable toggle
are configurable per-organization from the dashboard webchat settings page.
Backend
- webchat_settings: csat_enabled, csat_question
- conversations: csat_rating, csat_rated_at
- migration AddCsatToWebchat
- publicConversations.submitCsat (DPoP-verified); getPublicConfig and
getMessages expose CSAT config / existing rating
Widget
- CsatRating.vue (emoji scale + thank-you) in the closed-conversation footer
- useChat.submitCsat with NONCE_EXPIRED retry; restores thank-you state for
already-rated conversations
- CSAT strings across all 13 locales
Dashboard
- CSAT settings card (toggle + question), wired through load/save (en, pt-BR)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCDQXq5krP6d9Wi2NBCyam
rgrjnr
force-pushed
the
claude/peaceful-cerf-bavqlw
branch
from
July 14, 2026 17:24
eb81f5c to
3788e2f
Compare
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.
Summary
Adds a Customer Satisfaction (CSAT) rating to the webchat widget. When a conversation ends, visitors are shown a 1–5 emoji scale under a prompt that defaults to "How would you rate the support you received today?". Both the prompt text and an enable/disable toggle are configurable per‑organization from the dashboard webchat settings page.
What changed
Backend
webchat_settings: newcsat_enabled(bool, defaulttrue) andcsat_question(text, default copy) columns.conversations: newcsat_rating(smallint, nullable) andcsat_rated_at(timestamptz, nullable) columns — one rating per conversation, no new table.1781300000000-AddCsatToWebchat.publicConversations.submitCsatmutation — DPoP‑verified likesendMessage, withNONCE_EXPIREDretry support.webchat.getPublicConfignow returns the CSAT config;getMessagesreturns the existingcsatRating.webchat.updateSettingsaccepts the new fields.Widget
CsatRating.vue(emoji scale + thank‑you state), rendered in the existing closed‑conversation footer when CSAT is enabled.useChat.submitCsatposts the rating via DPoP; already‑rated conversations restore the thank‑you state on load/refresh.csat.defaultQuestion,csat.thankYou) added across all 13 widget locales.Dashboard
enandpt-BRsettings strings.How it works
The rating is shown only when the conversation is
closed/resolved(reusing existing closure detection) and CSAT is enabled. The default question lives in the DB and is served to the widget via the public config endpoint, so changes in settings take effect without re‑embedding.Verification
npm run typecheck:server— ✅ passnpm run typecheck:dashboard— ✅ pass (exit 0)webchatbuild — ✅ pass; typecheck clean (only the pre‑existing, unrelatedfake-indexeddbtest‑setup error remains)Note
A DB migration is included — run
npm run migration:runbefore deploying.🤖 Generated with Claude Code
Generated by Claude Code