diff --git a/studio/frontend/src/app/routes/__root.tsx b/studio/frontend/src/app/routes/__root.tsx index 0725d383c7..d7780c6743 100644 --- a/studio/frontend/src/app/routes/__root.tsx +++ b/studio/frontend/src/app/routes/__root.tsx @@ -15,10 +15,16 @@ import { AppProvider } from "../provider"; const CHAT_ONLY_ALLOWED = new Set(["/", "/chat", "/login", "/signup", "/change-password"]); +function isChatOnlyAllowed(pathname: string): boolean { + if (CHAT_ONLY_ALLOWED.has(pathname)) return true; + if (pathname === "/data-recipes" || pathname.startsWith("/data-recipes/")) return true; + return false; +} + export const Route = createRootRoute({ beforeLoad: ({ location }) => { const chatOnly = usePlatformStore.getState().isChatOnly(); - if (chatOnly && !CHAT_ONLY_ALLOWED.has(location.pathname)) { + if (chatOnly && !isChatOnlyAllowed(location.pathname)) { throw redirect({ to: "/chat" }); } }, diff --git a/studio/frontend/src/components/navbar.tsx b/studio/frontend/src/components/navbar.tsx index 0f159add77..03ea77a8b2 100644 --- a/studio/frontend/src/components/navbar.tsx +++ b/studio/frontend/src/components/navbar.tsx @@ -93,7 +93,7 @@ export function Navbar() { const disabledByTraining = isTrainingRunning && item.href !== "/studio"; const disabledByDevice = - chatOnly && item.href !== "/chat"; + chatOnly && item.href !== "/chat" && item.href !== "/data-recipes"; if (!item.enabled || disabledByTraining || disabledByDevice) { return (