|
| 1 | +# PR_26163_060-user-control-gamepad-generation-repair |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | + |
| 5 | +- Current branch: `main` |
| 6 | +- Expected branch: `main` |
| 7 | +- Branch validation: PASS |
| 8 | + |
| 9 | +## Requirement Checklist |
| 10 | + |
| 11 | +- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before implementation. |
| 12 | +- PASS - Created PR scope `PR_26163_060-user-control-gamepad-generation-repair`. |
| 13 | +- PASS - Repaired `account/user-controls.html` gamepad profile generation without using `toolbox/controls` as an implementation source. |
| 14 | +- PASS - Audited Account User Controls code paths for detected gamepads, detached rows, profile creation, Edit/Trash buttons, selected device state, and Save behavior. |
| 15 | +- PASS - Connected controllers auto-detect as selectable detected-device rows only. |
| 16 | +- PASS - Detected-only rows are not saved profiles. |
| 17 | +- PASS - Detected-only rows do not show as detached profiles. |
| 18 | +- PASS - User must select exactly one detected controller row before profile creation. |
| 19 | +- PASS - `Create User Control Profile` creates exactly one new unsaved profile for the selected controller. |
| 20 | +- PASS - Newly generated profile opens in edit mode immediately. |
| 21 | +- PASS - Edit/Delete buttons appear only for real saved profile rows. |
| 22 | +- PASS - Save persists exactly one edited profile for the current user. |
| 23 | +- PASS - Clicking `Create User Control Profile` with no selected controller shows a visible actionable warning. |
| 24 | +- PASS - The touched flow does not create detected gamepads as in-memory profile rows during detection/render. |
| 25 | +- PASS - Scope stayed limited to account User Controls gamepad profile behavior, targeted tests, runtime coverage, and reports. |
| 26 | + |
| 27 | +## Changed Files |
| 28 | + |
| 29 | +- `account/user-controls.html` |
| 30 | +- `account/user-controls-page.js` |
| 31 | +- `tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 32 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 33 | +- `docs_build/dev/reports/PR_26163_060-user-control-gamepad-generation-repair.md` |
| 34 | +- `docs_build/dev/reports/codex_review.diff` |
| 35 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 36 | + |
| 37 | +## Audit Notes |
| 38 | + |
| 39 | +- `renderDetectedDeviceRow()` renders detected gamepads as rows with `data-account-user-controls-detected-device`, summary text, and a `Detected` action/status cell. |
| 40 | +- `renderProfileRow()` is the only path that renders saved profile rows with `data-account-user-controls-profile-row` plus Edit and Trash buttons. |
| 41 | +- `addProfileForSelectedDevice()` now requires the currently checked detected gamepad row and does not fall back to previously saved selected-device state. |
| 42 | +- `createProfile(device, { persistImmediately: false })` stages the selected gamepad profile in edit mode; `saveEditingProfile()` is the persistence boundary. |
| 43 | +- The account page no longer renders the game controller dropdown; connected controllers are selected from detected-device rows only. |
| 44 | +- No `toolbox/controls` files were used or modified for account profile generation. |
| 45 | + |
| 46 | +## Impacted Lane |
| 47 | + |
| 48 | +- Account/User Controls runtime lane. |
| 49 | +- Account/User Controls Playwright behavior lane. |
| 50 | +- Workspace V2 command lane, required by request. The command name `npm run test:workspace-v2` is legacy test-suite naming; it does not introduce user-facing Workspace V2 wording. |
| 51 | + |
| 52 | +## Skipped Lanes |
| 53 | + |
| 54 | +- Full samples smoke: SKIP. This PR is limited to Account/User Controls gamepad profile generation and does not touch samples, sample JSON, game runtime launch, or sample smoke behavior. |
| 55 | +- Engine lane: SKIP. No `src/engine/input` files or engine contracts changed. |
| 56 | +- Toolbox Controls lane: SKIP. Toolbox Controls is game-owned controls and was intentionally not used or changed for account user profiles. |
| 57 | + |
| 58 | +## Validation Performed |
| 59 | + |
| 60 | +- PASS - Branch check: `git branch --show-current` returned `main`. |
| 61 | +- PASS - Syntax check: `node --check account/user-controls-page.js`. |
| 62 | +- PASS - Syntax check: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`. |
| 63 | +- PASS - Static patch check: `git diff --check -- account/user-controls.html account/user-controls-page.js tests/playwright/tools/InputMappingV2Tool.spec.mjs`. |
| 64 | +- PASS - HTML restriction check: `rg -n "<style| on[a-z]+=|<script>" account/user-controls.html` returned no matches. |
| 65 | +- PASS - Targeted regression: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "selected game controller row" --reporter=line` passed 1 test. |
| 66 | +- PASS - Targeted Account/User Controls slice: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "User Controls owns|selected game controller row|scopes profiles" --reporter=line` passed 3 tests. |
| 67 | +- PASS - Required workspace validation: `npm run test:workspace-v2` passed 5 tests. |
| 68 | + |
| 69 | +## Playwright Result |
| 70 | + |
| 71 | +- PASS - Connected gamepads render as detected selectable rows. |
| 72 | +- PASS - Detection creates zero saved profile rows. |
| 73 | +- PASS - Detected rows are not labeled or stored as detached profiles. |
| 74 | +- PASS - `Create User Control Profile` with no selected gamepad shows an actionable warning and creates zero profiles. |
| 75 | +- PASS - Selecting one detected gamepad then clicking `Create User Control Profile` creates exactly one editable unsaved profile. |
| 76 | +- PASS - Generated profile has Save/Cancel edit flow and does not create profiles for other detected gamepads. |
| 77 | +- PASS - Save persists only that one profile for the current user. |
| 78 | +- PASS - Edit/Trash buttons appear on the saved real profile row and not on detected-only rows or the unsaved editing row. |
| 79 | + |
| 80 | +## Coverage |
| 81 | + |
| 82 | +- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` was produced after the targeted Account/User Controls Playwright run. |
| 83 | +- PASS - Changed runtime JavaScript coverage includes `(91%) account/user-controls-page.js - changed runtime JS file with browser V8 coverage`. |
| 84 | + |
| 85 | +## Manual Validation Steps |
| 86 | + |
| 87 | +1. Open `/account/user-controls.html`. |
| 88 | +2. Connect or expose at least two game controllers. |
| 89 | +3. Confirm connected controllers appear as detected-device table rows and no controller dropdown appears. |
| 90 | +4. Confirm detected rows show `Detected` and do not show Edit or Trash. |
| 91 | +5. Click `Create User Control Profile` with no detected controller row selected. |
| 92 | +6. Confirm the warning appears and no profile is created. |
| 93 | +7. Select exactly one detected controller row and click `Create User Control Profile`. |
| 94 | +8. Confirm a single unsaved profile opens in edit mode with Save/Cancel. |
| 95 | +9. Save the profile and confirm only that profile persists for the current user. |
| 96 | +10. Confirm unselected detected controllers remain detected rows and are not saved profiles. |
| 97 | + |
| 98 | +## Samples Validation Decision |
| 99 | + |
| 100 | +- SKIP - Full samples smoke was not run because the request explicitly excluded it and the PR does not affect sample contracts or sample runtime behavior. |
| 101 | + |
| 102 | +## Completion |
| 103 | + |
| 104 | +- PASS - Every requested item was implemented, validated, and explicitly marked PASS or documented as skipped where applicable. |
0 commit comments