diff --git a/apps/rowboat/app/projects/[projectId]/playground/app.tsx b/apps/rowboat/app/projects/[projectId]/playground/app.tsx index a59f1b3e..a61cc86a 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/app.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/app.tsx @@ -5,7 +5,7 @@ import { z } from "zod"; import { PlaygroundChat, SimulationData, SimulationScenarioData, Workflow } from "@/app/lib/types"; import { SimulateScenarioOption, SimulateURLOption } from "./simulation-options"; import { Chat } from "./chat"; -import { useSearchParams } from "next/navigation"; +import { useSearchParams, useRouter } from "next/navigation"; import { ActionButton, Pane } from "../workflow/pane"; import { apiV1 } from "rowboat-shared"; import { EllipsisVerticalIcon, MessageSquarePlusIcon, PlayIcon } from "lucide-react"; @@ -29,6 +29,7 @@ export function App({ messageSubscriber?: (messages: z.infer[]) => void; }) { const searchParams = useSearchParams(); + const router = useRouter(); const initialChatId = useMemo(() => searchParams.get('chatId'), [searchParams]); const [existingChatId, setExistingChatId] = useState(initialChatId); const [loadingChat, setLoadingChat] = useState(false); @@ -75,7 +76,7 @@ export function App({ } function handleSimulateButtonClick() { - setViewSimulationMenu(true); + router.push(`/projects/${projectId}/simulation`); } function handleNewChatButtonClick() { @@ -100,7 +101,7 @@ export function App({ > New chat , - !viewSimulationMenu && } onClick={handleSimulateButtonClick}