|
| 1 | +# PR_26161_024 Controls Edit-Gated Capture Devices Report |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- Current branch: `main` |
| 5 | +- Expected branch: `main` |
| 6 | +- Result: PASS |
| 7 | + |
| 8 | +## Summary |
| 9 | +- Changed saved-row Input tokens so non-edit clicks do nothing. |
| 10 | +- Changed edit-row Input value clicks so they start capture for the row currently being edited. |
| 11 | +- Added a Controller dropdown in the Controller Profile section with Keyboard, Mouse, detected gamepads, and an actionable unknown/unavailable option. |
| 12 | +- Device selection pre-populates an unsaved controller profile row for review and explicit Save. |
| 13 | +- Preserved footer Action/Object dropdowns, action descriptions, table-first editing, Add Mapping, Cancel, Edit, Trash, State explanation, Devices, Status, DB reload persistence, and Wireframe status. |
| 14 | + |
| 15 | +## Requirement Checklist |
| 16 | +| Requirement | Result | Evidence | |
| 17 | +| --- | --- | --- | |
| 18 | +| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first | PASS | Read before edits. | |
| 19 | +| Verify branch is `main` before edits | PASS | `git branch --show-current` returned `main`. | |
| 20 | +| Continue from PR_26161_023 | PASS | Footer Action/Object dropdowns and Actions reference catalog preserved. | |
| 21 | +| Keep Controls status as Wireframe | PASS | Targeted Playwright asserts registry status/release channel remain `wireframe` and not `beta`. | |
| 22 | +| Keep Controls data DB-backed through shared DB/mock adapter only | PASS | Mapping and controller profile saves still use `inputRepository`; no browser storage added. | |
| 23 | +| Non-edit row Input click does nothing | PASS | Playwright clicks a saved Input token and verifies no edit row opens and DB records remain unchanged. | |
| 24 | +| Edit-mode Input click enables capture for that row | PASS | Playwright clicks the edit-row Input value, captures `KeyB`, and saves. | |
| 25 | +| Capture updates only the edited row | PASS | Playwright keeps a second `Fire` mapping at `KeyF` while editing only the `Move Left` mapping to `KeyB`. | |
| 26 | +| Captured input persists through shared DB/mock adapter | PASS | Playwright reloads and verifies edited `KeyB` and untouched `KeyF` mappings persist. | |
| 27 | +| Add Controller dropdown/list for connected devices | PASS | Controller selector renders Keyboard, Mouse, and a detected test gamepad after device refresh. | |
| 28 | +| Selecting a device pre-populates Controller Name, Controller ID, and Mapping Profile | PASS | Playwright verifies Keyboard, Mouse, and detected gamepad prefilled values. | |
| 29 | +| Do not silently create fake controller data | PASS | Device selection only creates an unsaved edit row; DB controller profile records remain empty until Save. | |
| 30 | +| Unknown/unavailable device path is actionable | PASS | Playwright selects the unknown/unavailable option and verifies WARN status with refresh/connect guidance. | |
| 31 | +| Preserve footer Action/Object dropdowns | PASS | Existing targeted Playwright checks remain passing. | |
| 32 | +| Preserve action descriptions | PASS | Existing targeted Playwright checks all action descriptions remain visible and sorted. | |
| 33 | +| Preserve table-first editing, Add Mapping, Cancel, Edit, Trash, State explanation, Devices, Status, reload persistence | PASS | Covered by targeted Controls/Input Mapping Playwright. | |
| 34 | +| Avoid sample JSON, auth, production game runtime behavior, unrelated rewrites | PASS | No samples, auth, production runtime, or engine files changed. | |
| 35 | +| Keep Theme V2 only; no inline CSS/JS/event handlers | PASS | HTML restriction scan found no inline style/script/event-handler violations. | |
| 36 | + |
| 37 | +## Impacted Lane |
| 38 | +- runtime |
| 39 | +- recovery/UAT |
| 40 | + |
| 41 | +## Playwright Impacted |
| 42 | +- Yes |
| 43 | + |
| 44 | +## Testing Performed |
| 45 | +- `node --check toolbox/input-mapping-v2/input-mapping-v2.js` - PASS |
| 46 | +- `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` - PASS |
| 47 | +- `node --check toolbox/input-mapping-v2/input-mapping-api-client.js` - PASS |
| 48 | +- `rg -n --pcre2 "<script(?![^>]*\\bsrc=)|<style\\b|\\son[a-z]+=" toolbox/input-mapping-v2/index.html toolbox/controls/index.html` - PASS, no matches |
| 49 | +- `git diff --check` - PASS, CRLF warnings only |
| 50 | +- `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs` - PASS, 5 passed |
| 51 | + |
| 52 | +## Playwright Behavior Covered |
| 53 | +- Launch/UAT panels still render and Controls remains Wireframe. |
| 54 | +- Controller dropdown renders Keyboard, Mouse, and unknown/unavailable choices on initial load. |
| 55 | +- Device refresh adds a detected gamepad exposed through `navigator.getGamepads`. |
| 56 | +- Keyboard, Mouse, and detected gamepad selections pre-populate controller profile fields without saving records. |
| 57 | +- Unknown/unavailable controller selection shows actionable WARN guidance. |
| 58 | +- Saved-row Input token clicks do not enter edit mode. |
| 59 | +- Edit-row Input value clicks start capture and update only the edited row. |
| 60 | +- Captured inputs persist after reload. |
| 61 | +- Trash remains the only covered row deletion path. |
| 62 | + |
| 63 | +## V8 Coverage |
| 64 | +- Report: `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 65 | +- Guardrail: `docs_build/dev/reports/coverage_changed_js_guardrail.txt` |
| 66 | +- Changed runtime JS covered: `toolbox/input-mapping-v2/input-mapping-v2.js` |
| 67 | +- Coverage result: 91% function coverage, 117/128 functions |
| 68 | + |
| 69 | +## Manual Validation Steps |
| 70 | +1. Open `/toolbox/input-mapping-v2/index.html`. |
| 71 | +2. Confirm Controls status remains Wireframe in the tool display/registry surfaces. |
| 72 | +3. Confirm the Controller Profile section contains a Controller dropdown. |
| 73 | +4. Confirm Keyboard and Mouse appear in the dropdown before a gamepad is connected. |
| 74 | +5. Connect or expose a gamepad, click Refresh Devices, and confirm the detected gamepad appears. |
| 75 | +6. Select Keyboard, Mouse, and a gamepad and confirm Controller Name, Controller ID, and Mapping Profile pre-populate before saving. |
| 76 | +7. Select the unknown/unavailable option and confirm WARN guidance explains how to connect/refresh/select a detected device. |
| 77 | +8. Add two mappings, save, reload, and confirm both persist. |
| 78 | +9. Click a saved Input token and confirm it does not open edit mode. |
| 79 | +10. Click Edit on one row, click the row Input value, capture a new key, save, reload, and confirm only that row changed. |
| 80 | +11. Delete mappings with Trash and confirm no other click path deletes a row. |
| 81 | + |
| 82 | +## Skipped Lanes |
| 83 | +- Full samples validation was skipped as required; this PR does not touch sample JSON or sample runtime behavior. |
| 84 | +- Full workspace contract lane was skipped because no Project Workspace contract/runtime files changed; workspace return remains covered by the targeted Controls/Input Mapping Playwright spec. |
| 85 | +- Engine lane was skipped because no engine runtime behavior changed. |
| 86 | +- Auth and production DB lanes were skipped because no auth or production DB behavior changed. |
| 87 | + |
| 88 | +## Runtime Scope Confirmation |
| 89 | +- Controls remains Wireframe. |
| 90 | +- Controls mapping and controller profile data remain persisted through the shared DB/mock adapter. |
| 91 | +- No page-local storage, `localStorage`, or `sessionStorage` source of truth was added. |
| 92 | +- No production controller runtime or production game runtime behavior was added. |
| 93 | +- No sample JSON alignment, auth behavior, production DB behavior, or unrelated rewrites were added. |
0 commit comments