|
| 1 | +# PR_26140_112-fix-input-mapping-v2-drag-capture-and-visual-state |
| 2 | + |
| 3 | +## Source Reading |
| 4 | +- Read `docs/dev/PROJECT_INSTRUCTIONS.md` before implementation. |
| 5 | +- Read `.codex/skills/repo-build/SKILL.md` for the repo BUILD workflow. |
| 6 | +- Read `docs/pr/BUILD_PR.md`; it still references unrelated Level 18 overlay runtime hardening, so this report treats the explicit PR_26140_112 request as the authoritative BUILD scope. |
| 7 | +- Read targeted Input Mapping V2 source and Playwright coverage plus the immediate engine pointer-drag service dependency. |
| 8 | + |
| 9 | +## Implementation Summary |
| 10 | +- Changed Mouse Drag and Mouse Drag Release capture from descriptor snapshots to live mouse capture sessions. |
| 11 | +- Capture Mouse now waits for actual mouse down, records the real button used, tracks movement, and commits Drag on movement or Drag Release on release. |
| 12 | +- Drag mappings now persist the actual button in the binding, for example `MouseButton2:MousePrimaryDrag`. |
| 13 | +- Added explicit visual capture state transitions for waiting, drag pending/tracking, complete, and canceled. |
| 14 | +- Added a minimum visual completion/cancel state delay so the active Capture button highlight is visible before it clears. |
| 15 | +- Kept detailed mapping messages in Status / Log only; Capture shows generic completion state text. |
| 16 | +- Preserved PR_111 strict gesture validation, selected tile requirement, token deletion, scroll behavior, schemas, and sample JSON. |
| 17 | + |
| 18 | +## Playwright Impact |
| 19 | +Playwright impacted: Yes. |
| 20 | + |
| 21 | +Validated behavior: |
| 22 | +- Mouse Drag waits for a real mouse button and does not assume left button. |
| 23 | +- Mouse Drag Release waits for down, movement, and release. |
| 24 | +- Captured drag mappings record the actual mouse button used. |
| 25 | +- Capture highlight remains visible for the configured minimum visual duration and then clears. |
| 26 | +- Release, double-click, and combo pending states remain visually testable through existing focused coverage. |
| 27 | +- Capture completion no longer repeats mappings from the same capture session. |
| 28 | + |
| 29 | +Expected pass behavior: focused Input Mapping V2 tests and full `npm run test:workspace-v2` pass with no page errors. |
| 30 | +Expected fail behavior: attempting to map Drag or Drag Release without the required live mouse sequence creates no mapping and leaves an actionable capture/status message. |
| 31 | + |
| 32 | +## Validation |
| 33 | +PASS `node --check tools/input-mapping-v2/js/ToolStarterApp.js` |
| 34 | +PASS `node --check tools/input-mapping-v2/js/services/EngineInputSourceService.js` |
| 35 | +PASS `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 36 | +PASS `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs -g "Input Mapping V2"` - 9 passed. |
| 37 | +PASS `npm run test:workspace-v2` - 68 passed. |
| 38 | +PASS `git diff --check` - no whitespace errors; PowerShell reported the existing LF to CRLF working-copy warning for the Playwright spec. |
| 39 | + |
| 40 | +## V8 Coverage |
| 41 | +Runtime JavaScript changed, so Playwright V8 coverage artifacts were produced: |
| 42 | +- `docs/dev/reports/playwright_v8_coverage_report.txt` |
| 43 | +- `docs/dev/reports/coverage_changed_js_guardrail.txt` |
| 44 | + |
| 45 | +Coverage guardrail status: advisory only, no threshold enforced, no missing changed-runtime-JS warnings. |
| 46 | + |
| 47 | +## Manual Test Notes |
| 48 | +1. Open Input Mapping V2, select an action, click Add, select Mouse Drag, click Capture Mouse, press and hold right mouse, then move. Expected: no mapping until movement; tile records `Mouse Right Button, Drag`; capture highlight remains briefly, then clears. |
| 49 | +2. Select another action, click Add, select Mouse Drag Release, click Capture Mouse, press middle mouse, drag, then release. Expected: no mapping until release; tile records `Mouse Middle Button, Drag Release` and hover/title includes bounds. |
| 50 | +3. Repeat Release, Double Click, and Combo captures. Expected: pending messages remain visible during the intermediate state and no duplicate mapping is created from a single capture click. |
| 51 | +4. Confirm Status / Log receives mapping detail messages and Capture only shows generic capture state text. |
| 52 | + |
| 53 | +## Delta ZIP |
| 54 | +- `tmp/PR_26140_112-fix-input-mapping-v2-drag-capture-and-visual-state_delta.zip` created and verified with repo-relative entries. |
| 55 | + |
| 56 | +## Samples Smoke |
| 57 | +Full samples smoke test was not run, per request. Sample JSON was not touched. |
0 commit comments