|
| 1 | +# PR_26162_050-user-controls-selected-device-fallback |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | +- PASS: current branch `main`. |
| 5 | +- Expected branch: `main`. |
| 6 | + |
| 7 | +## Requirement Checklist |
| 8 | +- PASS: `account/user-controls.html` includes a `Selected Device` radio workflow. |
| 9 | +- PASS: radio choices include Keyboard, Mouse, detected game controllers, and saved user-created profiles. |
| 10 | +- PASS: selected device/profile is persisted through the shared DB/mock adapter in `player_input_device_selections`. |
| 11 | +- PASS: connected selections show the selected device/profile as active. |
| 12 | +- PASS: unavailable saved device/profile shows `Selected device not connected. Using Default Profile.` |
| 13 | +- PASS: no game-start controller picker behavior was added. |
| 14 | +- PASS: default profiles are rendered from system default profile records and are not copied into `player_controller_profiles`. |
| 15 | +- PASS: default rows are read-only and expose `View` only. |
| 16 | +- PASS: user-created profile rows remain editable and deletable with `Edit` and `Trash`. |
| 17 | +- PASS: `Create my profile` / `Create User Control Profile` actions are below the combined profile tables. |
| 18 | +- PASS: DB-backed ownership separation is preserved: |
| 19 | + - system defaults are system-owned runtime defaults. |
| 20 | + - `player_controller_profiles` remains user/player owned. |
| 21 | + - `game_input_mappings` remains game/project owned. |
| 22 | +- PASS: no sample JSON alignment, auth behavior, production account system, or unrelated rewrites were added. |
| 23 | + |
| 24 | +## Changed Files |
| 25 | +- `account/user-controls.html` |
| 26 | +- `account/user-controls-page.js` |
| 27 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 28 | +- `docs_build/dev/reports/codex_review.diff` |
| 29 | +- `src/dev-runtime/persistence/mock-db-store.js` |
| 30 | +- `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 31 | +- `tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 32 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 33 | +- `docs_build/dev/reports/coverage_changed_js_guardrail.txt` |
| 34 | +- `docs_build/dev/reports/user-controls-selected-device-fallback-report.md` |
| 35 | + |
| 36 | +## Impacted Lanes |
| 37 | +- runtime: Account User Controls browser UI. |
| 38 | +- integration: shared controls mock DB adapter. |
| 39 | +- Playwright impacted: Yes. |
| 40 | + |
| 41 | +## Testing Performed |
| 42 | +- PASS: `node --check account/user-controls-page.js` |
| 43 | +- PASS: `node --check src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 44 | +- PASS: `node --check src/dev-runtime/persistence/mock-db-store.js` |
| 45 | +- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 46 | +- PASS: `git diff --check` |
| 47 | +- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "Account User Controls owns physical input mapping accordions and profiles"` |
| 48 | +- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "Account|shared engine input contracts"` |
| 49 | +- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 50 | + |
| 51 | +## Playwright Result |
| 52 | +- PASS: 7/7 targeted Controls/Input Mapping tests passed. |
| 53 | +- Coverage artifact updated: `docs_build/dev/reports/playwright_v8_coverage_report.txt`. |
| 54 | +- V8 coverage exercised `account/user-controls-page.js` at 92% function coverage. |
| 55 | +- Advisory warnings remain for dev-runtime repository files because Playwright V8 browser coverage does not collect server-side mock adapter modules. |
| 56 | + |
| 57 | +## Manual Validation Steps |
| 58 | +1. Open `/account/user-controls.html`. |
| 59 | +2. Confirm `Selected Device` shows Keyboard and Mouse choices before profile creation. |
| 60 | +3. Select Mouse, reload, and confirm Mouse remains selected. |
| 61 | +4. Confirm Keyboard, Mouse, and Game Controllers tables each show a `Default Profile` row with `View` only. |
| 62 | +5. Create Keyboard, Mouse, and Game Controller user profiles. |
| 63 | +6. Confirm saved user profile rows show `Edit` and `Trash`. |
| 64 | +7. Select a saved game controller profile, reload without a connected gamepad, and confirm `Selected device not connected. Using Default Profile.` |
| 65 | +8. Confirm `player_controller_profiles` does not contain copied default profile rows. |
| 66 | + |
| 67 | +## Skipped Lanes |
| 68 | +- samples: skipped by request; this PR changes Account/User Controls setup and shared mock adapter state only. |
| 69 | +- full samples smoke: skipped by request. |
| 70 | +- production account/auth validation: skipped because no production account/auth behavior was changed. |
| 71 | + |
| 72 | +## 100% Completion Check |
| 73 | +- PASS: every requested PR_26162_050 item is implemented and validated. |
0 commit comments