From 770d67d8c4a50b5d36dd361e1cc26bd0699dc149 Mon Sep 17 00:00:00 2001 From: Kacper Date: Mon, 15 Dec 2025 20:49:22 +0100 Subject: [PATCH] feat: refactor bug report button into a reusable component for improved sidebar functionality --- apps/app/src/components/layout/sidebar.tsx | 82 ++++++++++------------ 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/apps/app/src/components/layout/sidebar.tsx b/apps/app/src/components/layout/sidebar.tsx index 376ad6e6..0ed8aebb 100644 --- a/apps/app/src/components/layout/sidebar.tsx +++ b/apps/app/src/components/layout/sidebar.tsx @@ -195,6 +195,32 @@ const PROJECT_THEME_OPTIONS = [ })), ] as const; +// Reusable Bug Report Button Component +const BugReportButton = ({ + sidebarExpanded, + onClick +}: { + sidebarExpanded: boolean; + onClick: () => void; +}) => { + return ( + + ); +}; + export function Sidebar() { const { projects, @@ -836,6 +862,12 @@ export function Sidebar() { [trashedProjects, currentProject, globalTheme, upsertAndSetCurrentProject] ); + // Handle bug report button click + const handleBugReportClick = useCallback(() => { + const api = getElectronAPI(); + api.openExternalLink("https://github.com/AutoMaker-Org/automaker/issues"); + }, []); + /** * Opens the system folder selection dialog and initializes the selected project. * Used by both the 'O' keyboard shortcut and the folder icon button. @@ -1394,50 +1426,14 @@ export function Sidebar() { )} - {/* Bug Report Button - Only visible in expanded sidebar */} - {sidebarOpen && ( - - )} + {/* Bug Report Button - Inside logo container when expanded */} + {sidebarOpen && } {/* Bug Report Button - Collapsed sidebar version */} {!sidebarOpen && ( -
- +
+
)} @@ -1815,7 +1811,7 @@ export function Sidebar() { )} {/* Nav Items - Scrollable */} -