diff --git a/src/main/ipc/feedback.ts b/src/main/ipc/feedback.ts index 663f24a4e3f..8034d5c7e10 100644 --- a/src/main/ipc/feedback.ts +++ b/src/main/ipc/feedback.ts @@ -14,12 +14,13 @@ export type FeedbackSubmitArgs = { githubLogin: string | null githubEmail: string | null // Why: when the user submits anonymously they can still volunteer a GitHub - // handle (so we can @-mention them on the fix PR) or a contact (email / x - // handle for follow-up). These are separate fields rather than reusing + // handle (so we can @-mention them on the fix PR), an email, or an x.com + // handle for follow-up. Three separate fields rather than reusing // githubLogin/githubEmail so the backend can tell verified gh identity // apart from a self-typed handle. anonymousGithubLogin?: string | null - anonymousContact?: string | null + anonymousEmail?: string | null + anonymousX?: string | null } type FeedbackSubmitBody = FeedbackSubmitArgs & { diff --git a/src/preload/api-types.ts b/src/preload/api-types.ts index 7089df5acc9..1859bb15ee7 100644 --- a/src/preload/api-types.ts +++ b/src/preload/api-types.ts @@ -507,7 +507,8 @@ export type PreloadApi = { githubLogin: string | null githubEmail: string | null anonymousGithubLogin?: string | null - anonymousContact?: string | null + anonymousEmail?: string | null + anonymousX?: string | null }) => Promise<{ ok: true } | { ok: false; status: number | null; error: string }> } export: ExportApi diff --git a/src/preload/index.ts b/src/preload/index.ts index 9bde36588c6..b5e704a3ec9 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -520,7 +520,8 @@ const api = { githubLogin: string | null githubEmail: string | null anonymousGithubLogin?: string | null - anonymousContact?: string | null + anonymousEmail?: string | null + anonymousX?: string | null }): Promise<{ ok: true } | { ok: false; status: number | null; error: string }> => ipcRenderer.invoke('feedback:submit', args) }, diff --git a/src/renderer/src/components/sidebar/SidebarToolbar.tsx b/src/renderer/src/components/sidebar/SidebarToolbar.tsx index 4062baea3c2..40e659866e1 100644 --- a/src/renderer/src/components/sidebar/SidebarToolbar.tsx +++ b/src/renderer/src/components/sidebar/SidebarToolbar.tsx @@ -63,7 +63,8 @@ function FeedbackDialog({ const [isViewerLoading, setIsViewerLoading] = useState(false) const [submitAnonymously, setSubmitAnonymously] = useState(false) const [anonGithubLogin, setAnonGithubLogin] = useState('') - const [anonContact, setAnonContact] = useState('') + const [anonEmail, setAnonEmail] = useState('') + const [anonX, setAnonX] = useState('') React.useEffect(() => { if (!open) { @@ -119,7 +120,8 @@ function FeedbackDialog({ // anonymous. Otherwise the regular gh identity already covers tagging // and contact, and we don't want to surprise non-anonymous submitters. anonymousGithubLogin: submitAnonymously ? normalizeOptional(anonGithubLogin) : null, - anonymousContact: submitAnonymously ? normalizeOptional(anonContact) : null + anonymousEmail: submitAnonymously ? normalizeOptional(anonEmail) : null, + anonymousX: submitAnonymously ? normalizeOptional(anonX) : null }) if (!result.ok) { @@ -130,7 +132,8 @@ function FeedbackDialog({ setFeedback('') setSubmitAnonymously(false) setAnonGithubLogin('') - setAnonContact('') + setAnonEmail('') + setAnonX('') onOpenChange(false) } catch (err) { toast.error('Failed to submit feedback. Please try again.') @@ -246,34 +249,32 @@ function FeedbackDialog({
- If we fix the issue, we can't let you know 🥲 + If we fix the issue, we can't let you know 🥲 (all optional)
- - + setAnonGithubLogin(event.target.value)} + placeholder="GitHub username — we'll tag you on the PR" + tabIndex={submitAnonymously ? 0 : -1} + className="h-8 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring" + /> + setAnonEmail(event.target.value)} + placeholder="Email — we'll reach out when fixed" + tabIndex={submitAnonymously ? 0 : -1} + className="h-8 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring" + /> + setAnonX(event.target.value)} + placeholder="x.com handle — we'll reach out when fixed" + tabIndex={submitAnonymously ? 0 : -1} + className="h-8 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring" + />