diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsx new file mode 100644 index 0000000..a7775fe --- /dev/null +++ b/src/components/HelpDialog.tsx @@ -0,0 +1,67 @@ +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogFooter, +} from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; +import { BookOpenIcon, BugIcon } from "lucide-react"; +import { IpcClient } from "@/ipc/ipc_client"; + +interface HelpDialogProps { + isOpen: boolean; + onClose: () => void; +} + +export function HelpDialog({ isOpen, onClose }: HelpDialogProps) { + return ( + + + + Need help with Dyad? + + + If you need assistance or want to report an issue, here are some + resources: + + + + { + IpcClient.getInstance().openExternalUrl( + "https://www.dyad.sh/docs" + ); + }} + className="w-full py-6 bg-(--background-lightest)" + > + Open Docs + + + Get help with common questions and issues. + + + + + IpcClient.getInstance().openExternalUrl( + "https://github.com/dyad-sh/dyad/issues/new" + ) + } + className="w-full py-6 bg-(--background-lightest)" + > + Report a Bug + + + We’ll auto-fill your report with system info and logs. You can + review it for any sensitive info before submitting. + + + + + + ); +} diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index 9cadffa..fc0f29b 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -1,4 +1,4 @@ -import { Home, Inbox, Settings } from "lucide-react"; +import { Home, Inbox, Settings, HelpCircle } from "lucide-react"; import { Link, useRouterState } from "@tanstack/react-router"; import { useSidebar } from "@/components/ui/sidebar"; // import useSidebar hook import { useEffect, useState, useRef } from "react"; @@ -17,6 +17,7 @@ import { } from "@/components/ui/sidebar"; import { ChatList } from "./ChatList"; import { AppList } from "./AppList"; +import { HelpDialog } from "./HelpDialog"; // Import the new dialog import { usePostHog } from "posthog-js/react"; // Menu items. @@ -49,6 +50,7 @@ export function AppSidebar() { const { state, toggleSidebar } = useSidebar(); // retrieve current sidebar state const [hoverState, setHoverState] = useState("no-hover"); const expandedByHover = useRef(false); + const [isHelpDialogOpen, setIsHelpDialogOpen] = useState(false); // State for dialog useEffect(() => { if ( @@ -114,6 +116,26 @@ export function AppSidebar() { + + + + {/* Change button to open dialog instead of linking */} + setIsHelpDialogOpen(true)} // Open dialog on click + > + + Help + + setIsHelpDialogOpen(false)} + /> + + + + );
+ Get help with common questions and issues. +
+ We’ll auto-fill your report with system info and logs. You can + review it for any sensitive info before submitting. +