feat: add in-product survey system (#2008)

* feat: add in-product survey system

- SurveyManager: event-based trigger, Space API communication
- Trigger on first successful non-WebSocket response
- Backend API: /api/v1/survey/{pending,respond,dismiss}
- Frontend: floating survey widget with progressive questions
- Flat radio/checkbox style (not dropdown Select)

* fix: persist triggered survey events to disk across restarts

Store triggered events in data/survey_triggered_events.json so that
restarting the process doesn't re-query Space for already-triggered events.

* fix: use metadata table for survey event persistence instead of file

Store triggered events in the existing metadata KV table
(key='survey_triggered_events') instead of a standalone JSON file.

* fix: ruff format and prettier fixes
This commit is contained in:
Junyan Chin
2026-02-26 13:50:14 +08:00
committed by GitHub
parent 2ded774747
commit 2d837c9cb4
9 changed files with 650 additions and 0 deletions
+3
View File
@@ -3,6 +3,7 @@
import styles from './layout.module.css';
import HomeSidebar from '@/app/home/components/home-sidebar/HomeSidebar';
import HomeTitleBar from '@/app/home/components/home-titlebar/HomeTitleBar';
import SurveyWidget from '@/app/home/components/survey/SurveyWidget';
import React, {
useState,
useCallback,
@@ -54,6 +55,8 @@ export default function HomeLayout({
<HomeTitleBar title={title} subtitle={subtitle} helpLink={helpLink} />
<main className={styles.mainContent}>{mainContent}</main>
<SurveyWidget />
</div>
</div>
);