|
| 1 | +# PR_26163_058-user-control-profile-selected-device-only |
| 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_058-user-control-profile-selected-device-only`. |
| 13 | +- PASS - Fixed `account/user-controls.html` Game Controller profile creation behavior through the external `account/user-controls-page.js` runtime. |
| 14 | +- PASS - `Create User Control Profile` now creates exactly one profile from the selected detected game controller row. |
| 15 | +- PASS - Unselected controllers are not created as additional profiles. |
| 16 | +- PASS - Unselected controllers are not added as detached profiles. |
| 17 | +- PASS - The new profile keeps the selected physical controller/device `controllerId`, `controllerName`, and `deviceType`. |
| 18 | +- PASS - Only the newly created selected-device profile opens in edit mode. |
| 19 | +- PASS - Scope stayed limited to account User Controls profile creation behavior, targeted tests, runtime coverage, and reports. |
| 20 | + |
| 21 | +## Changed Files |
| 22 | + |
| 23 | +- `account/user-controls-page.js` |
| 24 | +- `tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 25 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 26 | +- `docs_build/dev/reports/PR_26163_058-user-control-profile-selected-device-only.md` |
| 27 | +- `docs_build/dev/reports/codex_review.diff` |
| 28 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 29 | + |
| 30 | +## Implementation Notes |
| 31 | + |
| 32 | +- `Create User Control Profile` now reads the checked game controller row radio (`data-account-user-controls-selected-device`) instead of the separate controller dropdown. |
| 33 | +- The selected row must be a detected game controller device choice; default/profile rows do not create new controller profiles. |
| 34 | +- Device polling now refreshes visible controller rows while no profile is being edited, so newly detected controllers can be selected from the table without manual refresh. |
| 35 | +- Existing edit-mode protection is preserved: polling does not rerender profile rows while a profile is being edited. |
| 36 | + |
| 37 | +## Impacted Lane |
| 38 | + |
| 39 | +- Account/User Controls runtime lane. |
| 40 | +- Account/User Controls Playwright behavior lane. |
| 41 | +- Workspace V2 command lane, required by request. |
| 42 | + |
| 43 | +## Skipped Lanes |
| 44 | + |
| 45 | +- Full samples smoke: SKIP. This PR is limited to Account/User Controls profile creation and does not touch samples, sample JSON, game runtime launch, or sample smoke behavior. |
| 46 | +- Engine lane: SKIP. No `src/engine/input` files or engine contracts changed. |
| 47 | +- Toolbox Controls lane beyond existing Account/User Controls coverage: SKIP. Toolbox Controls source was not changed. |
| 48 | + |
| 49 | +## Validation Performed |
| 50 | + |
| 51 | +- PASS - Branch check: `git branch --show-current` returned `main`. |
| 52 | +- PASS - Syntax check: `node --check account/user-controls-page.js`. |
| 53 | +- PASS - Syntax check: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`. |
| 54 | +- PASS - Static patch check: `git diff --check -- account/user-controls-page.js tests/playwright/tools/InputMappingV2Tool.spec.mjs`. |
| 55 | +- PASS - Targeted regression: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "selected game controller row" --reporter=line` passed 1 test. |
| 56 | +- 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. |
| 57 | +- PASS - Required workspace validation: `npm run test:workspace-v2` passed 5 tests. |
| 58 | + |
| 59 | +## Playwright Result |
| 60 | + |
| 61 | +- PASS - Selecting one detected game controller row is required for profile creation. |
| 62 | +- PASS - `Create User Control Profile` creates exactly one `player_controller_profiles` record. |
| 63 | +- PASS - The unselected controller does not create an extra profile. |
| 64 | +- PASS - The unselected controller remains a detected row rather than a detached saved profile. |
| 65 | +- PASS - The newly created selected-device profile opens in edit mode. |
| 66 | +- PASS - Existing User Controls profile defaults, editing, persistence, and ownership coverage still passes. |
| 67 | + |
| 68 | +## Coverage |
| 69 | + |
| 70 | +- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` was produced after the targeted Account/User Controls Playwright run. |
| 71 | +- PASS - Changed runtime JavaScript coverage includes `(93%) account/user-controls-page.js - changed runtime JS file with browser V8 coverage`. |
| 72 | + |
| 73 | +## Manual Validation Steps |
| 74 | + |
| 75 | +1. Open `/account/user-controls.html`. |
| 76 | +2. Ensure two game controllers are detected or exposed by the browser test harness. |
| 77 | +3. Select one detected controller row in the Game Controllers table. |
| 78 | +4. Click `Create User Control Profile`. |
| 79 | +5. Confirm exactly one profile is created for the selected controller. |
| 80 | +6. Confirm the unselected controller remains a detected row and is not saved as a profile. |
| 81 | +7. Confirm the selected controller profile opens in edit mode. |
| 82 | +8. Confirm clicking create without a selected detected controller row shows the warning status. |
| 83 | + |
| 84 | +## Samples Validation Decision |
| 85 | + |
| 86 | +- 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. |
| 87 | + |
| 88 | +## Completion |
| 89 | + |
| 90 | +- PASS - Every requested item was implemented, validated, and explicitly marked PASS or documented as skipped where applicable. |
0 commit comments