mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: critical first-login soft-lock in usage survey overlay (#392)
* fix: prevent UsageSurveyOverlay from soft-locking the first-login password-change flow Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * fix: prevent double feedback submission when the settings write fails Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * refactor: consolidate feedback enums into packages/shared as a single source of truth Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * feat: add ARIA semantics, dismiss-button guard, and shared auth-route list to UsageSurveyOverlay Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp * test: cover the submit-failure retry path and a persona-only minimal payload Claude-Session: https://claude.ai/code/session_01KAC9Lbx8AmebAnj9WQZXHp
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
// Single source of truth for the feedback_submitted event's enum fields.
|
||||
// Consumed by: the API's Zod validation (apps/api/src/routes/feedback.ts),
|
||||
// the API's PostHog event shape (apps/api/src/lib/analytics.ts), and the
|
||||
// web app's feedback types (apps/web/src/lib/feedback.ts). Add new values
|
||||
// here, not in any of those three. They all derive from this file.
|
||||
|
||||
export const FEEDBACK_SOURCE_VALUES = [
|
||||
"global",
|
||||
"tool_result",
|
||||
"failed_job",
|
||||
"admin_installer",
|
||||
"search_miss",
|
||||
"onboarding",
|
||||
] as const;
|
||||
export type FeedbackSource = (typeof FEEDBACK_SOURCE_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_SURVEY_ID_VALUES = [
|
||||
"global-feedback-v1",
|
||||
"tool-result-v1",
|
||||
"failed-job-v1",
|
||||
"admin-install-v1",
|
||||
"search-miss-v1",
|
||||
"onboarding-usage-v1",
|
||||
] as const;
|
||||
export type FeedbackSurveyId = (typeof FEEDBACK_SURVEY_ID_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_SENTIMENT_VALUES = [
|
||||
"great",
|
||||
"okay",
|
||||
"issue",
|
||||
"missing",
|
||||
"bug",
|
||||
"idea",
|
||||
"other",
|
||||
] as const;
|
||||
export type FeedbackSentiment = (typeof FEEDBACK_SENTIMENT_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_TYPE_VALUES = [
|
||||
"bug",
|
||||
"feature_request",
|
||||
"confusing_ux",
|
||||
"performance",
|
||||
"other",
|
||||
] as const;
|
||||
export type FeedbackType = (typeof FEEDBACK_TYPE_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_INSTALL_METHOD_VALUES = [
|
||||
"docker",
|
||||
"docker_compose",
|
||||
"source",
|
||||
"cloud",
|
||||
"other",
|
||||
] as const;
|
||||
export type FeedbackInstallMethod = (typeof FEEDBACK_INSTALL_METHOD_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_USAGE_TYPE_VALUES = [
|
||||
"personal",
|
||||
"team_internal",
|
||||
"business_workflow",
|
||||
"education",
|
||||
"evaluating",
|
||||
] as const;
|
||||
export type FeedbackUsageType = (typeof FEEDBACK_USAGE_TYPE_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_IMPORTANT_AREA_VALUES = [
|
||||
"images",
|
||||
"pdf_docs",
|
||||
"video_audio",
|
||||
"batch_workflows",
|
||||
"ai_tools",
|
||||
] as const;
|
||||
export type FeedbackImportantArea = (typeof FEEDBACK_IMPORTANT_AREA_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_FRICTION_AREA_VALUES = [
|
||||
"smooth",
|
||||
"docker",
|
||||
"environment_variables",
|
||||
"auth",
|
||||
"storage",
|
||||
"workers",
|
||||
"ai_tools",
|
||||
"docs",
|
||||
"performance",
|
||||
"other",
|
||||
] as const;
|
||||
export type FeedbackFrictionArea = (typeof FEEDBACK_FRICTION_AREA_VALUES)[number];
|
||||
|
||||
export const FEEDBACK_ERROR_CATEGORY_VALUES = [
|
||||
"validation_error",
|
||||
"upload_error",
|
||||
"processing_error",
|
||||
"timeout",
|
||||
"unsupported_format",
|
||||
"worker_unavailable",
|
||||
"unknown",
|
||||
] as const;
|
||||
export type FeedbackErrorCategory = (typeof FEEDBACK_ERROR_CATEGORY_VALUES)[number];
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./analytics/baked.js";
|
||||
export * from "./analytics/events.js";
|
||||
export * from "./analytics/feedback.js";
|
||||
export * from "./analytics/types.js";
|
||||
export * from "./audit-events.js";
|
||||
export * from "./constants.js";
|
||||
|
||||
Reference in New Issue
Block a user