|
| 1 | +# Engine Input Ownership For Input Mapping V2 Report |
| 2 | + |
| 3 | +PR: `PR_26140_117-finish-engine-input-ownership-for-input-mapping-v2` |
| 4 | + |
| 5 | +## Summary |
| 6 | +- Added engine-owned `InputCaptureSession` state for active capture sessions, combo-visible capture state, keyboard release, double-click, drag, live drag, and visual capture transitions. |
| 7 | +- Added engine-owned `InputCaptureService` descriptor capture helpers for keyboard, mouse, wheel, pointer drag, and pointer drag snapshots. |
| 8 | +- Added engine-owned `GamepadInputClassifier` support for gamepad button, trigger, stick, DPad, hold, release, and active gamepad binding classification. |
| 9 | +- Moved reusable input-device/gesture compatibility into `src/engine/input/InputCapabilityDescriptors.js`. |
| 10 | +- Updated Input Mapping V2 to consume the engine input session, capture service, compatibility helper, and gamepad classifier while keeping tool code focused on UI rendering, selected action/tile state, toolState import/export/copy, and layout. |
| 11 | +- Preserved filtered JSON export behavior that excludes actions with empty `inputs`, preserved `Action Mapping(s)` naming, and did not touch sample JSON. |
| 12 | + |
| 13 | +## Files Changed |
| 14 | +- `src/engine/input/GamepadInputClassifier.js` |
| 15 | +- `src/engine/input/InputCaptureService.js` |
| 16 | +- `src/engine/input/InputCaptureSession.js` |
| 17 | +- `src/engine/input/InputCapabilityDescriptors.js` |
| 18 | +- `src/engine/input/PointerDragState.js` |
| 19 | +- `tools/input-mapping-v2/js/ToolStarterApp.js` |
| 20 | +- `tools/input-mapping-v2/js/services/EngineInputSourceService.js` |
| 21 | +- `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 22 | +- `docs/dev/commit_comment.txt` |
| 23 | +- `docs/dev/codex_commands.md` |
| 24 | +- `docs/dev/reports/engine_input_ownership_for_input_mapping_v2_report.md` |
| 25 | + |
| 26 | +## Validation |
| 27 | +- PASS: `node --check src/engine/input/InputCaptureSession.js` |
| 28 | +- PASS: `node --check src/engine/input/InputCaptureService.js` |
| 29 | +- PASS: `node --check src/engine/input/GamepadInputClassifier.js` |
| 30 | +- PASS: `node --check src/engine/input/InputCapabilityDescriptors.js` |
| 31 | +- PASS: `node --check src/engine/input/PointerDragState.js` |
| 32 | +- PASS: `node --check tools/input-mapping-v2/js/services/EngineInputSourceService.js` |
| 33 | +- PASS: `node --check tools/input-mapping-v2/js/ToolStarterApp.js` |
| 34 | +- PASS: `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 35 | +- PASS: engine input module import validation with `node --input-type=module`. |
| 36 | +- PASS: focused Input Mapping V2 Playwright run passed 11/11 tests. |
| 37 | +- PASS: `npm run test:workspace-v2` passed 70/70 tests. |
| 38 | +- PASS: `git diff --check` reported no whitespace errors. It emitted the existing Windows LF-to-CRLF warning for `tests/playwright/tools/WorkspaceManagerV2.spec.mjs`. |
| 39 | + |
| 40 | +## Playwright Coverage Added/Updated |
| 41 | +- Proves Input Mapping V2 imports and uses engine-backed capture/session/compatibility services. |
| 42 | +- Proves no duplicate local-only combo/capture state remains in the tool for the moved behaviors. |
| 43 | +- Proves release capture is engine-backed and commits on release. |
| 44 | +- Proves hold capture is engine-backed. |
| 45 | +- Proves double-click capture is engine-backed. |
| 46 | +- Proves drag capture is engine-backed. |
| 47 | +- Proves device/gesture compatibility is engine-backed. |
| 48 | +- Preserves existing functional coverage for filtered JSON export excluding empty actions. |
| 49 | + |
| 50 | +## Coverage Report |
| 51 | +- Browser V8 coverage was generated by the workspace-v2 run. |
| 52 | +- Changed runtime JS coverage lines are present in `docs/dev/reports/playwright_v8_coverage_report.txt`: |
| 53 | + - `(79%) src/engine/input/InputCaptureService.js - changed JS file with browser V8 coverage` |
| 54 | + - `(83%) tools/input-mapping-v2/js/services/EngineInputSourceService.js - changed JS file with browser V8 coverage` |
| 55 | + - `(90%) src/engine/input/InputCapabilityDescriptors.js - changed JS file with browser V8 coverage` |
| 56 | + - `(93%) tools/input-mapping-v2/js/ToolStarterApp.js - changed JS file with browser V8 coverage` |
| 57 | + - `(95%) src/engine/input/PointerDragState.js - changed JS file with browser V8 coverage` |
| 58 | + - `(97%) src/engine/input/InputCaptureSession.js - changed JS file with browser V8 coverage` |
| 59 | + - `(100%) src/engine/input/GamepadInputClassifier.js - changed JS file with browser V8 coverage` |
| 60 | +- `docs/dev/reports/coverage_changed_js_guardrail.txt` reports no changed runtime JS coverage warnings. |
| 61 | + |
| 62 | +## Manual Test Notes |
| 63 | +1. Open `tools/input-mapping-v2/index.html`. |
| 64 | +2. Create or select an `Action Mapping(s)` tile with `Add`. |
| 65 | +3. Select an input device, select a compatible capture gesture, and press the relevant capture button. |
| 66 | +4. Confirm keyboard release waits for down then commits on release, double-click waits for the second click, drag waits for real pointer down/move/up, and gamepad release commits on released state. |
| 67 | +5. Click JSON or Copy JSON and confirm actions with empty `inputs: []` are omitted from the exported/copied payload. |
| 68 | + |
| 69 | +## Full Samples Smoke Test |
| 70 | +- Not run, per request and project instructions. This PR is scoped to engine input ownership, Input Mapping V2, and Workspace V2 validation. |
0 commit comments