Skip to content

Commit fd9f82f

Browse files
committed
asdf
1 parent dead16a commit fd9f82f

7 files changed

Lines changed: 285 additions & 217 deletions

File tree

account/user-controls-page.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ export class AccountUserControlsPage {
429429

430430
renderDeviceSelect() {
431431
if (!this.elements.deviceSelect) {
432+
this.renderDeviceStatus();
432433
return;
433434
}
434435
const selectedValue = this.elements.deviceSelect.value;

account/user-controls.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ <h2>Physical Input Mapping</h2>
8686
<div class="accordion-body content-stack">
8787
<div class="content-cluster" aria-label="Account controller device selection">
8888
<button class="btn" type="button" data-account-user-controls-refresh>Refresh Devices</button>
89-
<label>
90-
Game Controller
91-
<select data-account-user-controls-device></select>
92-
</label>
9389
</div>
9490
<p class="status" role="status" data-account-user-controls-device-status>Game controllers auto-detect after the browser exposes them.</p>
9591
<div class="table-wrapper">
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
account/user-controls.html
12
account/user-controls-page.js
23
tests/playwright/tools/InputMappingV2Tool.spec.mjs
34
docs_build/dev/reports/playwright_v8_coverage_report.txt
4-
docs_build/dev/reports/PR_26163_059-user-control-profile-generation-flow.md
5+
docs_build/dev/reports/PR_26163_060-user-control-gamepad-generation-repair.md
56
docs_build/dev/reports/codex_review.diff
67
docs_build/dev/reports/codex_changed_files.txt

0 commit comments

Comments
 (0)