diff --git a/apps/frontend/src/renderer/components/Sidebar.tsx b/apps/frontend/src/renderer/components/Sidebar.tsx index 585e3ccf..7a37cfa9 100644 --- a/apps/frontend/src/renderer/components/Sidebar.tsx +++ b/apps/frontend/src/renderer/components/Sidebar.tsx @@ -19,7 +19,9 @@ import { Sparkles, GitBranch, HelpCircle, - Wrench + Wrench, + PanelLeft, + PanelLeftClose } from 'lucide-react'; import { Button } from './ui/button'; import { ScrollArea } from './ui/scroll-area'; @@ -44,7 +46,7 @@ import { removeProject, initializeProject } from '../stores/project-store'; -import { useSettingsStore } from '../stores/settings-store'; +import { useSettingsStore, saveSettings } from '../stores/settings-store'; import { AddProjectModal } from './AddProjectModal'; import { GitSetupModal } from './GitSetupModal'; import { RateLimitIndicator } from './RateLimitIndicator'; @@ -114,6 +116,13 @@ export function Sidebar({ const selectedProject = projects.find((p) => p.id === selectedProjectId); + // Sidebar collapsed state from settings + const isCollapsed = settings.sidebarCollapsed ?? false; + + const toggleSidebar = () => { + saveSettings({ sidebarCollapsed: !isCollapsed }); + }; + // Load env config when project changes to check GitHub/GitLab enabled state useEffect(() => { const loadEnvConfig = async () => { @@ -266,51 +275,111 @@ export function Sidebar({ const isActive = activeView === item.id; const Icon = item.icon; - return ( + const button = ( ); + + // Wrap in tooltip when collapsed + if (isCollapsed) { + return ( + + {button} + + {t(item.labelKey)} + {item.shortcut && ( + + {item.shortcut} + + )} + + + ); + } + + return button; }; return ( -
+
{/* Header with drag area - extra top padding for macOS traffic lights */} -
- Auto Claude +
+ {!isCollapsed && ( + Auto Claude + )}
+ {/* Toggle button */} +
+ + + + + + {isCollapsed ? t('actions.expandSidebar') : t('actions.collapseSidebar')} + + +
{/* Navigation */} -
+
{/* Project Section */}
-

- {t('sections.project')} -

+ {!isCollapsed && ( +

+ {t('sections.project')} +

+ )} @@ -327,25 +396,28 @@ export function Sidebar({ {/* Bottom section with Settings, Help, and New Task */} -
+
{/* Claude Code Status Badge */} - + {!isCollapsed && } {/* Settings and Help row */} -
+
- {t('tooltips.settings')} + {t('tooltips.settings')} @@ -358,20 +430,28 @@ export function Sidebar({ - {t('tooltips.help')} + {t('tooltips.help')}
{/* New Task button */} - - {selectedProject && !selectedProject.autoBuildPath && ( + + + + + {isCollapsed && ( + {t('actions.newTask')} + )} + + {!isCollapsed && selectedProject && !selectedProject.autoBuildPath && (

{t('messages.initializeToCreateTasks')}

diff --git a/apps/frontend/src/shared/i18n/locales/en/navigation.json b/apps/frontend/src/shared/i18n/locales/en/navigation.json index 204f9a9b..50483700 100644 --- a/apps/frontend/src/shared/i18n/locales/en/navigation.json +++ b/apps/frontend/src/shared/i18n/locales/en/navigation.json @@ -21,7 +21,9 @@ "actions": { "settings": "Settings", "help": "Help & Feedback", - "newTask": "New Task" + "newTask": "New Task", + "collapseSidebar": "Collapse Sidebar", + "expandSidebar": "Expand Sidebar" }, "tooltips": { "settings": "Application Settings", diff --git a/apps/frontend/src/shared/i18n/locales/fr/navigation.json b/apps/frontend/src/shared/i18n/locales/fr/navigation.json index c40ee36c..db779e10 100644 --- a/apps/frontend/src/shared/i18n/locales/fr/navigation.json +++ b/apps/frontend/src/shared/i18n/locales/fr/navigation.json @@ -21,7 +21,9 @@ "actions": { "settings": "Paramètres", "help": "Aide & Feedback", - "newTask": "Nouvelle tâche" + "newTask": "Nouvelle tâche", + "collapseSidebar": "Réduire la barre latérale", + "expandSidebar": "Développer la barre latérale" }, "tooltips": { "settings": "Paramètres de l'application", diff --git a/apps/frontend/src/shared/types/settings.ts b/apps/frontend/src/shared/types/settings.ts index f165b8e7..f7e83e9e 100644 --- a/apps/frontend/src/shared/types/settings.ts +++ b/apps/frontend/src/shared/types/settings.ts @@ -288,6 +288,8 @@ export interface AppSettings { autoNameClaudeTerminals?: boolean; // Track which version warnings have been shown (e.g., ["2.7.5"]) seenVersionWarnings?: string[]; + // Sidebar collapsed state (icons only when true) + sidebarCollapsed?: boolean; } // Auto-Claude Source Environment Configuration (for auto-claude repo .env)