@@ -105,6 +105,19 @@ const navigationItems = [
105105 // },
106106]
107107
108+ // Helper function to check if a route is active
109+ const isRouteActive = (url : string ) => {
110+ const currentPath = router .currentRoute .value .path
111+
112+ // Special case: '/teams' should only match exactly '/teams', not '/teams/manage/...'
113+ if (url === ' /teams' ) {
114+ return currentPath === ' /teams'
115+ }
116+
117+ // For all other routes, use startsWith for sub-route matching
118+ return currentPath .startsWith (url )
119+ }
120+
108121// Fetch user data logic using UserService
109122const fetchUserData = async (forceRefresh = false ) => {
110123 try {
@@ -280,9 +293,8 @@ onUnmounted(() => {
280293 <SidebarMenuItem v-for =" item in navigationItems" :key =" item.title" >
281294 <SidebarMenuButton
282295 @click =" navigateTo(item.url)"
283- :is-active =" router.currentRoute.value.path === item.url"
296+ :is-active =" isRouteActive( item.url) "
284297 class =" w-full justify-start"
285- :aria-current =" router.currentRoute.value.path === item.url ? 'page' : undefined"
286298 >
287299 <component :is =" item.icon" class =" mr-2 h-4 w-4 shrink-0" />
288300 <span >{{ item.title }}</span >
@@ -299,9 +311,8 @@ onUnmounted(() => {
299311 <SidebarMenuItem v-for =" item in teamItems" :key =" item.title" >
300312 <SidebarMenuButton
301313 @click =" navigateTo(item.url)"
302- :is-active =" router.currentRoute.value.path === item.url"
314+ :is-active =" isRouteActive( item.url) "
303315 class =" w-full justify-start"
304- :aria-current =" router.currentRoute.value.path === item.url ? 'page' : undefined"
305316 >
306317 <component :is =" item.icon" class =" mr-2 h-4 w-4 shrink-0" />
307318 <span >{{ item.title }}</span >
@@ -319,9 +330,8 @@ onUnmounted(() => {
319330 <SidebarMenuItem >
320331 <SidebarMenuButton
321332 @click =" navigateTo('/admin/settings')"
322- :is-active =" router.currentRoute.value.path === '/admin/settings'"
333+ :is-active =" router.currentRoute.value.path.startsWith( '/admin/settings') "
323334 class =" w-full justify-start"
324- :aria-current =" router.currentRoute.value.path === '/admin/settings' ? 'page' : undefined"
325335 >
326336 <FileSliders class =" mr-2 h-4 w-4 shrink-0" />
327337 <span >{{ t('sidebar.adminArea.globalSettings') }}</span >
@@ -330,9 +340,8 @@ onUnmounted(() => {
330340 <SidebarMenuItem >
331341 <SidebarMenuButton
332342 @click =" navigateTo('/admin/users')"
333- :is-active =" router.currentRoute.value.path === '/admin/users'"
343+ :is-active =" router.currentRoute.value.path.startsWith( '/admin/users') "
334344 class =" w-full justify-start"
335- :aria-current =" router.currentRoute.value.path === '/admin/users' ? 'page' : undefined"
336345 >
337346 <Users class =" mr-2 h-4 w-4 shrink-0" />
338347 <span >{{ t('sidebar.adminArea.users') }}</span >
@@ -343,7 +352,6 @@ onUnmounted(() => {
343352 @click =" navigateTo('/admin/mcp-server-catalog')"
344353 :is-active =" router.currentRoute.value.path.startsWith('/admin/mcp-server-catalog')"
345354 class =" w-full justify-start"
346- :aria-current =" router.currentRoute.value.path.startsWith('/admin/mcp-server-catalog') ? 'page' : undefined"
347355 >
348356 <Server class =" mr-2 h-4 w-4 shrink-0" />
349357 <span >{{ t('sidebar.adminArea.mcpCatalog') }}</span >
@@ -354,7 +362,6 @@ onUnmounted(() => {
354362 @click =" navigateTo('/admin/mcp-categories')"
355363 :is-active =" router.currentRoute.value.path.startsWith('/admin/mcp-categories')"
356364 class =" w-full justify-start"
357- :aria-current =" router.currentRoute.value.path.startsWith('/admin/mcp-categories') ? 'page' : undefined"
358365 >
359366 <FolderTree class =" mr-2 h-4 w-4 shrink-0" />
360367 <span >{{ t('sidebar.adminArea.mcpCategories') }}</span >
@@ -365,7 +372,6 @@ onUnmounted(() => {
365372 @click =" navigateTo('/admin/satellites')"
366373 :is-active =" router.currentRoute.value.path.startsWith('/admin/satellites')"
367374 class =" w-full justify-start"
368- :aria-current =" router.currentRoute.value.path.startsWith('/admin/satellites') ? 'page' : undefined"
369375 >
370376 <Satellite class =" mr-2 h-4 w-4 shrink-0" />
371377 <span >{{ t('sidebar.adminArea.satellites') }}</span >
@@ -376,7 +382,6 @@ onUnmounted(() => {
376382 @click =" navigateTo('/admin/jobs')"
377383 :is-active =" router.currentRoute.value.path.startsWith('/admin/jobs')"
378384 class =" w-full justify-start"
379- :aria-current =" router.currentRoute.value.path.startsWith('/admin/jobs') ? 'page' : undefined"
380385 >
381386 <ListTodo class =" mr-2 h-4 w-4 shrink-0" />
382387 <span >{{ t('sidebar.adminArea.backgroundJobs') }}</span >
0 commit comments