From 3f66a8ed15af898c7c912d29454e6085d4edb8c9 Mon Sep 17 00:00:00 2001 From: Commander AI Lab Date: Wed, 18 Mar 2026 03:39:03 +0000 Subject: [PATCH] feat: add 4-player batch simulator React page with N-player API endpoint - Add POST /api/sim/run-n-player endpoint accepting 2-4 deck IDs for N-player batch simulations using the existing engine.run_n() method - Add _run_sim_thread_n_player tracking per-seat wins and stats - Create SimulatorPage.tsx with 4 deck selection slots, config row, progress bar, results table, CSS bar chart, and per-game logs - Add simulator types in frontend/src/types/simulator.ts - Add /simulator route and nav bar to App.tsx Co-Authored-By: Claude Opus 4.6 --- frontend/src/App.tsx | 33 ++- frontend/src/pages/SimulatorPage.tsx | 391 +++++++++++++++++++++++++++ frontend/src/types/simulator.ts | 28 ++ routes/deepseek.py | 137 ++++++++++ 4 files changed, 588 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/SimulatorPage.tsx create mode 100644 frontend/src/types/simulator.ts diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 07acb0f..ff77bbb 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,15 +1,46 @@ -import { BrowserRouter, Routes, Route } from 'react-router-dom'; +import { BrowserRouter, Routes, Route, Link, useLocation } from 'react-router-dom'; import LobbyPage from './pages/LobbyPage'; import RoomPage from './pages/RoomPage'; import GamePage from './pages/GamePage'; +import SimulatorPage from './pages/SimulatorPage'; + +function Nav() { + const location = useLocation(); + // Hide nav on active game pages + if (location.pathname.startsWith('/game/')) return null; + const links = [ + { to: '/', label: 'Lobby' }, + { to: '/simulator', label: 'Simulator' }, + ]; + return ( + + ); +} function App() { return ( +