`frontend/src/pages/Play.jsx` was 2280 lines holding 27 components. It is now `frontend/src/pages/Play/`: `index.jsx` with the page component, five panels, two drawers, the reports, the take pager, the refresh dialog, and the shared formatting helpers. Every line moved verbatim. A coverage check confirms every non-blank line of the original appears exactly once, in order, across the twelve files, and a name-resolution check confirms every identifier each file references is defined or imported there, with no unused imports. The line split stranded a comment at six of the boundaries. A leading comment sits above the section it describes, so each cut left one at the end of the file before it. All six moved to the section they describe, rewritten in the house style. `usePlaySession.js` is not here. The page component still owns all of the session state. Moving eighteen `useState` calls and seven `useEffect` calls is a rewrite rather than a move, and no frontend test would catch a mistake in it today, so it waits for Stage 5. Four stand-in providers under `backend/tools/` now define `last_usage = None`. The turn engine reads that attribute after every call, and the fixtures never defined it, so `tools.tree_fixture` crashed. That break predates this branch. Verified by 549 passing tests, a clean `npm run lint` and `npm run build`, and by driving the Play screen: the story view, all five panels, both drawers including the world-state edit form, the branch map, the refresh dialog, and the take pager stepping onto a take that lives on another branch. No console errors. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Dix4oGV3njgWRdu7P9t6r
46 lines
1.6 KiB
React
46 lines
1.6 KiB
React
import React from 'react'
|
|
import ReactDOM from 'react-dom/client'
|
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
|
|
import App from './App.jsx'
|
|
import Home from './pages/Home.jsx'
|
|
import Adventures from './pages/Adventures.jsx'
|
|
import Scenarios from './pages/Scenarios.jsx'
|
|
import ScenarioEditor from './pages/ScenarioEditor.jsx'
|
|
import Play from './pages/Play'
|
|
import Scripts from './pages/Scripts.jsx'
|
|
import ScriptEditor from './pages/ScriptEditor.jsx'
|
|
import Settings from './pages/Settings.jsx'
|
|
import Chat from './pages/Chat.jsx'
|
|
import Analytics from './pages/Analytics.jsx'
|
|
import { trackKeyboardInset } from './keyboard.js'
|
|
import './index.css'
|
|
|
|
trackKeyboardInset()
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: '/',
|
|
element: <App />,
|
|
children: [
|
|
{ index: true, element: <Home /> },
|
|
{ path: 'adventures', element: <Adventures /> },
|
|
{ path: 'scenarios', element: <Scenarios /> },
|
|
{ path: 'scenarios/:id', element: <ScenarioEditor /> },
|
|
{ path: 'play/:id', element: <Play /> },
|
|
{ path: 'scripts', element: <Scripts /> },
|
|
{ path: 'scripts/:id', element: <ScriptEditor /> },
|
|
{ path: 'settings', element: <Settings /> },
|
|
// Power users only — the page redirects home and the API 404s otherwise.
|
|
{ path: 'chat', element: <Chat /> },
|
|
// Owner only, by a separate allowlist; same redirect-and-404 treatment.
|
|
{ path: 'analytics', element: <Analytics /> },
|
|
],
|
|
},
|
|
])
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
<React.StrictMode>
|
|
<RouterProvider router={router} />
|
|
</React.StrictMode>,
|
|
)
|