From d45e49c83d3a9115cb92b370bd64920f66343f96 Mon Sep 17 00:00:00 2001 From: Brad Bazemore Date: Mon, 12 Jan 2026 14:54:47 -0500 Subject: [PATCH 1/7] feat: add bug report and feedback forms to help menu Users can now report bugs or submit feedback directly from the help menu. Forms collect title and description, then open the community forum with pre-filled content in a new tab. Co-Authored-By: Claude Opus 4.5 --- src/components/HelpButton.tsx | 231 +++++++++++++++++++++++++++++----- 1 file changed, 203 insertions(+), 28 deletions(-) diff --git a/src/components/HelpButton.tsx b/src/components/HelpButton.tsx index acb54af..0c0456b 100644 --- a/src/components/HelpButton.tsx +++ b/src/components/HelpButton.tsx @@ -1,9 +1,12 @@ import { useState } from 'react'; -import { HelpCircle, Keyboard, Lightbulb, ExternalLink, Activity } from 'lucide-react'; +import { HelpCircle, Keyboard, Lightbulb, ExternalLink, Activity, Bug, ArrowLeft } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; +import { Input } from '@/components/ui/input'; +import { Textarea } from '@/components/ui/textarea'; +import { Label } from '@/components/ui/label'; interface ShortcutItem { keys: string[]; description: string; @@ -49,8 +52,57 @@ const shortcutGroups: ShortcutGroup[] = [{ description: 'Show this help dialog' }] }]; +type FormType = 'bug' | 'feedback' | null; + +const buildForumUrl = (type: 'bug' | 'feature', title: string, description: string) => { + const tag = type === 'bug' ? 'bug' : 'feature'; + const bodyTemplate = type === 'bug' + ? `**Issue Description:**\n${description}\n\n**Steps to Reproduce:**\n1. \n2. \n3. \n\n**Expected Behavior:**\n\n**Actual Behavior:**\n` + : `**Feedback:**\n${description}\n\n**Why this would help:**\n`; + + const params = new URLSearchParams({ + category: 'feedback', + title: title, + tags: tag, + body: bodyTemplate + }); + + return `https://forum.openhamprep.com/new-topic?${params.toString()}`; +}; + export function HelpButton() { const [open, setOpen] = useState(false); + const [activeForm, setActiveForm] = useState(null); + const [bugTitle, setBugTitle] = useState(''); + const [bugDescription, setBugDescription] = useState(''); + const [feedbackTitle, setFeedbackTitle] = useState(''); + const [feedbackDescription, setFeedbackDescription] = useState(''); + + const resetForms = () => { + setActiveForm(null); + setBugTitle(''); + setBugDescription(''); + setFeedbackTitle(''); + setFeedbackDescription(''); + }; + + const handleDialogChange = (isOpen: boolean) => { + setOpen(isOpen); + if (!isOpen) { + resetForms(); + } + }; + + const handleSubmitBug = () => { + const url = buildForumUrl('bug', bugTitle, bugDescription); + window.open(url, '_blank', 'noopener,noreferrer'); + }; + + const handleSubmitFeedback = () => { + const url = buildForumUrl('feature', feedbackTitle, feedbackDescription); + window.open(url, '_blank', 'noopener,noreferrer'); + }; + return <> @@ -63,7 +115,7 @@ export function HelpButton() { - + @@ -108,39 +160,162 @@ export function HelpButton() { -

- Found a bug or have an idea to improve the app? Let us know on our community forum! -

- -
- -
- -
-
Give Feedback
-
- Share ideas, report bugs, or suggest features + + ) : activeForm === 'bug' ? ( +
+ + +
+
+
+

Report a Bug

-