From 331338b3024f22efcc93b023efd069aeb6bc8438 Mon Sep 17 00:00:00 2001 From: Gabriel Jablonski Date: Sat, 20 Dec 2025 18:12:27 -0300 Subject: [PATCH] fix(sidebar): improve active child route matching logic (#170) --- .../dashboard/components-next/sidebar/SidebarGroup.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue b/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue index 090bc2c42..c078cabdd 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue @@ -98,9 +98,11 @@ const activeChild = computed(() => { return rankedPage ?? activeOnPages[0]; } - return navigableChildren.value.find( - child => child.to && route.path.startsWith(resolvePath(child.to)) - ); + return navigableChildren.value.find(child => { + if (!child.to) return false; + const childPath = resolvePath(child.to); + return route.path === childPath || route.path.startsWith(childPath + '/'); + }); }); const hasActiveChild = computed(() => {