|
| 1 | +# PR_26162_038-game-workspace-controls-cleanup |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- PASS: Current branch is `main`. |
| 5 | +- Expected branch: `main`. |
| 6 | +- Evidence: `git status --short --branch` returned `## main...origin/main` before edits. |
| 7 | + |
| 8 | +## Requirement Checklist |
| 9 | +- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before implementation. |
| 10 | +- PASS: Stacked on the PR_26162_037 Game Workspace/Game Journey rename state already present in the repo. |
| 11 | +- PASS: Removed duplicate leftover `toolbox/project-workspace` JavaScript artifacts. |
| 12 | +- PASS: Kept `toolbox/project-workspace/index.html` only as an explicitly deprecated old-link shim to Game Workspace. |
| 13 | +- PASS: Audited remaining Project terminology and removed active PR_037 cleanup leftovers in Controls. |
| 14 | +- PASS: Renamed Controls game mapping persistence from dropped `projectId` writes to schema-backed `gameId` writes. |
| 15 | +- PASS: Preserved `projectId` only as a compatibility read fallback for existing legacy in-memory rows before normalization. |
| 16 | +- PASS: Reverted unrelated generated lane-report churn from `npm run test:workspace-v2`; retained only requested V8 coverage output. |
| 17 | +- PASS: Regenerated final search evidence from the actual repo tree. |
| 18 | +- PASS: Add Game Control visibly adds the full normalized game control set. |
| 19 | +- PASS: Mapping count updates to the visible row count. |
| 20 | +- PASS: Missing Game Control Mapping disappears after rows exist. |
| 21 | +- PASS: Common rows are enabled and alternate rows are disabled. |
| 22 | +- PASS: Rows display the requested columns: Enabled, Normalized Action Type, Usage Label, Input Family, D, H, U, DC, Drag, Axis, Object, State, Actions. |
| 23 | +- PASS: Devices list renders seven accessible device/input capability rows with `title` and `aria-label` help text from shared engine input capability descriptors. |
| 24 | +- PASS: Generic keyboard rows can be added and configured without binding to a physical user device. |
| 25 | +- PASS: Generic mouse rows can be added and configured without binding to a physical user device. |
| 26 | +- PASS: Account User Controls remains the physical user-specific mapping surface. |
| 27 | +- PASS: Controls continues to use `src/engine/input` contracts and does not implement local keyboard/mouse/gamepad polling. |
| 28 | +- PASS: No sample JSON, auth, production DB, or unrelated runtime changes were added. |
| 29 | +- PASS: Required Playwright coverage was added/updated. |
| 30 | +- PASS: Required V8 coverage report was produced at `docs_build/dev/reports/playwright_v8_coverage_report.txt`. |
| 31 | + |
| 32 | +## Final Search Evidence |
| 33 | +- PASS: `rg -n "Project Workspace|Project Journey|Project Progress|Project Status|Project Identity|Project Build Path" toolbox src/dev-runtime assets/theme-v2 tests/playwright package.json scripts -g "!docs_build/dev/reports/**"` returns only `tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs:55`, a negative assertion that the deprecated page does not display Project Workspace. |
| 34 | +- PASS: `rg -n "project-workspace|project-journey" toolbox src/dev-runtime assets/theme-v2 tests/playwright package.json scripts -g "!docs_build/dev/reports/**"` returns only `tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs:50`, the intentional deprecated route validation. |
| 35 | +- PASS: `Get-ChildItem -Recurse toolbox/project-workspace -File` returns only `toolbox/project-workspace/index.html`. |
| 36 | +- PASS: `Get-ChildItem -Recurse toolbox/project-journey -File` returns no files. |
| 37 | +- PASS: `rg -n "project-owned|Project" toolbox/controls toolbox/game-workspace toolbox/game-journey src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js tests/playwright/tools/InputMappingV2Tool.spec.mjs tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs -g "!docs_build/dev/reports/**"` returns only the test negative assertion for Project Workspace. |
| 38 | +- PASS with documented compatibility: `rg -n "projectId" src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` returns compatibility fallback reads only. New Controls game input and custom action rows persist with `gameId`. |
| 39 | +- DOCUMENTED: Broader `Project` hits remain in unrelated palette/assets compatibility surfaces such as Project Swatches, Project Assets, and `ownerProjectId`. They were not renamed in this Controls cleanup PR because they are outside the PR_037 old/new workflow mappings and would require a separate palette/assets rename PR. |
| 40 | + |
| 41 | +## Changed Files |
| 42 | +- `docs_build/dev/reports/PR_26162_038-game-workspace-controls-cleanup.md` |
| 43 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 44 | +- `docs_build/dev/reports/codex_review.diff` |
| 45 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 46 | +- `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 47 | +- `tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs` |
| 48 | +- `tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 49 | +- `toolbox/controls/controls.js` |
| 50 | +- `toolbox/controls/index.html` |
| 51 | +- `toolbox/project-workspace/index.html` |
| 52 | +- `toolbox/project-workspace/project-workspace-api-client.js` deleted |
| 53 | +- `toolbox/project-workspace/project-workspace.js` deleted |
| 54 | + |
| 55 | +## Impacted Lanes |
| 56 | +- Controls tool runtime lane. |
| 57 | +- Controls shared DB/mock adapter lane. |
| 58 | +- Game Workspace/Game Journey route cleanup lane. |
| 59 | +- Workspace contract lane through required `npm run test:workspace-v2`. |
| 60 | +- Playwright impacted: Yes. |
| 61 | + |
| 62 | +## Skipped Lanes |
| 63 | +- Engine input lane: SKIPPED because no `src/engine/input` files changed. Existing shared input service usage was validated by Playwright source checks and runtime coverage. |
| 64 | +- Samples lane: SKIPPED because no samples or sample JSON were changed, and the request explicitly scoped cleanup to Game Workspace route cleanup and Controls behavior. |
| 65 | +- Full samples smoke: SKIPPED for the same reason. |
| 66 | + |
| 67 | +## Samples Validation Decision |
| 68 | +- SKIP: No sample JSON alignment, sample launch behavior, or samples smoke was in scope. |
| 69 | + |
| 70 | +## Validation Performed |
| 71 | +- PASS: `node --check toolbox/controls/controls.js` |
| 72 | +- PASS: `node --check src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 73 | +- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 74 | +- PASS: `node --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs` |
| 75 | +- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --reporter=line` - 7 passed. |
| 76 | +- PASS: `npx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs tests/playwright/tools/GameJourneyTool.spec.mjs --reporter=line` - 21 passed. |
| 77 | +- PASS: `npm run test:workspace-v2` - workspace-contract lane passed, 5 passed. |
| 78 | +- PASS: Final targeted Controls Playwright run regenerated V8 coverage after workspace-v2. |
| 79 | + |
| 80 | +## Playwright Result |
| 81 | +- PASS: Controls/Input Mapping Playwright coverage validates visible Add Game Control rows, mapping counts, missing-state removal, common/alternate enabled state, device help text, generic Keyboard/Mouse row creation and editing, persistence, and shared engine input ownership. |
| 82 | +- PASS: Game Workspace/Game Journey Playwright coverage validates active Game Workspace and Game Journey routes, deprecated project-workspace old-link guidance, route registration, and route handoff. |
| 83 | + |
| 84 | +## V8 Coverage |
| 85 | +- PASS: `docs_build/dev/reports/playwright_v8_coverage_report.txt` produced from Playwright V8 coverage. |
| 86 | +- PASS: `toolbox/controls/controls.js` collected at 83 percent advisory coverage in the final targeted Controls run. |
| 87 | +- WARN: `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` is server/dev-runtime code and is not collected by browser V8 coverage. It is covered by the Controls Playwright behavior that writes and reads the shared mock DB adapter. |
| 88 | + |
| 89 | +## Manual Validation Steps |
| 90 | +1. Open `/toolbox/controls/index.html`. |
| 91 | +2. Confirm the Controls lede and Devices guidance use game-owned wording. |
| 92 | +3. Click `Add Game Control`. |
| 93 | +4. Confirm 24 normalized rows are visible, `Mappings` shows 24, and `Missing Game Control Mapping` is gone. |
| 94 | +5. Confirm common rows such as `action.primary` are enabled and Active, while alternate rows such as `aim.x+` are disabled. |
| 95 | +6. Hover or inspect the Devices list and confirm seven device/input capability rows expose `title` and `aria-label` help text. |
| 96 | +7. Click `Add Keyboard Control`, edit a row, save, and confirm the row persists through the shared mock DB. |
| 97 | +8. Click `Add Mouse Control` and confirm Mouse rows are visible and persist. |
| 98 | +9. Open `/toolbox/project-workspace/index.html` and confirm it displays Game Workspace old-link guidance without Project Workspace user-facing copy. |
| 99 | +10. Open `/toolbox/game-workspace/index.html` and `/toolbox/game-journey/index.html` from active navigation and confirm both routes resolve. |
| 100 | + |
| 101 | +## Notes |
| 102 | +- `npm run test:workspace-v2` is a legacy command name retained by repo scripts. It was required by the request and passed. |
| 103 | +- No package/script behavior changes were made. |
| 104 | +- No active navigation points to old project-workspace or project-journey paths. |
| 105 | +- No old project mock repositories are active. |
| 106 | +- No broken imports from deleted project-workspace JavaScript artifacts remain. |
0 commit comments