diff --git a/frontend/src/components/routing/AssistantSessionRedirect.tsx b/frontend/src/components/routing/AssistantSessionRedirect.tsx new file mode 100644 index 00000000..555b8f08 --- /dev/null +++ b/frontend/src/components/routing/AssistantSessionRedirect.tsx @@ -0,0 +1,11 @@ +import { Navigate, useParams } from 'react-router-dom' + +/** + * Permanent 301-style redirect from /assistant/:sessionId to /pilot/:sessionId. + * Used by the Phase 1 route-rename; paired with a bare-path redirect to /pilot. + * SPA redirects replace history so the legacy URL does not linger in back-nav. + */ +export function AssistantSessionRedirect() { + const { sessionId } = useParams<{ sessionId: string }>() + return +} diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index 9fb6cc46..44e4fa30 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -1,4 +1,5 @@ -import { createBrowserRouter, Navigate, useParams } from 'react-router-dom' +import { createBrowserRouter, Navigate } from 'react-router-dom' +import { AssistantSessionRedirect } from '@/components/routing/AssistantSessionRedirect' import * as Sentry from '@sentry/react' import { Suspense } from 'react' import { AppLayout, ProtectedRoute } from '@/components/layout' @@ -102,16 +103,6 @@ function page(Component: React.LazyExoticComponent) { ) } -/** - * Permanent 301-style redirect from /assistant/:sessionId to /pilot/:sessionId. - * Used by the Phase 1 route-rename; paired with a bare-path redirect to /pilot. - * SPA redirects replace history so the legacy URL does not linger in back-nav. - */ -function AssistantSessionRedirect() { - const { sessionId } = useParams<{ sessionId: string }>() - return -} - export const router = sentryCreateBrowserRouter([ { path: '/landing',