From dfbb51b582bbbf11fb9d1a3a1d0ab839cb21fd83 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sun, 22 Mar 2026 19:32:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Home=20icon=20active=20state=20=E2=80=94?= =?UTF-8?q?=20exact=20match=20"/"=20instead=20of=20startsWith?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit matchPaths: ['/'] with startsWith('/') matched every route, keeping Home highlighted on all pages. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/layout/Sidebar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index b2235008..4d774098 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -160,7 +160,9 @@ export function Sidebar() { /* ── Active detection ─────────────────────────────── */ const isActive = (item: NavEntry) => { - if (item.matchPaths) return item.matchPaths.some(p => location.pathname.startsWith(p)) + if (item.matchPaths) return item.matchPaths.some(p => + p === '/' ? location.pathname === '/' : location.pathname.startsWith(p) + ) if (item.href === '/') return location.pathname === '/' return location.pathname.startsWith(item.href) }