Skip to content

Commit 39f34d8

Browse files
committed
Validate Controls mappings against DB-backed Objects and Actions - PR_26161_026-controls-object-action-mapping-validation
1 parent bfbbc9c commit 39f34d8

8 files changed

Lines changed: 1206 additions & 3452 deletions

File tree

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,18 @@
33
M docs_build/dev/reports/codex_review.diff
44
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
55
M docs_build/dev/reports/playwright_v8_coverage_report.txt
6-
M src/dev-runtime/admin/header-nav.local.html
7-
M src/dev-runtime/guest-seeds/tool-metadata-inventory.js
8-
M src/dev-runtime/persistence/mock-db-store.js
9-
M src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js
10-
M src/dev-runtime/server/mock-api-router.mjs
11-
M tests/playwright/tools/AdminDbViewer.spec.mjs
126
M tests/playwright/tools/InputMappingV2Tool.spec.mjs
13-
M tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs
7+
M toolbox/controls/controls.js
148
M toolbox/controls/index.html
15-
M toolbox/input-mapping-v2/index.html
16-
D toolbox/input-mapping-v2/input-mapping-api-client.js
17-
D toolbox/input-mapping-v2/input-mapping-v2.js
18-
?? docs_build/dev/reports/PR_26161_025-controls-authoritative-ownership-report.md
19-
?? toolbox/controls/controls-api-client.js
20-
?? toolbox/controls/controls.js
9+
?? docs_build/dev/reports/controls-object-action-mapping-validation-report.md
2110

2211
# git ls-files --others --exclude-standard
23-
docs_build/dev/reports/PR_26161_025-controls-authoritative-ownership-report.md
24-
toolbox/controls/controls-api-client.js
25-
toolbox/controls/controls.js
12+
docs_build/dev/reports/controls-object-action-mapping-validation-report.md
2613

