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
+11 -2
View File
@@ -8,8 +8,13 @@ import { analyticsEnabled, bakedEnabled } from "./analytics-gate.js";
let posthogClient: PostHog | null = null;
export interface FeedbackEventProperties {
source: "global" | "tool_result" | "failed_job" | "admin_installer";
survey_id?: "global-feedback-v1" | "tool-result-v1" | "failed-job-v1" | "admin-install-v1";
source: "global" | "tool_result" | "failed_job" | "admin_installer" | "search_miss";
survey_id?:
| "global-feedback-v1"
| "tool-result-v1"
| "failed-job-v1"
| "admin-install-v1"
| "search-miss-v1";
prompt_variant?: string;
sentiment?: "great" | "okay" | "issue" | "missing" | "bug" | "idea" | "other";
feedback_type?: "bug" | "feature_request" | "confusing_ux" | "performance" | "other";
@@ -19,6 +24,7 @@ export interface FeedbackEventProperties {
contact_name?: string;
company?: string;
tool_id?: string;
search_query?: string;
job_status?: "completed" | "failed";
install_method?: "docker" | "docker_compose" | "source" | "cloud" | "other";
usage_type?: "personal" | "team_internal" | "business_workflow" | "education" | "evaluating";
@@ -128,6 +134,9 @@ function cleanFeedbackProperties(properties: FeedbackEventProperties): Record<st
copyString("contact_name");
copyString("company");
copyString("tool_id");
// Intentional: this is the user-typed query from a missing-tool feature request,
// not the tool-telemetry "search query" that analytics-allowlist.ts never forwards.
copyString("search_query");
copyString("job_status");
copyString("install_method");
copyString("usage_type");