Skip to content

Commit 27f0035

Browse files
committed
Clean up Controls and User Controls duplicate copy and preset surfaces - PR_26162_044-controls-user-controls-copy-cleanup
1 parent 89ca79d commit 27f0035

9 files changed

Lines changed: 753 additions & 779 deletions

File tree

account/user-controls-page.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class AccountUserControlsPage {
192192
controllerName,
193193
deviceType: "Gamepad",
194194
inputs: gamepadProfileInputNames(gamepad),
195-
label: `Gamepad: ${controllerName}`,
195+
label: controllerName,
196196
mappingProfile: `${controllerName} Profile`,
197197
value: `gamepad-${gamepad.index}`,
198198
};
@@ -476,7 +476,7 @@ export class AccountUserControlsPage {
476476
const row = document.createElement("tr");
477477
row.dataset.accountUserControlsProfileRow = profile.id;
478478
row.append(
479-
tableCell(`${profile.deviceType}: ${profile.controllerName}`),
479+
tableCell(profile.controllerName),
480480
tableCell(`${profile.inputMappings.length} Physical Inputs`),
481481
tableCell(this.profileInputSummary(profile)),
482482
tableCell(this.profileAnalogSummary(profile)),
@@ -557,7 +557,7 @@ export class AccountUserControlsPage {
557557
deadzone.dataset.accountUserControlsDeadzone = String(index);
558558
deadzoneCell.append(deadzone);
559559
} else {
560-
deadzoneCell.textContent = "Not applicable";
560+
deadzoneCell.textContent = "N/A";
561561
}
562562

563563
const invertCell = document.createElement("td");
@@ -568,7 +568,7 @@ export class AccountUserControlsPage {
568568
invert.dataset.accountUserControlsInvert = String(index);
569569
invertCell.append(invert);
570570
} else {
571-
invertCell.textContent = "Not applicable";
571+
invertCell.textContent = "N/A";
572572
}
573573

574574
const sensitivityCell = document.createElement("td");
@@ -589,7 +589,7 @@ export class AccountUserControlsPage {
589589
value,
590590
}));
591591
} else {
592-
sensitivityCell.textContent = "Not applicable";
592+
sensitivityCell.textContent = "N/A";
593593
}
594594

595595
row.append(physicalInputCell, controlCell(stack), deadzoneCell, invertCell, sensitivityCell);
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# git status --short
22
M account/user-controls-page.js
3-
M account/user-controls.html
43
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
54
M docs_build/dev/reports/playwright_v8_coverage_report.txt
6-
M src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js
75
M tests/playwright/tools/InputMappingV2Tool.spec.mjs
8-
?? docs_build/dev/reports/user-controls-gamepad-table-and-defaults-report.md
6+
M toolbox/controls/controls.js
7+
M toolbox/controls/index.html
8+
?? docs_build/dev/reports/controls-user-controls-copy-cleanup-report.md
99

1010
# git ls-files --others --exclude-standard
11-
docs_build/dev/reports/user-controls-gamepad-table-and-defaults-report.md
11+
docs_build/dev/reports/controls-user-controls-copy-cleanup-report.md
1212

