Skip to content

Commit b9abd40

Browse files
committed
Separate physical controller inputs from game controls - PR_26162_046-controls-remove-physical-controller-actions
1 parent d3f1f4c commit b9abd40

9 files changed

Lines changed: 631 additions & 583 deletions
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# git status --short
2-
M account/user-controls-page.js
3-
M account/user-controls.html
4-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
53
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4+
M src/engine/input/NormalizedInputRegistry.js
5+
M tests/input/NormalizedInputRegistry.test.mjs
66
M tests/playwright/tools/InputMappingV2Tool.spec.mjs
7-
?? docs_build/dev/reports/user-controls-input-capture-cleanup-report.md
7+
M toolbox/controls/controls.js
8+
?? docs_build/dev/reports/controls-remove-physical-controller-actions-report.md
89

910
# git ls-files --others --exclude-standard
10-
docs_build/dev/reports/user-controls-input-capture-cleanup-report.md
11+
docs_build/dev/reports/controls-remove-physical-controller-actions-report.md
1112

1213
# git diff --stat
13-
account/user-controls-page.js | 200 ++++++++++++++++++---
14-
account/user-controls.html | 3 -
15-
.../dev/reports/coverage_changed_js_guardrail.txt | 9 +-
16-
.../dev/reports/playwright_v8_coverage_report.txt | 27 ++-
17-
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 41 ++++-
18-
5 files changed, 230 insertions(+), 50 deletions(-)
14+
.../dev/reports/coverage_changed_js_guardrail.txt | 7 +--
15+
.../dev/reports/playwright_v8_coverage_report.txt | 18 +++---
16+
src/engine/input/NormalizedInputRegistry.js | 12 ++--
17+
tests/input/NormalizedInputRegistry.test.mjs | 8 ++-
18+
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 55 ++++++++++++-----
19+
toolbox/controls/controls.js | 69 ++++++++++++++++++----
20+
6 files changed, 121 insertions(+), 48 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 411 additions & 524 deletions
Large diffs are not rendered by default.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# PR_26162_046 Controls Remove Physical Controller Actions
2+
3+
## Branch Validation
4+
- PASS: Current branch is `main`.
5+
- Expected branch: `main`.
6+
- Evidence: `git status --short --branch` reported `## main...origin/main`.
7+
8+
## Requirement Checklist
9+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before edits.
10+
- PASS: Verified branch is `main` before edits.
11+
- PASS: Continued from PR_26162_045.
12+
- PASS: Controls status remains Wireframe; tool metadata/status was not changed.
13+
- PASS: Controls data remains DB-backed through the shared DB/mock adapter only.
14+
- PASS: Toolbox > Controls no longer creates or edits game controls for `dpad.up`, `dpad.down`, `dpad.left`, `dpad.right`, `trigger.left`, or `trigger.right`.
15+
- PASS: Toolbox > Controls does not define physical controller inputs; `game_input_mappings` remains free of controller id/name and physical input fields.
16+
- PASS: Toolbox > Controls keeps only the requested game-level normalized controls:
17+
`move.x-`, `move.x+`, `move.y-`, `move.y+`, `aim.x-`, `aim.x+`, `aim.y-`, `aim.y+`, `action.primary`, `action.secondary`, `action.tertiary`, `action.quaternary`, `action.confirm`, `action.cancel`, `action.pause`, `action.start`, `action.select`.
18+
- PASS: Account > User Controls keeps physical DPad and trigger rows available.
19+
- PASS: Account > User Controls default mappings support `DPad Up -> move.y-`, `DPad Down -> move.y+`, `DPad Left -> move.x-`, `DPad Right -> move.x+`, `Left Trigger -> action.primary`, and `Right Trigger -> action.secondary`.
20+
- PASS: Editable controller mappings, deadzone, invert, sensitivity, and controller naming are preserved.
21+
- PASS: Combo Controls wireframe remains in Toolbox > Controls.
22+
- PASS: Aim remains normalized axis controls in Game Controls and was not moved into Combo Controls.
23+
- PASS: No sample JSON alignment, auth behavior, production account system, or unrelated rewrites were added.
24+
25+
## Changed Files
26+
- `toolbox/controls/controls.js`
27+
- `src/engine/input/NormalizedInputRegistry.js`
28+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
29+
- `tests/input/NormalizedInputRegistry.test.mjs`
30+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
31+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
32+
- `docs_build/dev/reports/controls-remove-physical-controller-actions-report.md`
33+
34+
## Impacted Lanes
35+
- Controls tool runtime lane.
36+
- Account/User Controls runtime lane.
37+
- Engine input normalization/default mapping lane.
38+
39+
## Validation Performed
40+
- PASS: `node --check toolbox/controls/controls.js`
41+
- PASS: `node --check account/user-controls-page.js`
42+
- PASS: `node --check src/engine/input/NormalizedInputRegistry.js`
43+
- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
44+
- PASS: `node --check tests/input/NormalizedInputRegistry.test.mjs`
45+
- PASS: `node tests/input/NormalizedInputRegistry.test.mjs`
46+
- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs` passed 6/6.
47+
- PASS: `git diff --check`
48+
- PASS: `rg -n -P "<style|style\\s*=|\\son[a-z]+\\s*=" toolbox/controls/index.html toolbox/controls/controls.js account/user-controls.html account/user-controls-page.js` returned no matches.
49+
50+
## Playwright Result
51+
- PASS: Toolbox > Controls renders 17 game-level normalized rows.
52+
- PASS: Toolbox > Controls table/list excludes `dpad.*`, `trigger.*`, `D-Pad`, `Trigger`, and `action.menu`.
53+
- PASS: Toolbox > Controls edit dropdown excludes `dpad.*`, `trigger.*`, and `action.menu`.
54+
- PASS: Toolbox > Controls still includes `aim.x-`, `aim.x+`, `aim.y-`, and `aim.y+`.
55+
- PASS: Combo Controls wireframe remains visible.
56+
- PASS: Account > User Controls keeps physical DPad and trigger rows.
57+
- PASS: Account > User Controls maps DPad and trigger defaults into movement/action normalized controls.
58+
- PASS: Profiles and mappings persist after reload.
59+
60+
## V8 Coverage
61+
- PASS: `docs_build/dev/reports/playwright_v8_coverage_report.txt` refreshed from the targeted Playwright run.
62+
- PASS: `(93%) toolbox/controls/controls.js - changed JS file with browser V8 coverage`.
63+
- PASS: `(89%) src/engine/input/NormalizedInputRegistry.js - changed JS file with browser V8 coverage`.
64+
- PASS: `coverage_changed_js_guardrail.txt` reports no changed runtime JS coverage warnings.
65+
66+
## Skipped Lanes
67+
- Full samples validation: SKIPPED per request. Safe to skip because this PR only changes Controls/User Controls input mapping behavior and a targeted shared input default contract; no sample JSON or sample runtime files changed.
68+
- Full repository test suite: SKIPPED. Safe to skip because targeted Controls/User Controls Playwright plus the targeted engine input registry test covered the changed behavior.
69+
- Workspace V2 broad lane: SKIPPED. Safe to skip because this PR did not change navigation, workspace launch contracts, or workspace persistence.
70+
71+
## Samples Decision
72+
- Samples validation was not run, per request.
73+
74+
## Manual Validation Steps
75+
1. Open `toolbox/controls/index.html`.
76+
2. Confirm Game Controls shows only the 17 game-level normalized rows and no DPad/trigger/action.menu rows.
77+
3. Edit a Game Controls row and confirm the Normalized Action dropdown excludes dpad/trigger/action.menu while keeping aim axes.
78+
4. Confirm Combo Controls still shows the wireframe text.
79+
5. Open `account/user-controls.html`.
80+
6. Create a game controller profile from a detected controller.
81+
7. Confirm DPad Up/Down/Left/Right rows are present and default to move directions.
82+
8. Confirm Trigger Left/Right rows are present and default to primary/secondary actions.
83+
9. Save, reload, and confirm mappings persist.
84+
85+
## Notes
86+
- The global normalized registry still retains physical-controller-specific normalized identifiers for Account/User Controls compatibility, but Toolbox > Controls filters them out and cleans stale game-control records from the shared mock DB when encountered.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(94%) account/user-controls-page.js - current PR changed runtime JS file with browser V8 coverage; executed lines 961/961; executed functions 111/118
10-
(0%) toolbox/controls/controls.js - WARNING: reporter HEAD-baseline file was not collected by Playwright V8 coverage; not part of the current PR diff; advisory only
9+
(89%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 24/27
10+
(93%) toolbox/controls/controls.js - executed lines 548/548; executed functions 56/60
1111

1212
Guardrail warnings:
13-
(100%) none for current PR changed runtime JS files
14-
(0%) toolbox/controls/controls.js - WARNING: reporter HEAD-baseline file missing from coverage; not part of the current PR diff; advisory only
13+
(100%) none - no changed runtime JS coverage warnings

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(100%) Toolbox Index - exercised 1 runtime JS files
15+
(88%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(61%) Theme V2 Shared JS - exercised 1 runtime JS files
17+
(62%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(94%) account/user-controls-page.js - current PR changed runtime JS file with browser V8 coverage; executed lines 961/961; executed functions 111/118
21-
(0%) toolbox/controls/controls.js - WARNING: reporter HEAD-baseline file was not collected by Playwright V8 coverage; not part of the current PR diff; advisory only
20+
(89%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 24/27
21+
(93%) toolbox/controls/controls.js - executed lines 548/548; executed functions 56/60
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
@@ -33,17 +33,21 @@ Files with executed line/function counts where available:
3333
(59%) src/engine/input/PointerDragState.js - executed lines 225/225; executed functions 13/22
3434
(60%) src/engine/input/InputCapabilityDescriptors.js - executed lines 261/261; executed functions 9/15
3535
(61%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 625/625; executed functions 33/54
36+
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
37+
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
3638
(80%) src/engine/input/GamepadState.js - executed lines 100/100; executed functions 16/20
3739
(89%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 24/27
40+
(93%) toolbox/controls/controls.js - executed lines 548/548; executed functions 56/60
3841
(94%) account/user-controls-page.js - executed lines 961/961; executed functions 111/118
3942
(100%) account/user-controls.js - executed lines 2/2; executed functions 1/1
4043
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
4144

4245
Uncovered or low-coverage changed JS files:
43-
(100%) none for current PR changed runtime JS files
44-
(0%) toolbox/controls/controls.js - WARNING: reporter HEAD-baseline file missing from coverage; not part of the current PR diff; advisory only
46+
(100%) none - no low-coverage changed runtime JS files
4547

4648
Changed JS files considered:
49+
(0%) tests/input/NormalizedInputRegistry.test.mjs - changed JS file not collected as browser runtime coverage
4750
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
48-
(0%) toolbox/controls/controls.js - changed JS file not collected as browser runtime coverage
51+
(89%) src/engine/input/NormalizedInputRegistry.js - changed JS file with browser V8 coverage
52+
(93%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
4953
(94%) account/user-controls-page.js - changed JS file with browser V8 coverage

src/engine/input/NormalizedInputRegistry.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ const DEFAULT_PHYSICAL_INPUT_MAP = Object.freeze({
4949
Button3: 'action.quaternary',
5050
Button8: 'action.select',
5151
Button9: 'action.start',
52-
'DPad Down': 'dpad.down',
53-
'DPad Left': 'dpad.left',
54-
'DPad Right': 'dpad.right',
55-
'DPad Up': 'dpad.up',
52+
'DPad Down': 'move.y+',
53+
'DPad Left': 'move.x-',
54+
'DPad Right': 'move.x+',
55+
'DPad Up': 'move.y-',
5656
Enter: 'action.confirm',
5757
Escape: 'action.cancel',
5858
KeyA: 'move.x-',
@@ -65,8 +65,8 @@ const DEFAULT_PHYSICAL_INPUT_MAP = Object.freeze({
6565
MouseX: 'aim.x+',
6666
MouseY: 'aim.y+',
6767
Space: 'action.primary',
68-
'Trigger Left': 'trigger.left',
69-
'Trigger Right': 'trigger.right',
68+
'Trigger Left': 'action.primary',
69+
'Trigger Right': 'action.secondary',
7070
});
7171

7272
const DEFAULT_PHYSICAL_AXIS_DIRECTION_MAP = Object.freeze({

tests/input/NormalizedInputRegistry.test.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ function testRegistryContainsPlayableNormalizedInputs() {
5050
function testPhysicalDefaultsRouteThroughNormalizedInputs() {
5151
assert.equal(defaultNormalizedInputForPhysicalInput('Button0'), 'action.primary');
5252
assert.equal(defaultNormalizedInputForPhysicalInput('Button1'), 'action.secondary');
53-
assert.equal(defaultNormalizedInputForPhysicalInput('DPad Up'), 'dpad.up');
54-
assert.equal(defaultNormalizedInputForPhysicalInput('Trigger Right'), 'trigger.right');
53+
assert.equal(defaultNormalizedInputForPhysicalInput('DPad Up'), 'move.y-');
54+
assert.equal(defaultNormalizedInputForPhysicalInput('DPad Down'), 'move.y+');
55+
assert.equal(defaultNormalizedInputForPhysicalInput('DPad Left'), 'move.x-');
56+
assert.equal(defaultNormalizedInputForPhysicalInput('DPad Right'), 'move.x+');
57+
assert.equal(defaultNormalizedInputForPhysicalInput('Trigger Left'), 'action.primary');
58+
assert.equal(defaultNormalizedInputForPhysicalInput('Trigger Right'), 'action.secondary');
5559
assert.equal(defaultNormalizedInputForPhysicalInput('Axis0'), 'move.x+');
5660
assert.equal(defaultNormalizedInputForPhysicalInput('Axis3'), 'aim.y+');
5761
assert.equal(defaultNormalizedInputForPhysicalInput('KeyW'), 'move.y-');

0 commit comments

Comments
 (0)