Skip to content

Commit 0926021

Browse files
author
DavidQ
committed
Add Input Mapping V2 and audit State Inspector replacement - PR_26140_086-add-input-mapping-v2-and-audit-state-inspector
1 parent 6e38dbb commit 0926021

21 files changed

Lines changed: 1046 additions & 19 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# PR_26140_086 Input Mapping V2 and State Inspector Audit Report
2+
3+
## Summary
4+
5+
- Added generic `Input Mapping V2` for keyboard and gamepad action mapping across games, tools, and samples.
6+
- Registered Input Mapping V2 in the tool registry, Tools index utility group, and Workspace Manager V2 launch surface.
7+
- Added Input Mapping V2 README, how-to, and UAT documentation entries.
8+
- Removed the planned "Input Mapper / Controller Tester" card because the V2 tool is now active.
9+
- Preserved State Inspector after audit because Storage Inspector V2 does not fully replace its host/runtime state inspection behavior.
10+
11+
## Input Mapping V2
12+
13+
- Tool id: `input-mapping-v2`.
14+
- Tool name: `Input Mapping V2`.
15+
- Scope is generic, not game-specific.
16+
- Supports keyboard capture, gamepad button/axis capture, device refresh, current mapping list, generated mapping JSON, status logging, and Workspace Manager return navigation.
17+
- Workspace Manager hydrates it as a selected-game-purpose launch context without adding a schema payload contract.
18+
19+
## State Inspector Audit
20+
21+
Storage Inspector V2 covers current-origin storage inspection and cleanup, including normalized Workspace/toolState data and dirty views. It does not cover all State Inspector behavior.
22+
23+
State Inspector still has unique active behavior:
24+
25+
- Reads host context from tool launch URL context.
26+
- Reads active project manifest state through `ACTIVE_PROJECT_STORAGE_KEY`.
27+
- Inspects selected `toolboxaid.*` local/session storage snapshots rather than broad storage cleanup.
28+
- Reads `globalThis.__TOOLS_BOOT_CONTRACT_REGISTRY__` keys for boot contract visibility.
29+
- Supports routed viewer payload inspection via `toolboxaid.viewerPayload.<id>`.
30+
- Supports manual JSON payload inspection and snapshot creation through `createStateInspectorSnapshot`.
31+
32+
Conclusion: Storage Inspector V2 does not fully replace State Inspector. State Inspector launch/registry/docs references were intentionally left active.
33+
34+
## Validation
35+
36+
- Targeted syntax/import validation passed with `node --check` for changed runtime/test JavaScript files.
37+
- Targeted Playwright validation passed for Tools index, Input Mapping V2 standalone launch, and Workspace Manager launch/return wiring: 3 passed.
38+
- `npm run test:workspace-v2` passed: 60 passed.
39+
- Storage Inspector V2 remains visible and launchable in Workspace Manager validation.
40+
- State Inspector was not removed because the audit found unique non-storage runtime state inspection behavior.
41+
42+
## Scope Controls
43+
44+
- No schema files changed.
45+
- No sample JSON changed.
46+
- Runtime behavior outside tool registration/launch wiring was preserved.

docs/tools/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This folder is standardized on UAT documentation.
2828
- [Palette Manager V2](./palette-manager-v2/uat.md)
2929
- [World Vector Studio V2](./world-vector-studio-v2/uat.md)
3030
- [Object Vector Studio V2](./object-vector-studio-v2/uat.md)
31+
- [Input Mapping V2](./input-mapping-v2/uat.md)
3132

3233
## UAT Reports
3334
- [Tool Inventory](../dev/reports/tool_inventory.md)

