feat: request a tool when home search finds nothing (#385)

Adds a prefilled 'Request a tool' affordance to the home search empty state and beneath weak results. Opens the in-app feedback dialog with a new search_miss source and a structured search_query when analytics is on; links to a prefilled GitHub Discussions (Ideas) post when off, so a request is never silently dropped. Reuses the existing feedback pipe, dialog, and analytics gate; no new storage. i18n across all 21 locales.
This commit is contained in:
SnapOtter
2026-07-01 18:50:55 +08:00
committed by GitHub
parent 174001d384
commit c68297d5a4
32 changed files with 531 additions and 30 deletions
+16 -3
View File
@@ -1,16 +1,24 @@
import { apiPost } from "@/lib/api";
export type FeedbackSource = "global" | "tool_result" | "failed_job" | "admin_installer";
export type FeedbackSource =
| "global"
| "tool_result"
| "failed_job"
| "admin_installer"
| "search_miss";
export type FeedbackSurveyId =
| "global-feedback-v1"
| "tool-result-v1"
| "failed-job-v1"
| "admin-install-v1";
| "admin-install-v1"
| "search-miss-v1";
export type FeedbackPromptVariant =
| "nav-v1"
| "inline-v1"
| "failed-button-v1"
| "settings-card-v1";
| "settings-card-v1"
| "search-empty-v1"
| "search-results-v1";
export type FeedbackSentiment = "great" | "okay" | "issue" | "missing" | "bug" | "idea" | "other";
export type FeedbackType = "bug" | "feature_request" | "confusing_ux" | "performance" | "other";
export type FeedbackInstallMethod = "docker" | "docker_compose" | "source" | "cloud" | "other";
@@ -58,6 +66,7 @@ export interface FeedbackPayload {
contactName?: string;
company?: string;
toolId?: string;
searchQuery?: string;
jobStatus?: "completed" | "failed";
installMethod?: FeedbackInstallMethod;
usageType?: FeedbackUsageType;
@@ -87,6 +96,8 @@ export function surveyIdForSource(source: FeedbackSource): FeedbackSurveyId {
return "failed-job-v1";
case "admin_installer":
return "admin-install-v1";
case "search_miss":
return "search-miss-v1";
case "global":
return "global-feedback-v1";
}
@@ -100,6 +111,8 @@ export function promptVariantForSource(source: FeedbackSource): FeedbackPromptVa
return "failed-button-v1";
case "admin_installer":
return "settings-card-v1";
case "search_miss":
return "search-empty-v1";
case "global":
return "nav-v1";
}