diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 53f869a..9abc643 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -254,6 +254,7 @@ Mock `electron-log` with `jest.unstable_mockModule('electron-log', ...)` in Node For renderer-side tests that exercise code which calls `logger.*`, set `global.window.api.invoke` to a `jest.fn()` and assert on `'log:send'` calls, or simply verify the call count is correct. + --- ### 5b — Shared Game Screen Components @@ -302,8 +303,107 @@ See `app/games/_template/interface.html` for a complete annotated example. --- +### 5d — Tutorial Service (`app/components/tutorialService.js`) + +All games **may** offer a tutorial shown automatically the first time the player opens the game. +The Tutorial Service provides a shared framework so every game's tutorial looks and behaves the +same way, with no repeated boilerplate. + +#### Stored state + +Tutorial seen-state is persisted under the top-level `tutorials` key of the player's progress +file — separate from game scores stored under `games`. The key for each game is its manifest `id`: + +```json +{ + "playerId": "default", + "games": { ... }, + "tutorials": { + "my-game-id": true + } +} +``` + +#### Defining tutorial steps + +Define tutorial steps as an array of `{ title, content }` objects. `content` may contain inline +HTML (e.g. ``, ``, `