Skip to content

Commit e0aad6a

Browse files
committed
Fix Input Mapping V2 device and gesture wiring - PR_26140_115-fix-input-mapping-v2-device-gesture-wiring
1 parent 2af3179 commit e0aad6a

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

docs/dev/reports/input_mapping_v2_device_gesture_wiring_report.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PR: PR_26140_115-fix-input-mapping-v2-device-gesture-wiring
44

55
## Summary
66
- Renamed the center-column Capture accordion to `Input Device(s)` and Gestures to `Capture Gestures`, with no braces in either visible label.
7+
- Renamed the center-column mapping workspace from `Captured Mappings` to `Action Mappings`, including related aria labels and mapping-deletion status text.
78
- Disabled and grayed `Input Device(s)` until the selected action has an existing tile, and disabled `Capture Gestures` until an input device is selected.
89
- Enforced device-first capture flow: selecting an input device enables only that device's gesture group, and stale selected gestures no longer auto-arm when a device is clicked after capture completion.
910
- Removed visible Mouse Wheel Left/Right gesture descriptors because PR_115 only requires visible/wired Wheel Up and Wheel Down; underlying wheel input support remains available through the engine where used by existing capture/combo paths.
@@ -21,6 +22,9 @@ PR: PR_26140_115-fix-input-mapping-v2-device-gesture-wiring
2122
- PASS: targeted module import validation for changed engine/input and Input Mapping V2 JS modules.
2223
- PASS: focused Input Mapping V2 Playwright coverage: 11 passed.
2324
- PASS: `npm run test:workspace-v2`: 70 passed.
25+
- PASS: additional label follow-up targeted syntax validation with `node --check tools/input-mapping-v2/js/services/InputMappingState.js` and `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs`.
26+
- PASS: additional label follow-up focused Playwright validation with `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list --grep "launches Input Mapping V2"`: 1 passed.
27+
- PASS: additional label follow-up full Workspace V2 validation with `npm run test:workspace-v2`: 70 passed.
2428
- SKIPPED as requested: full samples smoke test.
2529

2630
## Schema/Samples

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,8 +2586,11 @@ test.describe("Workspace Manager V2 bootstrap", () => {
25862586
timestamp: 78.75
25872587
};
25882588
});
2589-
await expect(gamepadReleaseToken).toHaveClass(/is-action-active/, { timeout: 2500 });
2590-
await expect(gamepadReleaseToken).toHaveCSS("border-top-color", "rgb(245, 159, 0)");
2589+
await page.waitForFunction(() => {
2590+
const token = document.querySelector(".input-mapping-v2__input-token[data-input-mapping-binding='Pad0:Button2:GameControllerButtonRelease']");
2591+
return token?.classList.contains("is-action-active")
2592+
&& getComputedStyle(token).borderTopColor === "rgb(245, 159, 0)";
2593+
}, null, { timeout: 2500 });
25912594

