You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 970ef25
Browse filesBrowse the repository at this point in the historyBrowse files
# PR_26140_089 Input Mapping V2 Gamepad and Capture Flow Report
2
+
3
+
## Scope
4
+
- Fixed Input Mapping V2 gamepad/joystick detection and capture through the existing engine input path (`InputService` + `GamepadInputAdapter`).
5
+
- Kept the tool generic and did not add duplicate input models or hardcoded game-specific behavior.
6
+
- Updated capture flow so Add Action creates an empty mapping tile immediately, independent of capture.
7
+
- Added per-tile action reassignment while preserving captured input deletion.
8
+
- Updated capture controls to stack vertically and fill the available container width.
9
+
- Preserved PR_26140_088 fullscreen layout, 175px by 175px mapping tiles, and external JS/CSS only.
10
+
11
+
## Implementation Notes
12
+
-`EngineInputSourceService` now refreshes gamepad state from the browser Game Controller API through the engine input service and records actionable WARN details when browser focus, permission, API availability, or timing prevents capture.
13
+
-`ToolStarterApp` listens for `gamepadconnected` and `gamepaddisconnected`, refreshes engine input state, logs connection state, and refreshes the UI.
14
+
-`InputMappingState` now supports empty visible mapping tiles and changing a tile's action after creation without requiring a captured input first.
15
+
-`PreviewPanelControl` renders empty tiles, exposes a `Captured Mappings Action` dropdown per tile, and keeps token-click deletion behavior intact.
16
+
-`inputMappingV2.css` makes the capture buttons a vertical full-width stack while preserving mapping tile dimensions.
17
+
18
+
## Playwright Impact
19
+
Yes. This PR changes Input Mapping V2 UI controls, gamepad detection/capture behavior, and toolState-facing mapping interactions.
20
+
21
+
Playwright coverage was updated to validate:
22
+
- connected gamepad detection state with a mocked browser Game Controller API gamepad,
23
+
- actionable WARN logging when gamepad capture is unavailable,
24
+
- stacked full-width capture buttons,
25
+
- Add Action creating a tile without capture,
26
+
- tile action reassignment after creation,
27
+
- captured input token deletion,
28
+
- preserved 175px by 175px mapping tiles and mapping list scroll behavior.
29
+
30
+
## Validation
31
+
- PASS: targeted syntax/import validation for changed Input Mapping V2 and Playwright files.
- PASS: no legacy `gamepad-button` / `gamepad-axis` source values remain in Input Mapping V2 coverage paths.
34
+
- PASS: focused Playwright validation:
35
+
`npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs -g "launches Input Mapping V2 and captures keyboard mappings|uses header lifecycle controls and launches tools from fixed Workspace Manager V2 tiles"`
36
+
- PASS: `npm run test:workspace-v2` (`60 passed`).
37
+
- PASS: no sample JSON changes.
38
+
- PASS: coverage changed JS guardrail reported no warnings.
39
+
40
+
Full samples smoke test was not run, per PR scope.
41
+
42
+
## Manual Validation
43
+
1. Launch Workspace Manager V2 and open Input Mapping V2.
44
+
2. Confirm Capture Keyboard, Capture Mouse, and Capture Gamepad are stacked vertically and fill the capture panel width.
45
+
3. Select an action and click Add Action; confirm an empty 175px by 175px mapping tile appears immediately.
46
+
4. Change the tile's Captured Mappings Action dropdown and confirm the tile/action selection updates.
47
+
5. Capture Keyboard `KeyA`, confirm the token appears, then click the token and confirm it is deleted.
48
+
6. Connect or enable a browser-visible gamepad, focus the page, and confirm Input Sources reports the connected controller; if unavailable, confirm the WARN explains browser focus/permission/API timing.
message: "Gamepad capture unavailable: browser Gamepad API is not available in this context."
71
+
message: "Gamepad capture unavailable: browser Gamepad API is not available in this context. Use a focused browser tab that supports navigator.getGamepads."
message: "Gamepad capture unavailable: connect a gamepad, press a button or move an axis, then capture again."
85
+
message: "Gamepad capture unavailable: no connected gamepad is visible. Click inside this page, press any gamepad button to wake or authorize the controller, check browser focus or permission prompts, then try again."
79
86
};
80
87
}
81
88
for(constpadIndexofconnectedIndices){
@@ -85,7 +92,7 @@ export class EngineInputSourceService {
@@ -108,14 +115,46 @@ export class EngineInputSourceService {
108
115
}
109
116
return{
110
117
ok: false,
111
-
message: "Gamepad capture unavailable: no pressed button or moved axis was visible from the Gamepad API."
118
+
message: "Gamepad capture unavailable: a connected gamepad was detected, but no live button or axis value was active. Hold a button or move a stick while pressing Capture Gamepad."
warning: `Gamepad capture unavailable: browser focus, permission, or Gamepad API timing blocked live gamepad access (${this.lastGamepadReadError}). Click inside this page, press a gamepad button, allow browser permission if prompted, then try again.`
0 commit comments