From 226fd1effc9d869ab7fdbf97b20f3f6b532ae31e Mon Sep 17 00:00:00 2001 From: Kaan Karaca Date: Mon, 6 Apr 2026 17:18:09 +0300 Subject: [PATCH 1/2] refactor: replace horizontal nav with vertical sidebar nav Use shadcn SidebarMenu primitives instead of custom layout code. Move navigation from sidebar header to content area. --- .../renderer/src/components/app-sidebar.tsx | 41 ++----- .../src/components/sidebar/horizontal-nav.tsx | 114 ------------------ .../src/components/sidebar/sidebar-nav.tsx | 66 ++++++++++ 3 files changed, 76 insertions(+), 145 deletions(-) delete mode 100644 apps/desktop/src/renderer/src/components/sidebar/horizontal-nav.tsx create mode 100644 apps/desktop/src/renderer/src/components/sidebar/sidebar-nav.tsx diff --git a/apps/desktop/src/renderer/src/components/app-sidebar.tsx b/apps/desktop/src/renderer/src/components/app-sidebar.tsx index 0d84cd55e..66262d660 100644 --- a/apps/desktop/src/renderer/src/components/app-sidebar.tsx +++ b/apps/desktop/src/renderer/src/components/app-sidebar.tsx @@ -34,7 +34,7 @@ import { SidebarRail, useSidebar } from '@/components/ui/sidebar' -import { HorizontalNav } from '@/components/sidebar/horizontal-nav' +import { SidebarNav } from '@/components/sidebar/sidebar-nav' import { SidebarSection } from '@/components/sidebar-section' import { NotesTree } from '@/components/notes-tree' import { SidebarTagList } from '@/components/sidebar/sidebar-tag-list' @@ -75,19 +75,7 @@ const mainNav: { { title: 'Tasks', page: 'tasks', icon: SidebarTasks, shortcut: '⌘⌥4' } ] -function SidebarHeaderContent({ - items, - isActive, - onNavClick, - inboxCount, - todayTasksCount -}: { - items: typeof mainNav - isActive: (item: import('@/contexts/tabs/types').SidebarItem) => boolean - onNavClick: (page: AppPage) => (e: React.MouseEvent) => void - inboxCount: number - todayTasksCount: number -}) { +function SidebarHeaderContent() { const { state } = useSidebar() const isCollapsed = state === 'collapsed' @@ -104,16 +92,6 @@ function SidebarHeaderContent({ - - {/* Horizontal icon nav — between traffic lights and search */} - ) } @@ -474,14 +452,15 @@ function AppSidebarInner({ currentPage, viewCounts, ...props }: AppSidebarProps) return ( - + + {mainContent} diff --git a/apps/desktop/src/renderer/src/components/sidebar/horizontal-nav.tsx b/apps/desktop/src/renderer/src/components/sidebar/horizontal-nav.tsx deleted file mode 100644 index d86b20518..000000000 --- a/apps/desktop/src/renderer/src/components/sidebar/horizontal-nav.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { cn } from '@/lib/utils' -import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import type { AppPage } from '@/App' -import type { SidebarItem, TabType } from '@/contexts/tabs/types' - -interface NavItem { - title: string - page: AppPage - icon: React.ComponentType<{ className?: string; size?: number }> - shortcut?: string -} - -interface HorizontalNavProps { - items: NavItem[] - isActive: (item: SidebarItem) => boolean - onNavClick: (page: AppPage) => (e: React.MouseEvent) => void - inboxCount: number - todayTasksCount: number - isCollapsed?: boolean -} - -export function HorizontalNav({ - items, - isActive, - onNavClick, - inboxCount, - todayTasksCount, - isCollapsed = false -}: HorizontalNavProps) { - return ( - - ) -} diff --git a/apps/desktop/src/renderer/src/components/sidebar/sidebar-nav.tsx b/apps/desktop/src/renderer/src/components/sidebar/sidebar-nav.tsx new file mode 100644 index 000000000..de74ef606 --- /dev/null +++ b/apps/desktop/src/renderer/src/components/sidebar/sidebar-nav.tsx @@ -0,0 +1,66 @@ +import { + SidebarGroup, + SidebarMenu, + SidebarMenuItem, + SidebarMenuButton, + SidebarMenuBadge +} from '@/components/ui/sidebar' +import type { AppPage } from '@/App' +import type { SidebarItem, TabType } from '@/contexts/tabs/types' + +interface NavItem { + title: string + page: AppPage + icon: React.ComponentType<{ className?: string; size?: number }> + shortcut?: string +} + +interface SidebarNavProps { + items: NavItem[] + isActive: (item: SidebarItem) => boolean + onNavClick: (page: AppPage) => (e: React.MouseEvent) => void + inboxCount: number + todayTasksCount: number +} + +export function SidebarNav({ + items, + isActive, + onNavClick, + inboxCount, + todayTasksCount +}: SidebarNavProps) { + return ( + + + {items.map((item) => { + const sidebarItem: SidebarItem = { + type: item.page as TabType, + title: item.title, + path: `/${item.page}` + } + const active = isActive(sidebarItem) + const badgeCount = + item.page === 'inbox' ? inboxCount : item.page === 'tasks' ? todayTasksCount : 0 + const tooltipLabel = item.shortcut ? `${item.title} ${item.shortcut}` : item.title + + return ( + + + + {item.title} + + {badgeCount > 0 && ( + {badgeCount > 9 ? '9+' : badgeCount} + )} + + ) + })} + + + ) +} From 6614a4c665f68a14ac1fad443d4425b429d04aec Mon Sep 17 00:00:00 2001 From: Kaan Karaca Date: Mon, 6 Apr 2026 17:18:13 +0300 Subject: [PATCH 2/2] docs: add vertical sidebar navigation to changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7098a872..526298eaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ Format: weekly entries grouped by feature area. --- +## 2026-04-06 — Vertical Sidebar Navigation + +### Changed +- Replace horizontal nav with vertical sidebar nav using shadcn SidebarMenu primitives +- Move navigation (Inbox, Home, Journal, Tasks) from sidebar header to sidebar content area +- Simplify SidebarHeaderContent to only render traffic lights and vault switcher + +--- + ## 2026-04-06 — Split View Polish ### Fixed