From 44a37317d1606da8f0c301bd3bd9df926481b195 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Thu, 2 Apr 2026 23:53:09 +0200 Subject: [PATCH] fix: cmd-k context key for tab reset and Enter-to-navigate on admin pages Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/components/LayoutShell.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ui/src/components/LayoutShell.tsx b/ui/src/components/LayoutShell.tsx index a503f673..d868ae86 100644 --- a/ui/src/components/LayoutShell.tsx +++ b/ui/src/components/LayoutShell.tsx @@ -533,17 +533,23 @@ function LayoutContent() { const handlePaletteSubmit = useCallback((query: string) => { if (isAdminPage) { - // Navigate to top result — CommandPalette calls onSelect for the top result - // when Enter is pressed, so this is only reached if there are no results. - // Navigate to RBAC page as fallback. - navigate('/admin/rbac'); + // Find first matching admin result and navigate to it + const q = query.toLowerCase(); + const match = adminSearchData.find( + (r) => r.title.toLowerCase().includes(q) || r.meta.toLowerCase().includes(q), + ); + if (match) { + handlePaletteSelect(match); + } else { + navigate('/admin/rbac'); + } } else { const baseParts = ['/exchanges']; if (scope.appId) baseParts.push(scope.appId); if (scope.routeId) baseParts.push(scope.routeId); navigate(`${baseParts.join('/')}?text=${encodeURIComponent(query)}`); } - }, [isAdminPage, navigate, scope.appId, scope.routeId]); + }, [isAdminPage, adminSearchData, handlePaletteSelect, navigate, scope.appId, scope.routeId]); const handleSidebarNavigate = useCallback((path: string) => { const state = { sidebarReveal: path }; @@ -658,6 +664,7 @@ function LayoutContent() { onLogout={handleLogout} /> setPaletteOpen(false)} onOpen={() => setPaletteOpen(true)}