1313
# git diff --stat
14-
account/user-controls-page.js | 119 ++++++++++++++-------
15-
account/user-controls.html | 9 +-
16-
.../dev/reports/coverage_changed_js_guardrail.txt | 2 -
17-
.../dev/reports/playwright_v8_coverage_report.txt | 7 +-
18-
.../input-mapping-mock-repository.js | 24 ++++-
19-
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 61 ++++++++---
20-
6 files changed, 149 insertions(+), 73 deletions(-)
14+
account/user-controls-page.js | 10 +-
15+
.../dev/reports/coverage_changed_js_guardrail.txt | 8 +-
16+
.../dev/reports/playwright_v8_coverage_report.txt | 13 +-
17+
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 67 +++++----
18+
toolbox/controls/controls.js | 163 +--------------------
19+
toolbox/controls/index.html | 34 ++---
20+
6 files changed, 61 insertions(+), 234 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 582 additions & 534 deletions
Large diffs are not rendered by default.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# PR_26162_044-controls-user-controls-copy-cleanup
2+
3+
## Branch Validation
4+
- Current branch: `main`
5+
- Expected branch: `main`
6+
- Local branches found: `main`
7+
- Branch validation: PASS
8+
9+
## Requirement Checklist
10+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before edits.
11+
- PASS: Verified current git branch is `main` before edits.
12+
- PASS: Continued from PR_26162_043.
13+
- PASS: Removed the `Normalized Controls` accordion from `toolbox/controls/`.
14+
- PASS: Reviewed `Presets` in `toolbox/controls/`.
15+
- PASS: Presets kept only as wireframe-safe future functionality; active preset buttons and DB mutation code were removed.
16+
- PASS: Presets unique value documented: genre-specific starter templates such as Platformer, Shooter, Vehicle, Fighting, Menu, Paddle / Ball, and Party / Arena remain useful future planning references distinct from seeded default Game Controls.
17+
- PASS: Keyboard scoped User Controls rows no longer show redundant `Keyboard:` prefixes.
18+
- PASS: Mouse scoped User Controls rows no longer show redundant `Mouse:` prefixes.
19+
- PASS: Game Controllers scoped rows/dropdown labels no longer show redundant `Gamepad:` prefixes.
20+
- PASS: `Not applicable` was replaced with `N/A` in active Controls/User Controls UI.
21+
- PASS: DB-backed separation is preserved: `game_input_mappings` remains game/project owned; `player_controller_profiles` remains user/player owned.
22+
- PASS: Normalized action contract is preserved.
23+
- PASS: Editable keyboard/mouse mappings are preserved.
24+
- PASS: Editable game controller names are preserved.
25+
- PASS: Gamepad table layout, defaults, and persistence are preserved.
26+
- PASS: No sample JSON alignment, auth behavior, production account system, or unrelated rewrites were added.
27+
- PASS: Theme V2 restrictions preserved; no inline CSS, inline JS, script/style blocks, or inline event handlers were added.
28+
29+
## Changed Files
30+
- `toolbox/controls/index.html`
31+
- `toolbox/controls/controls.js`
32+
- `account/user-controls-page.js`
33+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
34+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
35+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
36+
- `docs_build/dev/reports/controls-user-controls-copy-cleanup-report.md`
37+
38+
## Impacted Lanes
39+
- Runtime/tool lane: Toolbox > Controls.
40+
- Account runtime lane: Account > User Controls.
41+
- Playwright impacted: Yes.
42+
43+
## Presets Review
44+
- Decision: Keep Presets as wireframe-safe future functionality.
45+
- Reason: Presets are not identical to seeded default Game Controls; they represent future genre templates that could quickly reshape Game Controls for a specific game style.
46+
- Safety change: Removed active preset buttons and the `applyGameControlPreset` mutation path, so Presets no longer write to `game_input_mappings`.
47+
48+
## Validation Performed
49+
- PASS: `node --check toolbox/controls/controls.js`
50+
- PASS: `node --check account/user-controls-page.js`
51+
- PASS: `node --check account/user-controls.js`
52+
- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
53+
- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --reporter=line`
54+
- Result: 6 passed.
55+
- PASS: `git diff --check`
56+
57+
## Playwright Evidence
58+
- PASS: Normalized Controls accordion is absent.
59+
- PASS: Normalized Controls catalog selectors are absent.
60+
- PASS: Presets has no active preset buttons and renders a wireframe planning list.
61+
- PASS: Game Controls default rows still load and persist.
62+
- PASS: Game Controls row editing and persistence still work.
63+
- PASS: Keyboard, Mouse, and Game Controller scoped sections do not repeat `Keyboard:`, `Mouse:`, or `Gamepad:` prefixes.
64+
- PASS: `N/A` appears for non-applicable controller tuning fields.
65+
- PASS: `Not applicable` does not appear in the active page body.
66+
- PASS: Keyboard/mouse profile editing persists after reload.
67+
- PASS: Gamepad name editing, table layout, axis/trigger controls, and profile persistence still work.
68+
69+
## Search Evidence
70+
- PASS: `rg "Not applicable|Keyboard:|Mouse:|Gamepad:" account/user-controls.html account/user-controls-page.js toolbox/controls/index.html toolbox/controls/controls.js -n` returned no matches.
71+
- PASS: `rg "Normalized Controls|data-input-action-catalog|data-input-default-actions|data-input-preset=|GAME_CONTROL_PRESETS|applyGameControlPreset|Applied .* preset|Apply a preset" toolbox/controls -n` returned no matches.
72+
- PASS: `rg "<script(?![^>]*src=)|<style|\s(onclick|onchange|oninput|onsubmit)=" account/user-controls.html toolbox/controls/index.html -n --pcre2` returned no matches.
73+
74+
## V8 Coverage
75+
- Coverage report: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
76+
- PASS: `(93%) account/user-controls-page.js - executed lines 820/820; executed functions 98/105`
77+
- PASS: `(96%) toolbox/controls/controls.js - executed lines 509/509; executed functions 51/53`
78+
- PASS: No changed runtime JS coverage warnings after normalizing the report to PR_26162_044 changed runtime JavaScript files.
79+
80+
## Manual Validation Steps
81+
1. Open `/toolbox/controls/index.html`.
82+
2. Confirm `Normalized Controls` is not present.
83+
3. Confirm Presets is a wireframe-only planning list with no clickable preset buttons.
84+
4. Confirm default Game Controls rows still appear and the mapping count is populated.
85+
5. Edit a Game Controls row, save, reload, and confirm persistence.
86+
6. Open `/account/user-controls.html`.
87+
7. Confirm Keyboard and Mouse sections do not show `Keyboard:` or `Mouse:` prefixes in saved rows.
88+
8. Confirm Game Controllers does not show `Gamepad:` prefixes in the dropdown or saved rows.
89+
9. Create/edit a game controller profile and confirm non-applicable fields show `N/A`.
90+
10. Save and reload to confirm profile persistence.
91+
92+
## Skipped Lanes
93+
- SKIP: Full samples validation. Safe to skip because no sample JSON or sample runtime files were changed.
94+
- SKIP: Full repository test suite. Safe to skip because the PR only changes scoped Controls/User Controls UI/runtime and targeted Playwright covers the affected behavior.
95+
- SKIP: Broader engine validation. Safe to skip because no `src/engine/input` code was changed.
96+
97+
## Samples Decision
98+
- Full samples validation: SKIP.
99+
- Reason: Samples are explicitly out of scope and unchanged.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Changed Runtime JS Coverage Guardrail
33
Status: advisory only.
44
Thresholds: none enforced.
55
Missing changed runtime JS files are WARN, not FAIL.
6-
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
6+
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run, normalized to PR_26162_044 changed runtime JavaScript files.
77

88
Changed runtime JS files considered:
9-
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(95%) toolbox/controls/controls.js - executed lines 664/664; executed functions 59/62
9+
(93%) account/user-controls-page.js - executed lines 820/820; executed functions 98/105
10+
(96%) toolbox/controls/controls.js - executed lines 509/509; executed functions 51/53
1111

1212
Guardrail warnings:
13-
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
13+
(100%) none - no changed runtime JS coverage warnings

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Playwright V8 Coverage Report
22

3-
PR: generated by current Playwright run.
3+
PR: generated by current Playwright run and normalized to PR_26162_044 changed runtime JavaScript files.
44
Coverage source: Playwright/Chromium built-in V8 coverage.
55
Coverage scope: all repo-relative browser JavaScript collected by Playwright/Chromium V8 coverage.
66
Dependencies: no new npm packages.
@@ -17,8 +17,8 @@ Exercised tool entry points detected:
1717
(62%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(95%) toolbox/controls/controls.js - executed lines 664/664; executed functions 59/62
20+
(93%) account/user-controls-page.js - executed lines 820/820; executed functions 98/105
21+
(96%) toolbox/controls/controls.js - executed lines 509/509; executed functions 51/53
2222

2323
Files with executed line/function counts where available:
2424
(11%) src/engine/input/InputMappingManifest.js - executed lines 78/78; executed functions 1/9
@@ -37,15 +37,14 @@ Files with executed line/function counts where available:
3737
(80%) src/engine/input/GamepadState.js - executed lines 100/100; executed functions 16/20
3838
(89%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 24/27
3939
(93%) account/user-controls-page.js - executed lines 820/820; executed functions 98/105
40-
(95%) toolbox/controls/controls.js - executed lines 664/664; executed functions 59/62
40+
(96%) toolbox/controls/controls.js - executed lines 509/509; executed functions 51/53
4141
(100%) account/user-controls.js - executed lines 2/2; executed functions 1/1
4242
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
4343

4444
Uncovered or low-coverage changed JS files:
45-
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
45+
(100%) none - no low-coverage changed runtime JS files
4646

4747
Changed JS files considered:
48-
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - changed JS file not collected as browser runtime coverage
4948
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
5049
(93%) account/user-controls-page.js - changed JS file with browser V8 coverage
51-
(95%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
50+
(96%) toolbox/controls/controls.js - changed JS file with browser V8 coverage

0 commit comments

Comments
 (0)