Skip to content

Commit da0eb96

Browse files
committed
Replace Controls shorthand input columns with readable labels - PR_26162_039-controls-readable-input-columns
1 parent 16011d8 commit da0eb96

7 files changed

Lines changed: 301 additions & 805 deletions

File tree

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
 M docs_build/dev/reports/codex_changed_files.txt
22
M docs_build/dev/reports/codex_review.diff
33
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4-
M src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js
5-
M tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs
64
M tests/playwright/tools/InputMappingV2Tool.spec.mjs
75
M toolbox/controls/controls.js
86
M toolbox/controls/index.html
9-
M toolbox/project-workspace/index.html
10-
D toolbox/project-workspace/project-workspace-api-client.js
11-
D toolbox/project-workspace/project-workspace.js
12-
?? docs_build/dev/reports/PR_26162_038-game-workspace-controls-cleanup.md
7+
?? docs_build/dev/reports/controls-readable-input-columns-report.md

docs_build/dev/reports/codex_review.diff

Lines changed: 207 additions & 702 deletions
Large diffs are not rendered by default.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# PR_26162_039-controls-readable-input-columns
2+
3+
## Branch Validation
4+
- PASS: Current branch is `main`.
5+
- Expected branch: `main`.
6+
- Evidence: `git status --short --branch` returned `## main...origin/main` before edits.
7+
8+
## Requirement Checklist
9+
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before edits.
10+
- PASS: Verified branch `main` before edits.
11+
- PASS: Continued from PR_26162_038 Controls state.
12+
- PASS: Controls status remains Wireframe. Evidence: `src/dev-runtime/guest-seeds/tool-metadata-inventory.js` keeps `"status": "Wireframe"` for `controls`.
13+
- PASS: Game Control Mapping headers now read `Down`, `Hold`, `Up`, `Double Click`, `Drag`, and `Axis`.
14+
- PASS: Matching generated Controls labels now use readable text through `CONTROL_EVENT_OPTIONS`.
15+
- PASS: Validation copy now says `Down, Hold, Up, Double Click, Drag, or Axis`.
16+
- PASS: Internal DB field names such as `eventD`, `eventH`, `eventU`, and `eventDC` were preserved to avoid changing persisted mapping contracts.
17+
- PASS: Existing DB-backed game input mappings and player controller profiles were preserved.
18+
- PASS: Normalized input architecture and shared `src/engine/input` usage were preserved.
19+
- PASS: Add Game Control behavior, seven device rows, common/alternate enabled state, and mapping counts were preserved by targeted Playwright coverage.
20+
- PASS: No sample JSON alignment, auth behavior, production account system, or unrelated rewrites were added.
21+
22+
## Search Evidence
23+
- PASS: Fixed-string search found no `<th>D</th>`, `<th>H</th>`, `<th>U</th>`, or `<th>DC</th>` in `toolbox/controls`.
24+
- PASS: Fixed-string search found no `Choose at least one event: D, H, U, DC` in `toolbox/controls`.
25+
- PASS: Fixed-string search found no `label: "D"`, `label: "H"`, `label: "U"`, or `label: "DC"` in `toolbox/controls`.
26+
- DOCUMENTED: `eventD`, `eventH`, `eventU`, and `eventDC` remain as internal persisted field names only.
27+
28+
## Changed Files
29+
- `docs_build/dev/reports/controls-readable-input-columns-report.md`
30+
- `docs_build/dev/reports/codex_changed_files.txt`
31+
- `docs_build/dev/reports/codex_review.diff`
32+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
33+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
34+
- `toolbox/controls/controls.js`
35+
- `toolbox/controls/index.html`
36+
37+
## Impacted Lane
38+
- Controls/Input Mapping runtime lane.
39+
- Playwright impacted: Yes.
40+
41+
## Skipped Lanes
42+
- Samples lane: SKIPPED because no sample files or sample JSON contracts changed.
43+
- Auth/account production lane: SKIPPED because no auth or production account behavior changed.
44+
- Engine input lane: SKIPPED because no `src/engine/input` files changed; shared engine-input usage is covered by the targeted Controls Playwright spec.
45+
46+
## Validation Performed
47+
- PASS: `node --check toolbox/controls/controls.js`
48+
- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
49+
- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --reporter=line` - 7 passed.
50+
51+
## Playwright Result
52+
- PASS: Table headers show readable event labels instead of `D`, `H`, `U`, and `DC`.
53+
- PASS: Add Game Control still adds all normalized rows.
54+
- PASS: Mapping count still updates.
55+
- PASS: Seven device rows still render with hover/aria help.
56+
- PASS: Persistence after reload remains covered by the Controls/Input Mapping spec.
57+
58+
## V8 Coverage
59+
- PASS: `docs_build/dev/reports/playwright_v8_coverage_report.txt` was produced from the targeted Playwright run.
60+
- PASS: `toolbox/controls/controls.js` appears in the coverage report with 83 percent advisory coverage.
61+
62+
## Manual Validation Steps
63+
1. Open `/toolbox/controls/index.html`.
64+
2. Confirm the Game Controls table headers read `Down`, `Hold`, `Up`, `Double Click`, `Drag`, and `Axis`.
65+
3. Click `Add Game Control`.
66+
4. Confirm all normalized rows appear, mapping counts update, and Missing Game Control Mapping disappears.
67+
5. Inspect a row and confirm checkbox accessible labels use readable event text.
68+
6. Reload the page and confirm saved mappings persist.
69+
7. Confirm the Devices list still shows seven rows with hover/aria help.
70+
71+
## Samples Validation Decision
72+
- SKIP: Full samples validation was not run because this PR only changes Controls UI labels/tests and does not touch sample JSON or sample runtime behavior.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +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%) assets/theme-v2/js/account-achievements.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
25-
(0%) src/dev-runtime/persistence/tool-repositories/game-configuration-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
26-
(0%) src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
27-
(0%) src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
28-
(0%) src/dev-runtime/persistence/tool-repositories/game-workspace-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2920
(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
30-
(0%) src/dev-runtime/persistence/tool-repositories/objects-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
31-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
32-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
33-
(0%) toolbox/colors/colors.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
34-
(0%) toolbox/colors/palette-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
35-
(0%) toolbox/game-journey/game-journey-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
36-
(0%) toolbox/game-journey/game-journey.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
37-
(0%) toolbox/game-workspace/game-workspace-api-client.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
38-
(0%) toolbox/game-workspace/game-workspace.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
39-
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
40-
(0%) toolbox/tools-page-accordions.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
41-
(61%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 625/625; executed functions 33/54
42-
(78%) toolbox/game-configuration/game-configuration.js - executed lines 173/173; executed functions 14/18
4321
(83%) toolbox/controls/controls.js - executed lines 1043/1043; executed functions 89/107
44-
(100%) toolbox/game-design/game-design.js - executed lines 254/254; executed functions 23/23
4522

4623
Files with executed line/function counts where available:
4724
(11%) src/engine/input/InputMappingManifest.js - executed lines 78/78; executed functions 1/9
@@ -70,71 +47,10 @@ Files with executed line/function counts where available:
7047
(100%) toolbox/objects/objects-api-client.js - executed lines 10/10; executed functions 2/2
7148

7249
Uncovered or low-coverage changed JS files:
73-
(0%) assets/theme-v2/js/account-achievements.js - WARNING: uncovered changed runtime JS file; advisory only
74-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: uncovered changed runtime JS file; advisory only
75-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: uncovered changed runtime JS file; advisory only
76-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
77-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
78-
(0%) src/dev-runtime/persistence/tool-repositories/game-configuration-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
79-
(0%) src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
80-
(0%) src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
81-
(0%) src/dev-runtime/persistence/tool-repositories/game-workspace-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
8250
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
83-
(0%) src/dev-runtime/persistence/tool-repositories/objects-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
84-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: uncovered changed runtime JS file; advisory only
85-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
86-
(0%) toolbox/colors/colors.js - WARNING: uncovered changed runtime JS file; advisory only
87-
(0%) toolbox/colors/palette-api-client.js - WARNING: uncovered changed runtime JS file; advisory only
88-
(0%) toolbox/game-journey/game-journey-api-client.js - WARNING: uncovered changed runtime JS file; advisory only
89-
(0%) toolbox/game-journey/game-journey.js - WARNING: uncovered changed runtime JS file; advisory only
90-
(0%) toolbox/game-workspace/game-workspace-api-client.js - WARNING: uncovered changed runtime JS file; advisory only
91-
(0%) toolbox/game-workspace/game-workspace.js - WARNING: uncovered changed runtime JS file; advisory only
92-
(0%) toolbox/toolRegistry.js - WARNING: uncovered changed runtime JS file; advisory only
93-
(0%) toolbox/tools-page-accordions.js - WARNING: uncovered changed runtime JS file; advisory only
9451

9552
Changed JS files considered:
96-
(0%) assets/theme-v2/js/account-achievements.js - changed JS file not collected as browser runtime coverage
97-
(0%) scripts/run-targeted-test-lanes.mjs - changed JS file not collected as browser runtime coverage
98-
(0%) scripts/validate-active-tools-surface.mjs - changed JS file not collected as browser runtime coverage
99-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - changed JS file not collected as browser runtime coverage
100-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - changed JS file not collected as browser runtime coverage
101-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
102-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - changed JS file not collected as browser runtime coverage
103-
(0%) src/dev-runtime/persistence/tool-repositories/game-configuration-mock-repository.js - changed JS file not collected as browser runtime coverage
104-
(0%) src/dev-runtime/persistence/tool-repositories/game-design-mock-repository.js - changed JS file not collected as browser runtime coverage
105-
(0%) src/dev-runtime/persistence/tool-repositories/game-journey-mock-repository.js - changed JS file not collected as browser runtime coverage
106-
(0%) src/dev-runtime/persistence/tool-repositories/game-workspace-mock-repository.js - changed JS file not collected as browser runtime coverage
10753
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - changed JS file not collected as browser runtime coverage
108-
(0%) src/dev-runtime/persistence/tool-repositories/objects-mock-repository.js - changed JS file not collected as browser runtime coverage
109-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - changed JS file not collected as browser runtime coverage
110-
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
111-
(0%) tests/dev-runtime/DevRuntimeBoundary.test.mjs - changed JS file not collected as browser runtime coverage
112-
(0%) tests/playwright/account/AchievementsPage.spec.mjs - changed JS file not collected as browser runtime coverage
113-
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
114-
(0%) tests/playwright/tools/AssetToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
115-
(0%) tests/playwright/tools/BuildPathProgressSimplification.spec.mjs - changed JS file not collected as browser runtime coverage
116-
(0%) tests/playwright/tools/GameConfigurationMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
117-
(0%) tests/playwright/tools/GameDesignMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
118-
(0%) tests/playwright/tools/GameJourneyTool.spec.mjs - changed JS file not collected as browser runtime coverage
11954
(0%) tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
12055
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
121-
(0%) tests/playwright/tools/LoginSessionMode.spec.mjs - changed JS file not collected as browser runtime coverage
122-
(0%) tests/playwright/tools/PaletteToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
123-
(0%) tests/playwright/tools/RootToolsFutureState.spec.mjs - changed JS file not collected as browser runtime coverage
124-
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
125-
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
126-
(0%) tests/playwright/tools/ToolDisplayModeNavigation.spec.mjs - changed JS file not collected as browser runtime coverage
127-
(0%) tests/playwright/tools/ToolImageRegistry.spec.mjs - changed JS file not collected as browser runtime coverage
128-
(0%) tests/playwright/tools/ToolNavigationPrevNext.spec.mjs - changed JS file not collected as browser runtime coverage
129-
(0%) toolbox/colors/colors.js - changed JS file not collected as browser runtime coverage
130-
(0%) toolbox/colors/palette-api-client.js - changed JS file not collected as browser runtime coverage
131-
(0%) toolbox/game-journey/game-journey-api-client.js - changed JS file not collected as browser runtime coverage
132-
(0%) toolbox/game-journey/game-journey.js - changed JS file not collected as browser runtime coverage
133-
(0%) toolbox/game-workspace/game-workspace-api-client.js - changed JS file not collected as browser runtime coverage
134-
(0%) toolbox/game-workspace/game-workspace.js - changed JS file not collected as browser runtime coverage
135-
(0%) toolbox/toolRegistry.js - changed JS file not collected as browser runtime coverage
136-
(0%) toolbox/tools-page-accordions.js - changed JS file not collected as browser runtime coverage
137-
(61%) assets/theme-v2/js/gamefoundry-partials.js - changed JS file with browser V8 coverage
138-
(78%) toolbox/game-configuration/game-configuration.js - changed JS file with browser V8 coverage
13956
(83%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
140-
(100%) toolbox/game-design/game-design.js - changed JS file with browser V8 coverage

tests/playwright/tools/InputMappingV2Tool.spec.mjs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,20 @@ test("Game Controls owns generic mappings and presets", async ({ page }) => {
194194
"Normalized Action Type",
195195
"Usage Label",
196196
"Input Family",
197-
"D",
198-
"H",
199-
"U",
200-
"DC",
197+
"Down",
198+
"Hold",
199+
"Up",
200+
"Double Click",
201201
"Drag",
202202
"Axis",
203203
"Object",
204204
"State",
205205
"Actions",
206206
]);
207+
await expect(page.locator("[data-input-mapping-table] th").filter({ hasText: /^D$/ })).toHaveCount(0);
208+
await expect(page.locator("[data-input-mapping-table] th").filter({ hasText: /^H$/ })).toHaveCount(0);
209+
await expect(page.locator("[data-input-mapping-table] th").filter({ hasText: /^U$/ })).toHaveCount(0);
210+
await expect(page.locator("[data-input-mapping-table] th").filter({ hasText: /^DC$/ })).toHaveCount(0);
207211
await expect(page.locator("[data-input-action-label]")).toContainText(NORMALIZED_INPUTS);
208212
await expect(page.locator("[data-input-control-type-list]")).toContainText("Keyboard Key");
209213
await expect(page.locator("[data-input-control-type-list]")).toContainText("Pointer Drag");
@@ -232,6 +236,10 @@ test("Game Controls owns generic mappings and presets", async ({ page }) => {
232236
await expect(page.locator("[data-input-mapping-list]")).not.toContainText("Missing Game Control Mapping");
233237
const primaryActionRow = page.locator("[data-input-mapping-row]").filter({ hasText: "action.primary" }).first();
234238
await expect(primaryActionRow.locator("td").nth(0).locator("input")).toBeChecked();
239+
await expect(primaryActionRow.locator("input[aria-label='Down']")).toBeChecked();
240+
await expect(primaryActionRow.locator("input[aria-label='Hold']")).not.toBeChecked();
241+
await expect(primaryActionRow.locator("input[aria-label='Up']")).not.toBeChecked();
242+
await expect(primaryActionRow.locator("input[aria-label='Double Click']")).not.toBeChecked();
235243
await expect(primaryActionRow.locator("td").nth(11)).toHaveText("Active");
236244
const aimRightRow = page.locator("[data-input-mapping-row]").filter({ hasText: "aim.x+" }).first();
237245
await expect(aimRightRow.locator("td").nth(0).locator("input")).not.toBeChecked();

toolbox/controls/controls.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
} from "../../src/engine/input/NormalizedInputRegistry.js";
77

88
const CONTROL_EVENT_OPTIONS = Object.freeze([
9-
Object.freeze({ field: "eventD", label: "D" }),
10-
Object.freeze({ field: "eventH", label: "H" }),
11-
Object.freeze({ field: "eventU", label: "U" }),
12-
Object.freeze({ field: "eventDC", label: "DC" }),
9+
Object.freeze({ field: "eventD", label: "Down" }),
10+
Object.freeze({ field: "eventH", label: "Hold" }),
11+
Object.freeze({ field: "eventU", label: "Up" }),
12+
Object.freeze({ field: "eventDC", label: "Double Click" }),
1313
Object.freeze({ field: "eventDrag", label: "Drag" }),
1414
Object.freeze({ field: "eventAxis", label: "Axis" }),
1515
]);
@@ -357,7 +357,7 @@ function validateMappingAction(mapping) {
357357
if (!CONTROL_EVENT_OPTIONS.some((option) => Boolean(mapping[option.field]))) {
358358
return {
359359
ok: false,
360-
message: "Choose at least one event: D, H, U, DC, Drag, or Axis.",
360+
message: "Choose at least one event: Down, Hold, Up, Double Click, Drag, or Axis.",
361361
};
362362
}
363363
return { ok: true, message: "" };

0 commit comments

Comments
 (0)