docs/tools/input-mapping-v2/uat.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Input Mapping V2 UAT
2+
3+
## Launch
4+
5+
- Open `tools/input-mapping-v2/index.html`.
6+
- Confirm the tool header, Actions, Capture, Mappings, Mapping JSON, Devices, and Status panels appear.
7+
- Confirm workspace launch mode shows a Return to Workspace action.
8+
9+
## Keyboard Capture
10+
11+
- Select `Move Left`.
12+
- Click `Capture Keyboard`.
13+
- Press `ArrowLeft`.
14+
- Confirm the mapping list and JSON output include `moveLeft` with `ArrowLeft`.
15+
16+
## Gamepad Capture
17+
18+
- Connect a gamepad.
19+
- Press or hold a button or axis.
20+
- Click `Capture Gamepad`.
21+
- Confirm the mapping list and JSON output include the detected gamepad input.
22+
23+
## Device Refresh
24+
25+
- Click `Refresh Devices`.
26+
- Confirm keyboard availability is shown.
27+
- Confirm connected gamepads are listed with button and axis counts.

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 96 additions & 11 deletions
Large diffs are not rendered by default.

tools/index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ <h3>Level / Entity Placement Editor</h3>
6565
</div>
6666
</div>
6767

68-
<div class="card">
69-
<h3>Input Mapper / Controller Tester</h3>
70-
<p>Verify keyboard and gamepad bindings, dead zones, button maps, and player assignments.</p>
71-
<div class="meta">
72-
<span class="pill planned">Planned</span>
73-
</div>
74-
</div>
75-
7668
<div class="card">
7769
<h3>Replay Inspector</h3>
7870
<p>Open recorded sessions, step frame by frame, and debug input-driven playback behavior.</p>

tools/input-mapping-v2/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Input Mapping V2
2+
3+
Input Mapping V2 is a generic keyboard and gamepad binding tool for games, tools, and samples.
4+
5+
## Scope
6+
7+
- Captures keyboard keys for named actions.
8+
- Captures currently pressed gamepad buttons or axes.
9+
- Shows live device availability, current mappings, and exportable mapping JSON.
10+
- Supports workspace-launched return behavior.
11+
12+
The tool does not provide hidden fallback action sets. Default actions are only starter bindings for interactive mapping and can be cleared or extended in the UI.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Input Mapping V2 - How To Use</title>
7+
<link rel="stylesheet" href="../../src/engine/theme/main.css">
8+
<link rel="stylesheet" href="../../src/engine/ui/hubCommon.css">
9+
<link rel="stylesheet" href="../common/toolShellCommon.css">
10+
</head>
11+
<body class="tools-platform-tool-page">
12+
<main class="tool-shell-common__app-shell">
13+
<header class="tool-shell-common__header">
14+
<div>
15+
<p class="tool-shell-common__eyebrow">How to use</p>
16+
<h1>Input Mapping V2</h1>
17+
<p class="tool-shell-common__description">Create keyboard and gamepad bindings for games, tools, and samples.</p>
18+
</div>
19+
<nav class="tool-shell-common__menu" aria-label="Input Mapping V2 links">
20+
<a href="./index.html">Open Tool</a>
21+
<a href="./README.md">Read Me</a>
22+
<a href="../index.html">Tools</a>
23+
</nav>
24+
</header>
25+
<section class="tool-shell-common__panel">
26+
<h2>Workflow</h2>
27+
<ol>
28+
<li>Select an action from the Actions panel.</li>
29+
<li>Use Capture Keyboard, then press the key to map.</li>
30+
<li>Use Capture Gamepad after pressing or holding the gamepad input to map.</li>
31+
<li>Review the generated mapping JSON and copy it when needed.</li>
32+
</ol>
33+
</section>
34+
</main>
35+
</body>
36+
</html>