2714
# git diff --stat (excluding review artifact files)
28-
.../dev/reports/coverage_changed_js_guardrail.txt | 12 +-
29-
.../dev/reports/playwright_v8_coverage_report.txt | 25 +-
30-
src/dev-runtime/admin/header-nav.local.html | 2 +-
31-
.../guest-seeds/tool-metadata-inventory.js | 41 +-
32-
src/dev-runtime/persistence/mock-db-store.js | 4 +-
33-
.../input-mapping-mock-repository.js | 2 +-
34-
src/dev-runtime/server/mock-api-router.mjs | 12 +-
35-
tests/playwright/tools/AdminDbViewer.spec.mjs | 12 +
36-
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 35 +-
37-
.../tools/ToolboxAdminMetadataSsot.spec.mjs | 47 +-
38-
toolbox/controls/index.html | 2 +-
39-
toolbox/input-mapping-v2/index.html | 165 +--
40-
.../input-mapping-v2/input-mapping-api-client.js | 15 -
41-
toolbox/input-mapping-v2/input-mapping-v2.js | 1333 --------------------
42-
14 files changed, 156 insertions(+), 1551 deletions(-)
15+
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
16+
.../dev/reports/playwright_v8_coverage_report.txt | 8 +-
17+
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 220 +++++++++++++++++++++
18+
toolbox/controls/controls.js | 205 +++++++++++++++++--
19+
toolbox/controls/index.html | 5 +
20+
5 files changed, 416 insertions(+), 24 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 680 additions & 3397 deletions
Large diffs are not rendered by default.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# PR_26161_026-controls-object-action-mapping-validation
2+
3+
## Branch Validation
4+
5+
- Current branch: `main`
6+
- Expected branch: `main`
7+
- Result: PASS
8+
9+
## Scope
10+
11+
- Impacted lane: Controls/Input Mapping tool.
12+
- Playwright impacted: Yes.
13+
- Controls status: Wireframe preserved.
14+
- Runtime engine behavior: Not changed.
15+
- Samples: Skipped.
16+
17+
## Requirement Checklist
18+
19+
- PASS - Controls data remains DB-backed through the shared DB/mock adapter.
20+
- PASS - Object dropdown loads DB-backed Objects records through the Objects repository client.
21+
- PASS - Footer Action dropdown filters from the selected Object.
22+
- PASS - Inline row Action dropdown filters from the row Object.
23+
- PASS - Collectible objects do not expose Move Left, Move Right, or Jump.
24+
- PASS - Hero objects expose movement and interaction actions.
25+
- PASS - Projectile objects expose fire/launch actions.
26+
- PASS - Invalid Object/Action combinations show creator-facing row validation.
27+
- PASS - Invalid Object/Action combinations are blocked from UI save.
28+
- PASS - Existing invalid persisted mappings are visible as `Pending Setup`.
29+
- PASS - Valid Object/Action combinations save and persist after reload.
30+
- PASS - Object Summary information appears in the mappings footer:
31+
- Selected Object
32+
- Object Role/Template
33+
- Available Actions
34+
- PASS - Controller profiles and device detection behavior preserved.
35+
- PASS - Edit-gated capture preserved.
36+
- PASS - Accordion layout preserved.
37+
- PASS - Reset confirmation preserved and covered.
38+
- PASS - Theme V2 only; no inline CSS, inline JS, script blocks, style blocks, or inline event handlers added.
39+
- PASS - No sample JSON alignment, auth behavior, production game runtime behavior, or unrelated rewrites added.
40+
41+
## Implementation Notes
42+
43+
- Added object/template action rules in `toolbox/controls/controls.js`.
44+
- Preserved Objects as the source for selectable object records and carried object role/capability metadata into Controls.
45+
- Updated footer Action options whenever the selected Object changes.
46+
- Updated row Action options whenever the row Object changes.
47+
- Added row-level validation for saved mappings that reference invalid Object/Action combinations.
48+
- Added a save guard so invalid combinations cannot be newly saved from the Controls UI.
49+
- Added footer Object Summary display in `toolbox/controls/index.html`.
50+
- Added reset confirmation before clearing mappings.
51+
52+
## Validation Performed
53+
54+
- PASS - `node --check toolbox/controls/controls.js`
55+
- PASS - `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
56+
- PASS - HTML restriction scan on `toolbox/controls/index.html`
57+
- PASS - `git diff --check` passed with line-ending warnings only.
58+
- PASS - `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs`: 6/6 passed.
59+
60+
## Playwright Behavior Coverage
61+
62+
- PASS - Object dropdown loads DB-backed Hero, Coin, and Bolt records.
63+
- PASS - Collectible action list filters to Confirm, Interact, and Select.
64+
- PASS - Hero action list includes movement, Jump, and Interact.
65+
- PASS - Projectile action list filters to Fire, Rotate Left, Rotate Right, and Thrust.
66+
- PASS - Valid Projectile + Fire mapping saves and persists after reload.
67+
- PASS - Invalid Coin + Move Left persisted mapping shows actionable row validation.
68+
- PASS - Repairing the invalid row to Coin + Interact saves and persists.
69+
- PASS - Device refresh still detects a mocked gamepad.
70+
- PASS - Reset confirmation cancel preserves mappings.
71+
- PASS - Reset confirmation accept clears mappings through the shared DB adapter.
72+
73+
## V8 Coverage
74+
75+
- PASS - `docs_build/dev/reports/playwright_v8_coverage_report.txt` generated.
76+
- PASS - `toolbox/controls/controls.js`: 93% function coverage in the final Controls run.
77+
- PASS - `toolbox/controls/controls-api-client.js`: 100% function coverage in the final Controls run.
78+
- WARN - The coverage helper also lists JS files changed in `HEAD` from the prior PR as advisory WARN entries; those files are not part of this PR's git status and were not modified here.
79+
80+
## Skipped Lanes
81+
82+
- Full samples validation: SKIPPED. Samples were not in scope and no sample JSON changed.
83+
- Full suite: SKIPPED. Targeted Controls/Input Mapping Playwright covered the changed behavior.
84+
- Production game runtime validation: SKIPPED. No production game runtime behavior changed.
85+
86+
## Manual Validation Steps
87+
88+
1. Open `toolbox/controls/index.html`.
89+
2. Confirm the mappings footer shows Action, Object, and Object Summary.
90+
3. Select a Collectible object and confirm movement actions are not available.
91+
4. Select a Hero object and confirm movement and Interact actions are available.
92+
5. Select a Projectile object and confirm fire/launch actions are available.
93+
6. Add a valid mapping, reload, and confirm it remains.
94+
7. Confirm an invalid persisted mapping shows a row warning and can be repaired by editing the row.
95+
96+
## Artifacts
97+
98+
- PASS - Review diff: `docs_build/dev/reports/codex_review.diff`
99+
- PASS - Changed files: `docs_build/dev/reports/codex_changed_files.txt`
100+
- PASS - V8 coverage: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
101+
- PASS - Repo-structured delta ZIP: `tmp/PR_26161_026-controls-object-action-mapping-validation_delta.zip`

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Changed runtime JS files considered:
1010
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1111
(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
1212
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
13-
(91%) toolbox/controls/controls.js - executed lines 1225/1225; executed functions 117/128
13+
(93%) toolbox/controls/controls.js - executed lines 1379/1379; executed functions 138/149
1414
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
1515

1616
Guardrail warnings:

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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-
(89%) Toolbox Index - exercised 4 runtime JS files
15+
(90%) Toolbox Index - exercised 4 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
1717
(59%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

@@ -21,15 +21,15 @@ Changed runtime JS files covered:
2121
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2222
(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
2323
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(91%) toolbox/controls/controls.js - executed lines 1225/1225; executed functions 117/128
24+
(93%) toolbox/controls/controls.js - executed lines 1379/1379; executed functions 138/149
2525
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
2626

2727
Files with executed line/function counts where available:
2828
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
2929
(58%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 603/603; executed functions 30/52
3030
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
3131
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
32-
(91%) toolbox/controls/controls.js - executed lines 1225/1225; executed functions 117/128
32+
(93%) toolbox/controls/controls.js - executed lines 1379/1379; executed functions 138/149
3333
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
3434
(100%) toolbox/objects/objects-api-client.js - executed lines 10/10; executed functions 2/2
3535

@@ -47,5 +47,5 @@ Changed JS files considered:
4747
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
4848
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
4949
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
50-
(91%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
50+
(93%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
5151
(100%) toolbox/controls/controls-api-client.js - changed JS file with browser V8 coverage

0 commit comments

Comments
 (0)