diff --git a/apps/studio/components/interfaces/App/CommandMenu/RecentRoutes.tsx b/apps/studio/components/interfaces/App/CommandMenu/RecentRoutes.tsx index b4f6813c85d..c5edbb1f54b 100644 --- a/apps/studio/components/interfaces/App/CommandMenu/RecentRoutes.tsx +++ b/apps/studio/components/interfaces/App/CommandMenu/RecentRoutes.tsx @@ -1,12 +1,12 @@ import { History } from 'lucide-react' +import { useRouter } from 'next/router' import { useMemo } from 'react' +import { useParams } from 'common' import { useRecentRoutes } from 'hooks/misc/useRecentRoutes' import { useRegisterCommands, useSetCommandMenuOpen } from 'ui-patterns/CommandMenu' import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils' import { orderCommandSectionsByPriority } from './ordering' -import { useRouter } from 'next/router' -import { useParams } from 'common' export function useRecentRoutesCommands() { const router = useRouter() @@ -15,22 +15,20 @@ export function useRecentRoutesCommands() { const { recentRoutes } = useRecentRoutes() const commands = useMemo(() => { - return recentRoutes.map((route) => { - // Format: "Parent > Child" (e.g., "Authentication > Users") - const displayName = route.parentLabel - ? `${route.parentLabel} > ${route.childName}` - : route.childName - - return { - id: `recent-${route.key}`, - name: displayName, - action: () => { - router.push(route.link) - setIsOpen(false) - }, - icon: () => , - } - }) + return recentRoutes.map((route) => ({ + id: `recent-${route.key}`, + name: route.childName, + // Include parent label in value for search + value: route.parentLabel ? `${route.childName} ${route.parentLabel}` : route.childName, + action: () => { + router.push(route.link) + setIsOpen(false) + }, + icon: () => , + badge: route.parentLabel + ? () => {route.parentLabel} + : undefined, + })) }, [recentRoutes, router, setIsOpen]) useRegisterCommands(COMMAND_MENU_SECTIONS.RECENTS, commands, { diff --git a/apps/studio/components/interfaces/Sidebar.tsx b/apps/studio/components/interfaces/Sidebar.tsx index c60a8359146..cbdef593f7a 100644 --- a/apps/studio/components/interfaces/Sidebar.tsx +++ b/apps/studio/components/interfaces/Sidebar.tsx @@ -228,11 +228,7 @@ const ProjectLinks = () => { const { securityLints, errorLints } = useLints() const showReports = useIsFeatureEnabled('reports:all') const { mutate: sendEvent } = useSendEventMutation() - const { recentRoutes, trackRoute } = useRecentRoutes() - const [sidebarBehaviour] = useLocalStorageQuery( - LOCAL_STORAGE_KEYS.SIDEBAR_BEHAVIOR, - DEFAULT_SIDEBAR_BEHAVIOR - ) + const { trackRoute } = useRecentRoutes() const isNewAPIDocsEnabled = useIsAPIDocsSidePanelEnabled() const { isEnabled: isUnifiedLogsEnabled } = useUnifiedLogsPreview() @@ -397,33 +393,6 @@ const ProjectLinks = () => { /> ))} - {recentRoutes.length > 0 && ( - <> - - - Recents - {recentRoutes.map((route) => ( - - - - - {route.childName} - {route.parentLabel && ( - {route.parentLabel} - )} - - - - - ))} - - > - )} {productRoutes.map((route, i) => (