tools/input-mapping-v2/index.html

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Input Mapping V2</title>
7+
<link rel="stylesheet" href="../../src/engine/theme/main.css">
8+
<link rel="stylesheet" href="../../src/engine/ui/hubCommon.css">
9+
<link rel="stylesheet" href="../../src/engine/theme/accordionV2/accordionV2.css">
10+
<link rel="stylesheet" href="../common/toolShellCommon.css">
11+
<link rel="stylesheet" href="./styles/inputMappingV2.css">
12+
<script type="module" src="./js/bootstrap.js"></script>
13+
</head>
14+
<body class="tools-platform-tool-page input-mapping-v2" data-tool-id="input-mapping-v2">
15+
<main class="tool-shell-common__app-shell" aria-labelledby="inputMappingV2Title">
16+
<header class="tool-shell-common__header input-mapping-v2__header" data-input-mapping-v2-header>
17+
<details class="tool-shell-common__summary-frame input-mapping-v2__summary-frame" open>
18+
<summary class="tool-shell-common__summary-toggle" data-input-mapping-v2-summary>
19+
<div>
20+
<p class="tool-shell-common__eyebrow">Input binding diagnostics</p>
21+
<h1 id="inputMappingV2Title">Input Mapping V2</h1>
22+
<p class="tool-shell-common__description">
23+
Map keyboard and gamepad inputs for games, tools, and samples.
24+
</p>
25+
</div>
26+
<span class="tool-shell-common__summary-indicator" aria-hidden="true">Collapse</span>
27+
</summary>
28+
<div class="tool-shell-common__toolbar-row">
29+
<nav class="tool-shell-common__menu input-mapping-v2__tool-menu" aria-label="Input Mapping V2 links" data-launch-mode-nav="tool">
30+
<a href="../index.html">Tools</a>
31+
<a href="./README.md">Read Me</a>
32+
<a href="./how_to_use.html">How To Use</a>
33+
</nav>
34+
<nav class="tool-shell-common__menu input-mapping-v2__workspace-menu" aria-label="Workspace launch links" data-launch-mode-nav="workspace" hidden>
35+
<button id="returnToWorkspaceButton" class="tool-shell-common__button" type="button">Return to Workspace</button>
36+
<a href="./README.md">Read Me</a>
37+
<a href="./how_to_use.html">How To Use</a>
38+
</nav>
39+
</div>
40+
</details>
41+
</header>
42+
43+
<section class="tool-shell-common__status-banner" aria-live="polite" data-input-mapping-v2-banner>
44+
Ready to capture input mappings.
45+
</section>
46+
47+
<section class="tool-shell-common__fullscreen-root input-mapping-v2__workspace" aria-label="Input Mapping V2 workspace">
48+
<aside class="tool-shell-common__panel input-mapping-v2__left-panel" aria-label="Input mapping controls">
49+
<section class="accordion-v2 input-mapping-v2__accordion" data-accordion-section>
50+
<button class="accordion-v2__header" type="button" aria-expanded="true">
51+
<span>Actions</span>
52+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
53+
</button>
54+
<div class="accordion-v2__content">
55+
<label class="input-mapping-v2__field">
56+
<span>Selected Action</span>
57+
<select id="inputMappingV2ActionSelect"></select>
58+
</label>
59+
<label class="input-mapping-v2__field">
60+
<span>Custom Action</span>
61+
<input id="inputMappingV2CustomActionInput" type="text" autocomplete="off" placeholder="thrust, jump, menuOpen">
62+
</label>
63+
<div class="input-mapping-v2__button-row">
64+
<button id="inputMappingV2AddActionButton" class="tool-shell-common__button" type="button">Add Action</button>
65+
<button id="inputMappingV2ClearSelectedButton" class="tool-shell-common__button" type="button">Clear Selected</button>
66+
</div>
67+
<button id="inputMappingV2ResetButton" class="tool-shell-common__button input-mapping-v2__wide-button" type="button">Reset Defaults</button>
68+
</div>
69+
</section>
70+
71+
<section class="accordion-v2 input-mapping-v2__accordion" data-accordion-section>
72+
<button class="accordion-v2__header" type="button" aria-expanded="true">
73+
<span>Capture</span>
74+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
75+
</button>
76+
<div class="accordion-v2__content">
77+
<p id="inputMappingV2SelectedAction" class="input-mapping-v2__readout">Selected action: Move Up</p>
78+
<div class="input-mapping-v2__button-row">
79+
<button id="inputMappingV2CaptureKeyboardButton" class="tool-shell-common__button" type="button">Capture Keyboard</button>
80+
<button id="inputMappingV2CaptureGamepadButton" class="tool-shell-common__button" type="button">Capture Gamepad</button>
81+
</div>
82+
<button id="inputMappingV2RefreshDevicesButton" class="tool-shell-common__button input-mapping-v2__wide-button" type="button">Refresh Devices</button>
83+
<p id="inputMappingV2CaptureStatus" class="input-mapping-v2__readout">Keyboard is available. Connect a gamepad to capture gamepad inputs.</p>
84+
</div>
85+
</section>
86+
</aside>
87+
88+
<section class="tool-shell-common__panel input-mapping-v2__center-panel" aria-label="Current input mappings">
89+
<section class="accordion-v2 input-mapping-v2__accordion input-mapping-v2__mapping-accordion" data-accordion-section>
90+
<button class="accordion-v2__header" type="button" aria-expanded="true">
91+
<span>Mappings</span>
92+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
93+
</button>
94+
<div class="accordion-v2__content">
95+
<div id="inputMappingV2MappingList" class="input-mapping-v2__mapping-list"></div>
96+
</div>
97+
</section>
98+
99+
<section class="accordion-v2 input-mapping-v2__accordion" data-accordion-section>
100+
<button class="accordion-v2__header" type="button" aria-expanded="true">
101+
<span>Last Input</span>
102+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
103+
</button>
104+
<div class="accordion-v2__content">
105+
<pre id="inputMappingV2LastInput" class="input-mapping-v2__pre">No input captured yet.</pre>
106+
</div>
107+
</section>
108+
</section>
109+
110+
<aside class="tool-shell-common__panel input-mapping-v2__right-panel" aria-label="Input mapping output and devices">
111+
<section class="accordion-v2 input-mapping-v2__accordion input-mapping-v2__json-accordion" data-accordion-section>
112+
<button class="accordion-v2__header" type="button" aria-expanded="true">
113+
<span>Mapping JSON</span>
114+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
115+
</button>
116+
<div class="accordion-v2__content">
117+
<button id="inputMappingV2CopyJsonButton" class="tool-shell-common__button input-mapping-v2__wide-button" type="button">Copy JSON</button>
118+
<pre id="inputMappingV2JsonOutput" class="input-mapping-v2__pre input-mapping-v2__json-output"></pre>
119+
</div>
120+
</section>
121+
122+
<section class="accordion-v2 input-mapping-v2__accordion" data-accordion-section>
123+
<button class="accordion-v2__header" type="button" aria-expanded="true">
124+
<span>Devices</span>
125+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
126+
</button>
127+
<div class="accordion-v2__content">
128+
<div id="inputMappingV2DeviceList" class="input-mapping-v2__device-list"></div>
129+
</div>
130+
</section>
131+
132+
<section class="accordion-v2 input-mapping-v2__accordion input-mapping-v2__status-accordion" data-accordion-section>
133+
<button class="accordion-v2__header" type="button" aria-expanded="true">
134+
<span>Status</span>
135+
<span class="accordion-v2__chevron" aria-hidden="true"></span>
136+
</button>
137+
<div class="accordion-v2__content">
138+
<button id="inputMappingV2ClearStatusButton" class="tool-shell-common__button input-mapping-v2__wide-button" type="button">Clear Status</button>
139+
<pre id="statusLog" class="input-mapping-v2__pre input-mapping-v2__status-log"></pre>
140+
</div>
141+
</section>
142+
</aside>
143+
</section>
144+
</main>
145+
<script type="module" src="../../src/engine/theme/mount-shared-header.js"></script>
146+
</body>
147+
</html>

0 commit comments

Comments
 (0)