From 45a6cb21730a3604da1e46709cc69f42ed6f1e64 Mon Sep 17 00:00:00 2001 From: KodekaTeam Date: Fri, 4 Sep 2026 00:37:03 +0700 Subject: [PATCH] feat: Update sidebar controls and navigation for improved UX and accessibility --- src/app/globals.css | 39 ++++++++++++++++- src/components/DashboardLayout.tsx | 5 ++- src/components/Sidebar.tsx | 69 ++++++------------------------ src/components/Topbar.tsx | 29 ++++++++++++- 4 files changed, 83 insertions(+), 59 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index fe76ad1..bd1fb28 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -978,7 +978,44 @@ body { transition: width 0.5s ease; } -/* Sidebar nav items */ +/* Sidebar controls and navigation */ +.sidebar-trigger { + width: 32px; + height: 32px; + flex: 0 0 32px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0; + border: 1px solid transparent; + border-radius: 7px; + background: transparent; + color: var(--text-secondary); + cursor: pointer; + transition: + background 0.15s ease, + border-color 0.15s ease, + color 0.15s ease; +} + +.sidebar-trigger:hover { + background: var(--bg-input); + border-color: var(--border); + color: var(--text-primary); +} + +.sidebar-trigger:focus-visible { + outline: 2px solid var(--accent-blue); + outline-offset: 2px; +} + +.topbar-section-divider { + width: 1px; + height: 20px; + flex: 0 0 1px; + background: var(--border); +} + .nav-item { display: flex; align-items: center; diff --git a/src/components/DashboardLayout.tsx b/src/components/DashboardLayout.tsx index 364be43..92bcb55 100644 --- a/src/components/DashboardLayout.tsx +++ b/src/components/DashboardLayout.tsx @@ -74,7 +74,6 @@ export default function DashboardLayout({ {/* Sidebar — handles its own backdrop overlay for mobile */} setCollapsed(!collapsed)} isMobile={isMobile} mobileOpen={mobileOpen} onMobileClose={() => setMobileOpen(false)} @@ -96,6 +95,10 @@ export default function DashboardLayout({ onMobileMenuToggle={ isMobile ? () => setMobileOpen(!mobileOpen) : undefined } + onSidebarToggle={ + isMobile ? undefined : () => setCollapsed((value) => !value) + } + sidebarCollapsed={collapsed} />
void; /** Mobile: whether screen is narrow */ isMobile: boolean; /** Mobile: whether the drawer is open */ @@ -27,7 +25,6 @@ interface SidebarProps { export default function Sidebar({ collapsed, - onToggle, isMobile, mobileOpen, onMobileClose, @@ -124,6 +121,7 @@ export default function Sidebar({ const sidebar = (