From 6638c359450c94c8b3d959741feab0e4b948b372 Mon Sep 17 00:00:00 2001 From: webdevcody Date: Sun, 11 Jan 2026 16:02:25 -0500 Subject: [PATCH] refactor(sidebar): enhance sidebar responsiveness and improve layout - Updated sidebar component to include a mobile overlay backdrop when open. - Adjusted visibility of logo and footer elements based on sidebar state. - Improved layout and spacing for various components within the sidebar for better usability on different screen sizes. - Refined styles for buttons and project selectors to enhance visual consistency and responsiveness. --- apps/ui/src/components/layout/sidebar.tsx | 198 ++++++++++-------- .../sidebar/components/automaker-logo.tsx | 14 +- .../components/collapse-toggle-button.tsx | 4 +- .../project-selector-with-options.tsx | 4 +- .../sidebar/components/sidebar-footer.tsx | 10 +- .../sidebar/components/sidebar-header.tsx | 6 +- .../sidebar/components/sidebar-navigation.tsx | 8 +- .../src/components/views/dashboard-view.tsx | 135 ++++++------ apps/ui/src/routes/__root.tsx | 13 ++ 9 files changed, 215 insertions(+), 177 deletions(-) diff --git a/apps/ui/src/components/layout/sidebar.tsx b/apps/ui/src/components/layout/sidebar.tsx index 2933453a..a8c70cb6 100644 --- a/apps/ui/src/components/layout/sidebar.tsx +++ b/apps/ui/src/components/layout/sidebar.tsx @@ -257,110 +257,122 @@ export function Sidebar() { }; return ( - + {/* New Project Modal */} + + + ); } diff --git a/apps/ui/src/components/layout/sidebar/components/automaker-logo.tsx b/apps/ui/src/components/layout/sidebar/components/automaker-logo.tsx index baacbf4e..92b7af99 100644 --- a/apps/ui/src/components/layout/sidebar/components/automaker-logo.tsx +++ b/apps/ui/src/components/layout/sidebar/components/automaker-logo.tsx @@ -35,11 +35,11 @@ export function AutomakerLogo({ sidebarOpen, navigate }: AutomakerLogoProps) { onClick={() => navigate({ to: '/dashboard' })} data-testid="logo-button" > - {/* Collapsed logo - shown when sidebar is closed OR on small screens when sidebar is open */} + {/* Collapsed logo - only shown when sidebar is closed */}
- {/* Expanded logo - only shown when sidebar is open on large screens */} + {/* Expanded logo - shown when sidebar is open */} {sidebarOpen && ( -
+
- + automaker.
- + v{appVersion} {versionSuffix}
diff --git a/apps/ui/src/components/layout/sidebar/components/collapse-toggle-button.tsx b/apps/ui/src/components/layout/sidebar/components/collapse-toggle-button.tsx index 4c09056b..fc33f6ed 100644 --- a/apps/ui/src/components/layout/sidebar/components/collapse-toggle-button.tsx +++ b/apps/ui/src/components/layout/sidebar/components/collapse-toggle-button.tsx @@ -17,7 +17,9 @@ export function CollapseToggleButton({ - @@ -677,13 +684,15 @@ export function DashboardView() { {/* Favorites section */} {favoriteProjects.length > 0 && (
-
-
- +
+
+
-

Favorites

+

+ Favorites +

-
+
{favoriteProjects.map((project) => (
-
-
-
- +
+
+
+
-

+

{project.name}

-

+

{project.path}

{project.lastOpened && ( -

+

{new Date(project.lastOpened).toLocaleDateString()}

)}
-
+
@@ -750,13 +759,15 @@ export function DashboardView() { {/* Recent projects section */} {recentProjects.length > 0 && (
-
-
- +
+
+
-

Recent Projects

+

+ Recent Projects +

-
+
{recentProjects.map((project) => (
-
-
-
- +
+
+
+
-

+

{project.name}

-

+

{project.path}

{project.lastOpened && ( -

+

{new Date(project.lastOpened).toLocaleDateString()}

)}
-
+
diff --git a/apps/ui/src/routes/__root.tsx b/apps/ui/src/routes/__root.tsx index 6246b84e..74435498 100644 --- a/apps/ui/src/routes/__root.tsx +++ b/apps/ui/src/routes/__root.tsx @@ -27,6 +27,7 @@ import { performSettingsMigration, } from '@/hooks/use-settings-migration'; import { Toaster } from 'sonner'; +import { Menu } from 'lucide-react'; import { ThemeOption, themeOptions } from '@/config/theme-options'; import { SandboxRiskDialog } from '@/components/dialogs/sandbox-risk-dialog'; import { SandboxRejectionScreen } from '@/components/dialogs/sandbox-rejection-screen'; @@ -159,6 +160,8 @@ function RootLayoutContent() { skipSandboxWarning, setSkipSandboxWarning, fetchCodexModels, + sidebarOpen, + toggleSidebar, } = useAppStore(); const { setupComplete, codexCliStatus } = useSetupStore(); const navigate = useNavigate(); @@ -811,6 +814,16 @@ function RootLayoutContent() { /> )} + {/* Mobile menu toggle button - only shows when sidebar is closed on mobile */} + {!sidebarOpen && ( + + )}