|
| 1 | +# PR_26161_032-controls-player-controller-split |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- Current branch: `main` |
| 5 | +- Expected branch: `main` |
| 6 | +- Result: PASS |
| 7 | + |
| 8 | +## Impacted Lane |
| 9 | +- Tool/runtime lane: Controls / Input Mapping |
| 10 | +- Shared engine lane: `src/engine/input` normalization |
| 11 | +- Shared DB lane: mock adapter schemas for Controls tables |
| 12 | +- Playwright impacted: Yes |
| 13 | + |
| 14 | +## Scope Summary |
| 15 | +- Split Controls into visible `Game Controls` and `Player Controller Profiles` sections. |
| 16 | +- `Game Controls` now owns normalized-input-to-game-action mappings: `Normalized Input`, `Game Action`, `Object`, `State`. |
| 17 | +- `Player Controller Profiles` now owns physical-input-to-normalized-input mappings: `Physical Controller`, `Physical Input`, `Normalized Input`, analog `Deadzone`, analog `Invert`. |
| 18 | +- Added shared `src/engine/input/NormalizedInputRegistry.js` for the normalized input registry and default physical-input normalization. |
| 19 | +- Exposed normalized input helpers through `InputService`. |
| 20 | +- Extended the shared mock DB adapter so game mappings persist `normalizedInput` and player profiles persist `inputMappings`. |
| 21 | + |
| 22 | +## Requirement Checklist |
| 23 | +- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`. |
| 24 | +- PASS - Verified branch is `main` before edits. |
| 25 | +- PASS - Continued from PR_26161_031 behavior while changing ownership. |
| 26 | +- PASS - Controller normalization is required for current Controls flow. |
| 27 | +- PASS - Controls has clear `Game Controls` and `Player Controller Profiles` sections. |
| 28 | +- PASS - Game mappings use `Normalized Input`, `Game Action`, `Object`, and `State`. |
| 29 | +- PASS - Player profiles use `Physical Controller`, `Physical Input`, `Normalized Input`, `Deadzone`, and `Invert`. |
| 30 | +- PASS - Physical controller buttons are not mapped directly to game actions. |
| 31 | +- PASS - Physical inputs route through normalized inputs before game actions. |
| 32 | +- PASS - Added normalized registry entries: `move.x`, `move.y`, `aim.x`, `aim.y`, `button.south`, `button.east`, `button.west`, `button.north`, `dpad.up`, `dpad.down`, `dpad.left`, `dpad.right`, `trigger.left`, `trigger.right`, `start`, `select`. |
| 33 | +- PASS - Controller profile data persists through the shared DB/mock adapter. |
| 34 | +- PASS - Game control mapping data persists through the shared DB/mock adapter. |
| 35 | +- PASS - Keyboard and Mouse are included in the same normalization model. |
| 36 | +- PASS - Missing profile status appears as `Missing Controller Profile` with `Create Player Controller Profile`. |
| 37 | +- PASS - Missing game mapping status appears as `Missing Game Control Mapping`. |
| 38 | +- PASS - Controls uses `src/engine/input` services/helpers; no direct `navigator.getGamepads` polling is present in `toolbox/controls/controls.js`. |
| 39 | +- PASS - Added the smallest shared engine/input extension needed for normalization. |
| 40 | +- PASS - Preserved compatible table-first editing, Add, Cancel, Edit, Trash, Reset confirmation, custom actions, object-aware action filtering, DB reload persistence, and deprecated input-mapping-v2 guidance. |
| 41 | +- PASS - Did not add sample JSON alignment, auth behavior, production account behavior, or unrelated rewrites. |
| 42 | +- PASS - Kept Theme V2 only; no inline CSS, inline JS, script blocks, style blocks, or inline event handlers were added. |
| 43 | + |
| 44 | +## Testing Performed |
| 45 | +- PASS - `node --check toolbox/controls/controls.js` |
| 46 | +- PASS - `node --check src/engine/input/NormalizedInputRegistry.js` |
| 47 | +- PASS - `node --check src/engine/input/InputService.js` |
| 48 | +- PASS - `node --check src/dev-runtime/persistence/mock-db-store.js` |
| 49 | +- PASS - `node --check src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 50 | +- PASS - `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 51 | +- PASS - `git diff --check -- toolbox/controls/index.html toolbox/controls/controls.js src/engine/input/InputService.js src/engine/input/NormalizedInputRegistry.js src/dev-runtime/persistence/mock-db-store.js src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js tests/input/NormalizedInputRegistry.test.mjs tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 52 | +- PASS - `node tests/input/NormalizedInputRegistry.test.mjs` |
| 53 | +- PASS - `node tests/input/InputService.test.mjs` |
| 54 | +- PASS - `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --workers=1` (5 passed) |
| 55 | + |
| 56 | +## Playwright Coverage |
| 57 | +- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` generated. |
| 58 | +- PASS - `toolbox/controls/controls.js` covered at 93%. |
| 59 | +- PASS - `src/engine/input/NormalizedInputRegistry.js` covered at 100%. |
| 60 | +- WARN - `src/dev-runtime/persistence/mock-db-store.js` and `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` are server/dev-runtime files and were not collected by browser V8 coverage. |
| 61 | +- WARN - `src/engine/input/InputService.js` has advisory low function coverage, but all executed lines were collected and existing targeted Node validation passed. |
| 62 | + |
| 63 | +## Manual Validation Steps |
| 64 | +- Open `/toolbox/controls/index.html`. |
| 65 | +- Confirm the center panel shows `Game Controls` and `Player Controller Profiles`. |
| 66 | +- In `Game Controls`, add a row with a normalized input such as `move.x`, choose a game action and object, save, reload, and confirm persistence. |
| 67 | +- In `Player Controller Profiles`, select Keyboard, Mouse, or a detected gamepad and create a player profile. |
| 68 | +- Edit a player profile and confirm physical inputs map only to normalized inputs, with deadzone/invert controls on analog axes. |
| 69 | +- Delete/reset records and confirm persistence after reload. |
| 70 | + |
| 71 | +## Skipped Lanes |
| 72 | +- Full samples validation: SKIP. Samples are explicitly out of scope for this Controls/input normalization PR. |
| 73 | +- Full workspace suite: SKIP. Targeted Controls Playwright covered the changed tool behavior; no sample JSON, auth, or production account changes were made. |
| 74 | +- Production runtime/gameplay validation: SKIP. This PR updates Controls authoring data and shared normalization helpers only; no production gameplay runtime integration was added. |
| 75 | + |
| 76 | +## Runtime Behavior |
| 77 | +- No sample JSON alignment changed. |
| 78 | +- No auth behavior changed. |
| 79 | +- No production account behavior changed. |
| 80 | +- No unrelated tool ownership changed. |
| 81 | +- Engine input was extended only with the normalized registry/helper surface required by this PR. |
| 82 | + |
| 83 | +## Required Artifacts |
| 84 | +- PASS - `docs_build/dev/reports/controls-player-controller-split-report.md` |
| 85 | +- PASS - `docs_build/dev/reports/codex_review.diff` |
| 86 | +- PASS - `docs_build/dev/reports/codex_changed_files.txt` |
| 87 | +- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 88 | +- PASS - `tmp/PR_26161_032-controls-player-controller-split_delta.zip` |
0 commit comments