25922595
await page.evaluate(() => {
25932596
window.__inputMappingV2MockGamepads[0] = {
@@ -2821,7 +2824,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
28212824
expect(fullscreenLayout.centerWidth).toBeGreaterThan(1000);
28222825
expect(Math.max(...fullscreenLayout.rightAccordionHeights) - Math.min(...fullscreenLayout.rightAccordionHeights)).toBeLessThanOrEqual(3);
28232826
await expect(page.locator(".tool-starter__panel--left > .tool-starter__accordion > .accordion-v2__header > span:first-child")).toHaveText(["Actions", "Devices"]);
2824-
await expect(page.locator(".tool-starter__panel--center > .tool-starter__accordion > .accordion-v2__header > span:first-child")).toHaveText(["Input Device(s)", "Capture Gestures", "Captured Mappings"]);
2827+
await expect(page.locator(".tool-starter__panel--center > .tool-starter__accordion > .accordion-v2__header > span:first-child")).toHaveText(["Input Device(s)", "Capture Gestures", "Action Mappings"]);
28252828
const centerAccordionLabels = await page.locator(".tool-starter__panel--center > .tool-starter__accordion > .accordion-v2__header > span:first-child").allTextContents();
28262829
expect(centerAccordionLabels.some((label) => /[{}]/.test(label))).toBe(false);
28272830
await expect(page.locator(".tool-starter__panel--right > .tool-starter__accordion > .accordion-v2__header > span:first-child")).toHaveText(["Diagnostics", "JSON", "Status / Log"]);
@@ -3254,7 +3257,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
32543257
await page.locator("#inputMappingV2DeleteMappingsButton").click();
32553258
await expect(page.locator(".input-mapping-v2__mapping-card", { hasText: "Confirm" })).toHaveCount(1);
32563259
await expect(page.locator(".input-mapping-v2__mapping-card", { hasText: "Confirm" })).toContainText("No inputs captured.");
3257-
await expect(page.locator("#statusLog")).toHaveValue(/OK Deleted captured mappings from Confirm\./);
3260+
await expect(page.locator("#statusLog")).toHaveValue(/OK Deleted action mappings from Confirm\./);
32583261
await page.locator("#inputMappingV2MappingDeleteActionButton").click();
32593262
await expect(page.locator(".input-mapping-v2__mapping-card", { hasText: "Confirm" })).toHaveCount(0);
32603263
await expect(page.locator(".input-mapping-v2__mapping-card", { hasText: "Move Left" })).toHaveCount(1);

tools/input-mapping-v2/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ <h2 class="tools-platform-frame__eyebrow">Input Sources and Action Mapping</h2>
102102

103103
</aside>
104104

105-
<section class="tool-starter__panel tool-starter__panel--center" aria-label="Captured mappings">
105+
<section class="tool-starter__panel tool-starter__panel--center" aria-label="Action mappings">
106106
<section class="accordion-v2 tool-starter__accordion is-open" data-accordion-v2-open="true">
107107
<div class="accordion-v2__header input-mapping-v2__capture-header" aria-expanded="true" aria-controls="captureInputContent">
108108
<span>Input Device(s)</span>
@@ -143,11 +143,11 @@ <h2 class="tools-platform-frame__eyebrow">Input Sources and Action Mapping</h2>
143143

144144
<section class="accordion-v2 tool-starter__accordion tool-starter__accordion--fill is-open" data-accordion-v2-open="true">
145145
<button class="accordion-v2__header" type="button" aria-expanded="true" aria-controls="mappingPanelContent">
146-
<span>Captured Mappings</span>
146+
<span>Action Mappings</span>
147147
<span class="accordion-v2__icon" aria-hidden="true">+</span>
148148
</button>
149149
<div id="mappingPanelContent" class="accordion-v2__content">
150-
<div id="previewOutput" class="tool-starter__preview input-mapping-v2__mapping-list" aria-label="Captured action input mappings">
150+
<div id="previewOutput" class="tool-starter__preview input-mapping-v2__mapping-list" aria-label="Action input mappings">
151151
<p>No inputs captured yet.</p>
152152
</div>
153153
<hr class="input-mapping-v2__mapping-actions-separator">

tools/input-mapping-v2/js/services/InputMappingState.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,23 @@ export class InputMappingState {
147147
return { ok: false, message: `${action.label} does not have an action tile.` };
148148
}
149149
if (!action.inputs.length) {
150-
return { ok: false, message: `${action.label} has no captured mappings to delete.` };
150+
return { ok: false, message: `${action.label} has no action mappings to delete.` };
151151
}
152152
action.inputs = [];
153153
action.tileVisible = true;
154154
this.syncInputMap();
155-
return { ok: true, message: `Deleted captured mappings from ${action.label}.` };
155+
return { ok: true, message: `Deleted action mappings from ${action.label}.` };
156156
}
157157

158158
deleteActionInput(actionId, binding) {
159159
const action = this.actionEntries.find((candidate) => candidate.id === actionId) ?? null;
160160
if (!action) {
161-
return { ok: false, message: "Select an action before deleting a captured mapping." };
161+
return { ok: false, message: "Select an action before deleting an action mapping." };
162162
}
163163
const input = action.inputs.find((candidate) => candidate.binding === binding) ?? null;
164164
if (!input) {
165165
this.selectedActionId = action.id;
166-
return { ok: false, message: `${action.label} does not have that captured mapping.` };
166+
return { ok: false, message: `${action.label} does not have that action mapping.` };
167167
}
168168

169169
action.inputs = action.inputs.filter((candidate) => candidate.binding !== binding);

0 commit comments

Comments
 (0)