Skip to content

Commit 52362d5

Browse files
committed
Remove Controls mapping JSON accordion and add action descriptions - PR_26161_022-controls-action-descriptions
1 parent 7e8b171 commit 52362d5

9 files changed

Lines changed: 292 additions & 537 deletions

File tree

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ M docs_build/dev/reports/coverage_changed_js_guardrail.txt
55
M toolbox/controls/index.html
66
M toolbox/input-mapping-v2/index.html
77
M toolbox/input-mapping-v2/input-mapping-v2.js
8-
?? docs_build/dev/reports/controls-device-specific-input-report.md
8+
?? docs_build/dev/reports/controls-action-descriptions-report.md
99

1010
# git ls-files --others --exclude-standard
11-
docs_build/dev/reports/controls-device-specific-input-report.md
11+
docs_build/dev/reports/controls-action-descriptions-report.md
1212

1313
# git diff --stat
14-
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +-
15-
.../dev/reports/playwright_v8_coverage_report.txt | 8 +-
16-
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 45 +++++++-
17-
toolbox/controls/index.html | 66 ++++++------
18-
toolbox/input-mapping-v2/index.html | 66 ++++++------
19-
toolbox/input-mapping-v2/input-mapping-v2.js | 114 +++++++++++++++++----
20-
6 files changed, 210 insertions(+), 93 deletions(-)
14+
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
15+
.../dev/reports/playwright_v8_coverage_report.txt | 8 ++---
16+
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 29 +++++++++++++---
17+
toolbox/controls/index.html | 6 ----
18+
toolbox/input-mapping-v2/index.html | 6 ----
19+
toolbox/input-mapping-v2/input-mapping-v2.js | 40 +++++++++++++---------
20+
6 files changed, 54 insertions(+), 37 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 171 additions & 491 deletions
Large diffs are not rendered by default.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# PR_26161_022 Controls Action Descriptions Report
2+
3+
## Branch Validation
4+
- Current branch: `main`
5+
- Expected branch: `main`
6+
- Result: PASS
7+
8+
## Summary
9+
- Removed the visible Inspector > Mapping JSON accordion from Controls.
10+
- Preserved internal mapping payload generation for tool output/status logic, without displaying it as an accordion.
11+
- Added creator-facing descriptions next to every default action in Controls > Actions.
12+
- Preserved alphabetical action ordering.
13+
- Preserved device-specific input capture, Controller Profile center placement, State explanation, table editing, Add Mapping, Cancel, Edit, Trash, DB reload persistence, and Wireframe status.
14+
15+
## Impacted Lane
16+
- runtime
17+
- recovery/UAT
18+
19+
## Playwright Impacted
20+
- Yes
21+
22+
## Testing Performed
23+
- `node --check toolbox/input-mapping-v2/input-mapping-v2.js` - PASS
24+
- `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs` - PASS
25+
- `rg --pcre2 -n "<style|style=|<script(?![^>]*\\bsrc=)|on(click|change|input|submit|keydown|keyup|pointerdown|mousedown|mouseup)=" toolbox/input-mapping-v2/index.html toolbox/controls/index.html` - PASS, no inline CSS/JS/event handlers found
26+
- `git diff --check` - PASS
27+
- `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --workers=1 --reporter=line` - PASS, 5 passed
28+
29+
## Playwright Behavior Covered
30+
- Mapping JSON accordion no longer appears.
31+
- Mapping JSON DOM output is not visible.
32+
- All listed actions display descriptions.
33+
- Action labels remain alphabetically sorted.
34+
- Device-specific capture still swaps Keyboard, Mouse, and Gamepad capture controls by selected Input Device.
35+
- Captured mappings persist after reload.
36+
- Devices, Status, controller profiles, table editing, Add Mapping, Cancel, Edit, and Trash continue to work.
37+
38+
## V8 Coverage
39+
- Report: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
40+
- Changed runtime JS covered: `toolbox/input-mapping-v2/input-mapping-v2.js`
41+
- Coverage result: 91% function coverage, 105/116 functions
42+
43+
## Manual Validation Steps
44+
1. Open `/toolbox/input-mapping-v2/index.html`.
45+
2. Confirm the Inspector column shows Devices and Status, with no Mapping JSON accordion.
46+
3. Confirm Controls > Actions lists Cancel through Thrust alphabetically.
47+
4. Confirm each action has a short creator-facing description beside it.
48+
5. Add a mapping, capture a keyboard input, save, reload, and confirm the mapping remains.
49+
6. Edit the mapping and confirm device-specific capture controls still appear for the selected device.
50+
51+
## Skipped Lanes
52+
- Full samples validation was skipped as required by the PR instructions; this change is scoped to Controls/Input Mapping UI and targeted behavior tests.
53+
- Full workspace contract lane was skipped because no Workspace V2 contract/runtime files changed; workspace return remains covered by targeted Controls Playwright.
54+
55+
## Runtime Scope Confirmation
56+
- Controls remains Wireframe.
57+
- Controls mapping and controller profile data remain persisted through the shared DB/mock adapter.
58+
- No sample JSON alignment, auth behavior, production DB behavior, engine runtime behavior, or unrelated rewrites were added.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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-
(93%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1125/1125; executed functions 111/120
9+
(91%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1133/1133; executed functions 105/116
1010

1111
Guardrail warnings:
1212
(100%) none - no changed runtime JS coverage 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,19 +12,19 @@ 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+
(88%) 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

1919
Changed runtime JS files covered:
20-
(93%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1125/1125; executed functions 111/120
20+
(91%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1133/1133; executed functions 105/116
2121

2222
Files with executed line/function counts where available:
2323
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
2424
(58%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 603/603; executed functions 30/52
2525
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
2626
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
27-
(93%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1125/1125; executed functions 111/120
27+
(91%) toolbox/input-mapping-v2/input-mapping-v2.js - executed lines 1133/1133; executed functions 105/116
2828
(100%) toolbox/input-mapping-v2/input-mapping-api-client.js - executed lines 12/12; executed functions 2/2
2929
(100%) toolbox/objects/objects-api-client.js - executed lines 10/10; executed functions 2/2
3030

@@ -33,4 +33,4 @@ Uncovered or low-coverage changed JS files:
3333

3434
Changed JS files considered:
3535
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
36-
(93%) toolbox/input-mapping-v2/input-mapping-v2.js - changed JS file with browser V8 coverage
36+
(91%) toolbox/input-mapping-v2/input-mapping-v2.js - changed JS file with browser V8 coverage

tests/playwright/tools/InputMappingV2Tool.spec.mjs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ const DEFAULT_ACTION_LABELS = [
2121
"Thrust",
2222
];
2323

24+
const DEFAULT_ACTION_DESCRIPTIONS = [
25+
"Back out of a menu or choice.",
26+
"Accept a choice or prompt.",
27+
"Use the primary attack or tool.",
28+
"Use nearby objects or prompts.",
29+
"Make the object jump.",
30+
"Move the object downward.",
31+
"Move the object left.",
32+
"Move the object right.",
33+
"Move the object upward.",
34+
"Pause gameplay or open the pause menu.",
35+
"Turn the object counterclockwise.",
36+
"Turn the object clockwise.",
37+
"Highlight or choose menu items.",
38+
"Begin gameplay or open the start menu.",
39+
"Push the object forward.",
40+
];
41+
2442
test.beforeEach(async ({ page }) => {
2543
await installPlaywrightStorageIsolation(page, {
2644
lane: "input-mapping-v2",
@@ -141,7 +159,8 @@ test("Controls Input Mapping launch panels, defaults, diagnostics, and workspace
141159
await expect(page.locator(".tool-center-panel [data-controller-profile-planning]")).toBeVisible();
142160
await expect(page.getByRole("heading", { name: "Mappings" })).toBeVisible();
143161
await expect(page.locator("[data-input-state-explanation]")).toHaveText("State: Active means the mapping is available to the game. Disabled means the mapping is saved but ignored by the game until re-enabled.");
144-
await expect(page.getByText("Mapping JSON", { exact: true })).toBeVisible();
162+
await expect(page.getByText("Mapping JSON", { exact: true })).toHaveCount(0);
163+
await expect(page.locator("[data-input-mapping-json]")).toHaveCount(0);
145164
await expect(page.getByText("Devices", { exact: true })).toBeVisible();
146165
await expect(page.getByText("Status", { exact: true })).toBeVisible();
147166
await expect(page.locator("[data-input-return-workspace]")).toBeVisible();
@@ -176,7 +195,8 @@ test("Controls Input Mapping launch panels, defaults, diagnostics, and workspace
176195
await expect(page.locator("[data-input-selected-action]")).toHaveText("Selected Action: Cancel");
177196
await expect(page.locator("[data-input-selected-object]")).toHaveText("Selected Object: Global");
178197
await expect(page.locator("[data-input-action-select] option")).toHaveText(DEFAULT_ACTION_LABELS);
179-
await expect(page.locator("[data-input-default-actions] li")).toHaveText(DEFAULT_ACTION_LABELS);
198+
await expect(page.locator("[data-input-action-label]")).toHaveText(DEFAULT_ACTION_LABELS);
199+
await expect(page.locator("[data-input-action-description]")).toHaveText(DEFAULT_ACTION_DESCRIPTIONS);
180200
expect(DEFAULT_ACTION_LABELS).toEqual([...DEFAULT_ACTION_LABELS].sort((left, right) => left.localeCompare(right)));
181201
await expect(page.locator("[data-input-action-select]")).toContainText("Pause");
182202
await expect(page.locator("[data-input-action-select]")).toContainText("Select");
@@ -438,8 +458,7 @@ test("Controls Input Mapping captures KeyA, keeps input click safe, and deletes
438458
await expect(page.locator("[data-input-mapping-list]")).toContainText("Move Left");
439459
await expect(page.locator("[data-input-mapping-list]")).toContainText("Keyboard");
440460
await expect(page.locator("[data-input-token]")).toHaveText("Keyboard KeyA");
441-
await expect(page.locator("[data-input-mapping-json]")).toContainText('"action": "moveLeft"');
442-
await expect(page.locator("[data-input-mapping-json]")).toContainText('"label": "Keyboard KeyA"');
461+
await expect(page.locator("[data-input-mapping-json]")).toHaveCount(0);
443462
await expect(page.locator("[data-input-output-status]")).toHaveText("Complete");
444463

445464
let records = await inputMappingRecords(page);
@@ -481,6 +500,8 @@ test("Controls compatibility route uses rebuilt Input Mapping surface", async ({
481500

482501
try {
483502
await expect(page.getByRole("heading", { name: "Input Mapping" })).toBeVisible();
503+
await expect(page.getByText("Mapping JSON", { exact: true })).toHaveCount(0);
504+
await expect(page.locator("[data-input-mapping-json]")).toHaveCount(0);
484505
await expect(page.locator("summary").filter({ hasText: "Capture" })).toHaveCount(0);
485506
await expect(page.locator("aside").first().locator("summary").filter({ hasText: "Controller Profiles" })).toHaveCount(0);
486507
await expect(page.locator(".tool-center-panel [data-controller-profile-planning]")).toBeVisible();

toolbox/controls/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ <h3>Controller Profiles</h3>
135135
<h2>Inspector</h2>
136136
</div>
137137
<div class="accordion-stack">
138-
<details class="vertical-accordion" open>
139-
<summary>Mapping JSON</summary>
140-
<div class="accordion-body content-stack">
141-
<pre data-input-mapping-json>{}</pre>
142-
</div>
143-
</details>
144138
<details class="vertical-accordion" open>
145139
<summary>Devices</summary>
146140
<div class="accordion-body content-stack">

toolbox/input-mapping-v2/index.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ <h3>Controller Profiles</h3>
135135
<h2>Inspector</h2>
136136
</div>
137137
<div class="accordion-stack">
138-
<details class="vertical-accordion" open>
139-
<summary>Mapping JSON</summary>
140-
<div class="accordion-body content-stack">
141-
<pre data-input-mapping-json>{}</pre>
142-
</div>
143-
</details>
144138
<details class="vertical-accordion" open>
145139
<summary>Devices</summary>
146140
<div class="accordion-body content-stack">

toolbox/input-mapping-v2/input-mapping-v2.js

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import { createObjectsToolApiRepository } from "../objects/objects-api-client.js
22
import { createInputMappingToolApiRepository } from "./input-mapping-api-client.js";
33

44
const DEFAULT_ACTIONS = Object.freeze([
5-
Object.freeze({ id: "cancel", label: "Cancel" }),
6-
Object.freeze({ id: "confirm", label: "Confirm" }),
7-
Object.freeze({ id: "fire", label: "Fire" }),
8-
Object.freeze({ id: "interact", label: "Interact" }),
9-
Object.freeze({ id: "jump", label: "Jump" }),
10-
Object.freeze({ id: "moveDown", label: "Move Down" }),
11-
Object.freeze({ id: "moveLeft", label: "Move Left" }),
12-
Object.freeze({ id: "moveRight", label: "Move Right" }),
13-
Object.freeze({ id: "moveUp", label: "Move Up" }),
14-
Object.freeze({ id: "pause", label: "Pause" }),
15-
Object.freeze({ id: "rotateLeft", label: "Rotate Left" }),
16-
Object.freeze({ id: "rotateRight", label: "Rotate Right" }),
17-
Object.freeze({ id: "select", label: "Select" }),
18-
Object.freeze({ id: "start", label: "Start" }),
19-
Object.freeze({ id: "thrust", label: "Thrust" }),
5+
Object.freeze({ description: "Back out of a menu or choice.", id: "cancel", label: "Cancel" }),
6+
Object.freeze({ description: "Accept a choice or prompt.", id: "confirm", label: "Confirm" }),
7+
Object.freeze({ description: "Use the primary attack or tool.", id: "fire", label: "Fire" }),
8+
Object.freeze({ description: "Use nearby objects or prompts.", id: "interact", label: "Interact" }),
9+
Object.freeze({ description: "Make the object jump.", id: "jump", label: "Jump" }),
10+
Object.freeze({ description: "Move the object downward.", id: "moveDown", label: "Move Down" }),
11+
Object.freeze({ description: "Move the object left.", id: "moveLeft", label: "Move Left" }),
12+
Object.freeze({ description: "Move the object right.", id: "moveRight", label: "Move Right" }),
13+
Object.freeze({ description: "Move the object upward.", id: "moveUp", label: "Move Up" }),
14+
Object.freeze({ description: "Pause gameplay or open the pause menu.", id: "pause", label: "Pause" }),
15+
Object.freeze({ description: "Turn the object counterclockwise.", id: "rotateLeft", label: "Rotate Left" }),
16+
Object.freeze({ description: "Turn the object clockwise.", id: "rotateRight", label: "Rotate Right" }),
17+
Object.freeze({ description: "Highlight or choose menu items.", id: "select", label: "Select" }),
18+
Object.freeze({ description: "Begin gameplay or open the start menu.", id: "start", label: "Start" }),
19+
Object.freeze({ description: "Push the object forward.", id: "thrust", label: "Thrust" }),
2020
].sort((left, right) => left.label.localeCompare(right.label, undefined, { sensitivity: "base" })));
2121

2222
const DEVICE_OPTIONS = Object.freeze([
@@ -423,7 +423,15 @@ function renderDefaults() {
423423
}
424424
elements.defaultActions.replaceChildren(...DEFAULT_ACTIONS.map((action) => {
425425
const item = document.createElement("li");
426-
item.textContent = action.label;
426+
item.className = "content-split";
427+
const label = document.createElement("strong");
428+
label.dataset.inputActionLabel = action.id;
429+
label.textContent = action.label;
430+
const description = document.createElement("span");
431+
description.className = "status";
432+
description.dataset.inputActionDescription = action.id;
433+
description.textContent = action.description;
434+
item.append(label, description);
427435
return item;
428436
}));
429437
}

0 commit comments

Comments
 (0)