feat: AI chat conclusion + survey completion & management #95

Merged
chihlasm merged 5 commits from feat/chat-conclusion-survey-management into main 2026-03-06 03:43:02 +00:00
chihlasm commented 2026-03-06 01:01:43 +00:00 (Migrated from github.com)

Summary

  • AI Chat Session Conclusion — Engineers can formally end assistant chat sessions with outcome tracking (resolved/escalated/paused), AI-generated ticket summaries, and copy-to-clipboard for PSA systems. Paused sessions can be resumed in a new chat with full context.
  • Survey Completion Flow — After submitting, respondents can email themselves a copy of their responses, then land on a thank-you page with feedback contact info.
  • Survey Admin Management — Read/unread tracking with visual indicators, archive/unarchive, delete, and bulk actions for managing survey responses at scale.

Changes

AI Assistant - Conclude Session

  • ConcludeSessionModal — 3-step modal (outcome → notes → AI summary)
  • POST /chats/{id}/conclude endpoint with AI-powered summary generation
  • Specialized ticket documentation prompt for PSA-ready output
  • "Resume in New Chat" creates new chat pre-loaded with session context
  • Migration 048: conclusion_outcome, conclusion_summary, concluded_at on assistant_chats

Survey Completion

  • Email-to-self with branded HTML email containing formatted responses
  • /survey/thank-you page with close-window message and feedback callout
  • POST /survey/email-copy public endpoint (rate limited)
  • send_survey_copy_email() added to EmailService

Survey Admin Management

  • Read/unread indicators (auto-marks read on expand)
  • Unread count stat card
  • Per-row context menu and bulk action bar
  • Archive toggle filter
  • 7 new admin endpoints: mark read/unread, archive/unarchive, delete, bulk actions
  • Migration 049: is_read, archived_at on survey_responses

Test plan

  • Open AI Assistant, have a multi-message conversation, click Flag button to conclude
  • Select each outcome type (resolved/escalated/paused) and verify summary generation
  • Copy generated summary to clipboard
  • Test "Resume in New Chat" on a paused session
  • Submit survey, enter email, verify copy arrives
  • Click Finish → verify thank-you page renders
  • Visit survey with already-used token → verify updated already-submitted page
  • Admin: open survey responses, verify unread dot on new responses
  • Admin: expand a response → verify it auto-marks as read
  • Admin: use context menu to mark unread, archive, delete
  • Admin: select multiple → use bulk action bar
  • Admin: toggle "Show Archived" filter

🤖 Generated with Claude Code

## Summary - **AI Chat Session Conclusion** — Engineers can formally end assistant chat sessions with outcome tracking (resolved/escalated/paused), AI-generated ticket summaries, and copy-to-clipboard for PSA systems. Paused sessions can be resumed in a new chat with full context. - **Survey Completion Flow** — After submitting, respondents can email themselves a copy of their responses, then land on a thank-you page with feedback contact info. - **Survey Admin Management** — Read/unread tracking with visual indicators, archive/unarchive, delete, and bulk actions for managing survey responses at scale. ## Changes ### AI Assistant - Conclude Session - `ConcludeSessionModal` — 3-step modal (outcome → notes → AI summary) - `POST /chats/{id}/conclude` endpoint with AI-powered summary generation - Specialized ticket documentation prompt for PSA-ready output - "Resume in New Chat" creates new chat pre-loaded with session context - Migration 048: `conclusion_outcome`, `conclusion_summary`, `concluded_at` on `assistant_chats` ### Survey Completion - Email-to-self with branded HTML email containing formatted responses - `/survey/thank-you` page with close-window message and feedback callout - `POST /survey/email-copy` public endpoint (rate limited) - `send_survey_copy_email()` added to EmailService ### Survey Admin Management - Read/unread indicators (auto-marks read on expand) - Unread count stat card - Per-row context menu and bulk action bar - Archive toggle filter - 7 new admin endpoints: mark read/unread, archive/unarchive, delete, bulk actions - Migration 049: `is_read`, `archived_at` on `survey_responses` ## Test plan - [ ] Open AI Assistant, have a multi-message conversation, click Flag button to conclude - [ ] Select each outcome type (resolved/escalated/paused) and verify summary generation - [ ] Copy generated summary to clipboard - [ ] Test "Resume in New Chat" on a paused session - [ ] Submit survey, enter email, verify copy arrives - [ ] Click Finish → verify thank-you page renders - [ ] Visit survey with already-used token → verify updated already-submitted page - [ ] Admin: open survey responses, verify unread dot on new responses - [ ] Admin: expand a response → verify it auto-marks as read - [ ] Admin: use context menu to mark unread, archive, delete - [ ] Admin: select multiple → use bulk action bar - [ ] Admin: toggle "Show Archived" filter 🤖 Generated with [Claude Code](https://claude.com/claude-code)
railway-app[bot] commented 2026-03-06 01:01:54 +00:00 (Migrated from github.com)

🚅 Deployed to the patherly-pr-95 environment in selfless-grace

Service Status Web Updated (UTC)
hopeful-liberation Success (View Logs) Web Mar 6, 2026 at 3:35 am
patherly Success (View Logs) Web Mar 6, 2026 at 3:34 am
<!-- railway-bot-comment-version=2 --> <!-- railway-project-id="22b9b58c-271b-42e5-a10e-6fdec8d00134" railway-project-name="selfless-grace" --> 🚅 Deployed to the [patherly-pr-95](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134?environmentId=708b8857-b133-4a57-a090-d2f71748f931) environment in **[selfless-grace](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134)** | **Service** | **Status** | **Web** | **Updated** (UTC) | | :--- | :--- | :--- | :--- | | hopeful-liberation | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/e1db2ee3-d241-4f45-abe4-c9c5fdf483d5?id=5fdf66dc-f026-4d71-a0ba-90a2a1756dfe&environmentId=708b8857-b133-4a57-a090-d2f71748f931)) | [Web](https://hopeful-liberation-patherly-pr-95.up.railway.app) | Mar 6, 2026 at 3:35 am | | patherly | ✅ Success ([View Logs](https://railway.com/project/22b9b58c-271b-42e5-a10e-6fdec8d00134/service/95f556ff-5264-4116-a0c2-618a2fc53ba4?id=cbdb602f-2865-4c02-886f-bfc1e9ed4d15&environmentId=708b8857-b133-4a57-a090-d2f71748f931)) | [Web](https://patherly-patherly-pr-95.up.railway.app) | Mar 6, 2026 at 3:34 am |
Sign in to join this conversation.