From 403c51c31b3c7380f1f173811d645272b0153e9b Mon Sep 17 00:00:00 2001 From: LTbinglingfeng Date: Sat, 13 Jun 2026 02:03:44 +0800 Subject: [PATCH] refactor(layout): drop transition rules for removed provider sub-routes /ai-providers/* now redirects to the single workbench page, so the per-brand route ordering and the in-section slide variant can never apply. Generic prefix matching already covers the redirect flash. --- src/components/layout/MainLayout.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/components/layout/MainLayout.tsx b/src/components/layout/MainLayout.tsx index df564dd..4d9889c 100644 --- a/src/components/layout/MainLayout.tsx +++ b/src/components/layout/MainLayout.tsx @@ -617,20 +617,6 @@ export function MainLayout() { pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname; const normalizedPath = trimmedPath === '/dashboard' ? '/' : trimmedPath; - const aiProvidersIndex = navOrder.indexOf('/ai-providers'); - if (aiProvidersIndex !== -1) { - if (normalizedPath === '/ai-providers') return aiProvidersIndex; - if (normalizedPath.startsWith('/ai-providers/')) { - if (normalizedPath.startsWith('/ai-providers/gemini')) return aiProvidersIndex + 0.1; - if (normalizedPath.startsWith('/ai-providers/codex')) return aiProvidersIndex + 0.2; - if (normalizedPath.startsWith('/ai-providers/claude')) return aiProvidersIndex + 0.3; - if (normalizedPath.startsWith('/ai-providers/vertex')) return aiProvidersIndex + 0.4; - if (normalizedPath.startsWith('/ai-providers/ampcode')) return aiProvidersIndex + 0.5; - if (normalizedPath.startsWith('/ai-providers/openai')) return aiProvidersIndex + 0.6; - return aiProvidersIndex + 0.05; - } - } - const authFilesIndex = navOrder.indexOf('/auth-files'); if (authFilesIndex !== -1) { if (normalizedPath === '/auth-files') return authFilesIndex; @@ -660,10 +646,7 @@ export function MainLayout() { const to = normalize(toPathname); const isAuthFiles = (pathname: string) => pathname === '/auth-files' || pathname.startsWith('/auth-files/'); - const isAiProviders = (pathname: string) => - pathname === '/ai-providers' || pathname.startsWith('/ai-providers/'); if (isAuthFiles(from) && isAuthFiles(to)) return 'ios'; - if (isAiProviders(from) && isAiProviders(to)) return 'ios'; return 'vertical'; }, []);