Skip to content

Commit 2589276

Browse files
committed
Compact Controls controller profiles and limit profile device type to gamepads - PR_26161_028-controls-compact-controller-profile
1 parent 200b906 commit 2589276

8 files changed

Lines changed: 534 additions & 1332 deletions

File tree

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
docs_build/dev/reports/controls-controller-profile-generation-report.md
1+
docs_build/dev/reports/controls-compact-controller-profile-report.md
22
docs_build/dev/reports/codex_review.diff
33
docs_build/dev/reports/codex_changed_files.txt
44
docs_build/dev/reports/playwright_v8_coverage_report.txt
55
docs_build/dev/reports/coverage_changed_js_guardrail.txt
6-
src/dev-runtime/persistence/mock-db-store.js
7-
src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js
86
tests/playwright/tools/InputMappingV2Tool.spec.mjs
97
toolbox/controls/controls.js
108
toolbox/controls/index.html

docs_build/dev/reports/codex_review.diff

Lines changed: 368 additions & 1234 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_028 Controls Compact Controller Profile
2+
3+
## Branch Validation
4+
PASS: current branch was verified as `main` before edits.
5+
6+
## Impacted Lane
7+
Controls / Input Mapping targeted lane.
8+
9+
## Playwright Impacted
10+
Yes.
11+
12+
## Request Checklist
13+
- PASS: Controls status remains Wireframe.
14+
- PASS: Controls mappings, controller profiles, and custom actions remain DB-backed through the shared DB/mock adapter.
15+
- PASS: Controller Profile Device Type dropdown now shows detected game controllers only.
16+
- PASS: Keyboard and Mouse no longer appear in the Controller Profile Device Type dropdown.
17+
- PASS: Keyboard and Mouse remain valid in Input Mapping row Input Device selection.
18+
- PASS: Controller Profile vertical space was reduced by removing the standalone Input column.
19+
- PASS: Generated controller inputs are displayed as compact Button/Input plus Action dropdown pairs.
20+
- PASS: Generated Actions are placed under the controller row in a full-width grid that stacks left to right and top to bottom.
21+
- PASS: Actions are displayed under the Controller Profile details row instead of a separate Input column.
22+
- PASS: Add Profile still creates DB-backed controller profile records.
23+
- PASS: Generated gamepad buttons, axes, triggers, and d-pad inputs are preserved.
24+
- PASS: Custom Action creation still persists and appears in Action dropdowns after reload.
25+
- PASS: Reset Mappings confirmation remains unchanged.
26+
- PASS: Input Mapping and Controller Profile remain accordions.
27+
- PASS: Mapping/profile persistence after reload remains covered.
28+
- PASS: No sample JSON alignment, auth behavior, production game runtime behavior, or unrelated rewrites were added.
29+
- PASS: Theme V2-only restrictions were preserved; no inline CSS, inline JS, script blocks, style blocks, or inline event handlers were added.
30+
31+
## Testing Performed
32+
- `node --check toolbox/controls/controls.js`
33+
- `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
34+
- `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs`
35+
- Result: 7 passed.
36+
- `git diff --check -- . ':!docs_build/dev/reports/codex_review.diff'`
37+
- Result: PASS, with Git line-ending warnings only.
38+
39+
## Playwright Coverage
40+
- Produced `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
41+
- Changed browser runtime JS covered: `toolbox/controls/controls.js` at 91% function coverage.
42+
- The V8 report lists prior server-side DB/mock adapter files as advisory WARN entries from the repository diff baseline; this PR did not change those files, and the targeted Controls browser runtime behavior is covered.
43+
44+
## Manual Validation Steps
45+
1. Open `toolbox/controls/index.html`.
46+
2. Verify Controller Profile Device Type only lists detected game controllers and does not list Keyboard or Mouse.
47+
3. Add a mapping row and verify Input Device still offers Keyboard, Mouse, and Gamepad.
48+
4. Mock or connect a gamepad, click Refresh Devices, select the detected gamepad, and click Add Profile.
49+
5. Verify the saved profile shows generated inputs as compact input/action pairs under the controller row and no separate Input column.
50+
6. Assign Actions, save profile actions, reload, and verify profile/mapping data persists.
51+
7. Add a custom Action, reload, and verify it appears in Action dropdowns.
52+
53+
## Skipped Lanes
54+
- Full samples validation was skipped as requested. This PR is scoped to Controls UI/tool behavior and does not change samples or production game runtime behavior.
55+
- Broad workspace/full-suite validation was skipped because targeted Controls/Input Mapping Playwright covers the changed tool behavior directly.
56+
57+
## Runtime Engine Behavior
58+
Confirmed: no production game runtime behavior was changed.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
88
Changed runtime JS files considered:
99
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1010
(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
11-
(92%) toolbox/controls/controls.js - executed lines 1622/1622; executed functions 165/180
11+
(91%) toolbox/controls/controls.js - executed lines 1626/1626; executed functions 165/181
1212

1313
Guardrail warnings:
1414
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ 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-
(90%) Toolbox Index - exercised 4 runtime JS files
15+
(89%) 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:
2020
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2121
(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
22-
(92%) toolbox/controls/controls.js - executed lines 1622/1622; executed functions 165/180
22+
(91%) toolbox/controls/controls.js - executed lines 1626/1626; executed functions 165/181
2323

2424
Files with executed line/function counts where available:
2525
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
2626
(58%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 603/603; executed functions 30/52
2727
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
2828
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
29-
(92%) toolbox/controls/controls.js - executed lines 1622/1622; executed functions 165/180
29+
(91%) toolbox/controls/controls.js - executed lines 1626/1626; executed functions 165/181
3030
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
3131
(100%) toolbox/objects/objects-api-client.js - executed lines 10/10; executed functions 2/2
3232

@@ -38,4 +38,4 @@ Changed JS files considered:
3838
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
3939
(0%) src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js - changed JS file not collected as browser runtime coverage
4040
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
41-
(92%) toolbox/controls/controls.js - changed JS file with browser V8 coverage
41+
(91%) toolbox/controls/controls.js - changed JS file with browser V8 coverage

tests/playwright/tools/InputMappingV2Tool.spec.mjs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ test("Controls Input Mapping launch panels, defaults, diagnostics, and workspace
268268
"Controller Name",
269269
"Controller ID",
270270
"Mapping Profile",
271-
"Input",
272271
"Action",
273272
]);
274273
await expect(page.locator("[data-controller-profile-list]")).toContainText("No controller profiles saved yet.");
@@ -280,11 +279,10 @@ test("Controls Input Mapping launch panels, defaults, diagnostics, and workspace
280279
await expect(page.locator("[data-controller-profile-planning]")).toContainText("Future game launch will match Controller ID to a saved Mapping Profile");
281280
await expect(page.locator("[data-controller-profile-add]")).toBeVisible();
282281
await expect(page.locator("[data-controller-device-select] option")).toHaveText([
283-
"Choose a controller",
284-
"Keyboard",
285-
"Mouse",
286-
"Unknown or unavailable controller",
282+
"Choose a game controller",
287283
]);
284+
await expect(page.locator("[data-controller-device-select]")).not.toContainText("Keyboard");
285+
await expect(page.locator("[data-controller-device-select]")).not.toContainText("Mouse");
288286
expect(await controllerProfileRecords(page)).toHaveLength(0);
289287
await expect(page.locator("[data-input-mapping-table] th")).toHaveText([
290288
"Object",
@@ -365,6 +363,7 @@ test("Controls Input Mapping supports table-first inline add, cancel, save, and
365363
await expect(page.locator("[data-input-row-capture-keyboard]")).toBeVisible();
366364
await expect(page.locator("[data-input-row-capture-mouse]")).toHaveCount(0);
367365
await expect(page.locator("[data-input-row-capture-gamepad]")).toHaveCount(0);
366+
await expect(page.locator("[data-input-row-device] option")).toHaveText(["Keyboard", "Mouse", "Gamepad"]);
368367
await page.locator("[data-input-row-device]").selectOption("mouse");
369368
await expect(page.locator("[data-input-row-capture-keyboard]")).toHaveCount(0);
370369
await expect(page.locator("[data-input-row-capture-mouse]")).toBeVisible();
@@ -613,12 +612,11 @@ test("Controls generates controller profiles, shows fallback status, and mapping
613612
});
614613
await page.locator("[data-input-refresh-devices]").click();
615614
await expect(page.locator("[data-controller-device-select] option")).toHaveText([
616-
"Choose a controller",
617-
"Keyboard",
618-
"Mouse",
615+
"Choose a game controller",
619616
"Gamepad: Arcade Test Pad",
620-
"Unknown or unavailable controller",
621617
]);
618+
await expect(page.locator("[data-controller-device-select]")).not.toContainText("Keyboard");
619+
await expect(page.locator("[data-controller-device-select]")).not.toContainText("Mouse");
622620

623621
await page.locator("[data-controller-device-select]").selectOption("gamepad-0");
624622
await expect(page.locator("[data-controller-profile-editing-row]")).toHaveCount(0);
@@ -631,6 +629,18 @@ test("Controls generates controller profiles, shows fallback status, and mapping
631629
await expect(page.locator("[data-controller-profile-list]")).toContainText("Arcade Test Pad");
632630
await expect(page.locator("[data-controller-profile-list]")).toContainText("Arcade Test Pad Profile");
633631
await expect(page.locator("[data-controller-profile-list]")).toContainText("Action Required");
632+
await expect(page.locator("[data-controller-profile-table] th")).toHaveText([
633+
"Device Type",
634+
"Controller Name",
635+
"Controller ID",
636+
"Mapping Profile",
637+
"Action",
638+
]);
639+
await expect(page.locator("[data-controller-profile-row]").first()).not.toContainText("Button0");
640+
await expect(page.locator("[data-controller-profile-actions-row]").first().locator(".content-grid--three")).toBeVisible();
641+
await expect(page.locator("[data-controller-profile-actions-row]").first().locator("[data-controller-profile-input-pair]")).toHaveCount(18);
642+
await expect(page.locator("[data-controller-profile-actions-row]").first().locator("[data-controller-profile-input-pair]").first().locator("strong")).toHaveText("Button0");
643+
await expect(page.locator("[data-controller-profile-actions-row]").first().locator("[data-controller-profile-input-pair]").first().locator("select")).toBeVisible();
634644
await expect(page.locator("[data-controller-profile-fallback-status]")).toContainText("Exact saved profile");
635645

636646
let profiles = await controllerProfileRecords(page);
@@ -689,10 +699,6 @@ test("Controls generates controller profiles, shows fallback status, and mapping
689699
expect(profiles).toHaveLength(1);
690700
expect(profiles[0].mappingProfile).toBe("Arcade Test Pad Profile");
691701

692-
await page.locator("[data-controller-device-select]").selectOption("unavailable-controller");
693-
await expect(page.locator("[data-controller-profile-status]")).toContainText("WARN: Unknown or unavailable controller.");
694-
await expect(page.locator("[data-controller-profile-status]")).toContainText("refresh devices");
695-
await expect(page.locator("[data-controller-profile-fallback-status]")).toContainText("Missing Mapping");
696702
expect(profiles).toHaveLength(1);
697703

698704
await page.reload({ waitUntil: "networkidle" });

0 commit comments

Comments
 (0)