diff --git a/DECISIONS.md b/DECISIONS.md index e1ad2b4..bc71a4e 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1104,3 +1104,9 @@ Implementation decisions not spelled out in `memory-bank/implementation-plan.md` - **Restore from the start screen never warns** (there's no company yet); in Settings it warns only when the current company is past the tutorial, as the CR asks. - **Success replaces the cached player state with the restored one** and refreshes boards, then goes to HQ; the server has already switched the device's session cookie. - **The device id is a random UUID in local storage**, sent only with restore requests for rate limiting; it isn't tied to the player. + +## Step 10K.10 + +- **Version is the web package's version, bumped to 0.10.0** (it was 0.0.0) to mark the Phase 10 build; **build is the git short hash** at build time ("dev" when built outside git), injected with Vite `define`. Tests use fixed stand-ins. +- **"Current screen" in debug info is the last screen before Settings**: the button lives in Settings, so the useful answer is where the player was when they opened it. The layout records it. +- **Player state now includes `playerId`** for debug info; it was only returned at sign-up. diff --git a/apps/server/src/game/player-state.ts b/apps/server/src/game/player-state.ts index fe3a2b9..48bd00b 100644 --- a/apps/server/src/game/player-state.ts +++ b/apps/server/src/game/player-state.ts @@ -67,6 +67,7 @@ export async function loadPlayerState( ); return { + playerId, company: { id: company.id, name: company.name, diff --git a/apps/web/package.json b/apps/web/package.json index 3c0aac2..dc6b7b3 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "@deadhead/web", - "version": "0.0.0", + "version": "0.10.0", "private": true, "type": "module", "scripts": { diff --git a/apps/web/src/build-info.ts b/apps/web/src/build-info.ts new file mode 100644 index 0000000..d8c84de --- /dev/null +++ b/apps/web/src/build-info.ts @@ -0,0 +1,6 @@ +declare const __APP_VERSION__: string; +declare const __APP_BUILD__: string; + +/** The game's version and build (git commit), baked in by Vite (CR-011). */ +export const APP_VERSION: string = __APP_VERSION__; +export const APP_BUILD: string = __APP_BUILD__; diff --git a/apps/web/src/layout/Layout.tsx b/apps/web/src/layout/Layout.tsx index fa9260f..4cd2362 100644 --- a/apps/web/src/layout/Layout.tsx +++ b/apps/web/src/layout/Layout.tsx @@ -3,6 +3,7 @@ import { Link, NavLink, Outlet } from "react-router"; import { GameClock } from "../clock/GameClock"; import { SCREENS, type ScreenPath } from "../routes"; import { Icon } from "../ui"; +import { useTrackScreen } from "./lastScreen"; export interface LayoutProps { /** Shown at the top right. Credits arrive with the player state (Step 8.5). */ @@ -25,6 +26,7 @@ export function Layout({ banner, attention = {}, }: LayoutProps) { + useTrackScreen(); return (