|
| 1 | +# Input Mapping V2 Spacing And Used Key Highlight Report |
| 2 | + |
| 3 | +PR: `PR_26140_106-fix-input-mapping-v2-spacing-and-used-key-highlight` |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- Read `docs/dev/PROJECT_INSTRUCTIONS.md`. |
| 8 | +- Checked `docs/pr/BUILD_PR.md`; it describes an unrelated Level 18 rebase, so the explicit PR106 user request was used as the source of truth. |
| 9 | +- Reduced Input Mapping V2 Gestures/Capture bottom spacing without changing schemas or sample JSON. |
| 10 | +- Fixed selected mapping highlights so saved selected tile data visibly highlights both the Captured Mappings tile token and the associated Keyboard/Mouse/Game Controller controls while active capture highlighting remains separate. |
| 11 | +- Added live keyboard action feedback: when a saved keyboard mapping is pressed again, the matching Captured Mappings input token shows an orange `#f59f00` ring while the key is held. |
| 12 | + |
| 13 | +## Changed Files |
| 14 | + |
| 15 | +- `tools/input-mapping-v2/js/ToolStarterApp.js` |
| 16 | +- `tools/input-mapping-v2/js/controls/CaptureControl.js` |
| 17 | +- `tools/input-mapping-v2/js/controls/PreviewPanelControl.js` |
| 18 | +- `tools/input-mapping-v2/styles/inputMappingV2.css` |
| 19 | +- `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 20 | + |
| 21 | +## Implementation Notes |
| 22 | + |
| 23 | +- Used-input chips now receive `is-selected-mapping-input`, `aria-current="true"`, and source metadata when rendered from the selected action's saved mapping data. |
| 24 | +- Used-input chips now display the physical control only, such as `Keyboard KeyP`, `Mouse Right Button`, or `Game Controller X`, so the saved control itself is the visible highlighted element. |
| 25 | +- The saved gesture is stored on `data-input-mapping-used-gesture` and appended to chip `title` metadata for default mappings such as Press, Click, and Button. |
| 26 | +- Captured Mappings input tokens for the selected action now receive `is-selected-mapping-input`, `aria-current="true"`, and a visible glow. For example, the selected `Cancel` tile renders a saved mapping token as `Keyboard\nKeyP\nPress` and highlights that token from the tile data without requiring another key press. |
| 27 | +- Captured Mappings input tokens now receive `is-action-active` and `data-input-mapping-action-active="true"` while a matching saved keyboard Press/Hold binding is physically down. The active state uses `#f59f00` for the token border/ring and clears on keyup. |
| 28 | +- Live keyboard action feedback is skipped for editable fields so typing into Input Mapping V2 text/number/range controls does not re-render the tile grid. |
| 29 | +- Active capture buttons keep their stronger `is-capturing` inset highlight even when the same source also has `has-used-input`. |
| 30 | +- Gestures/Capture bottom padding was reduced from `6px` to `2px`, gesture cards align to their content start, and gesture lists avoid stretched bottom whitespace. |
| 31 | +- Gestures and Capture accordions are content-sized again; the center panel scrolls when the combined setup and mapping areas exceed the viewport. |
| 32 | +- Captured Mappings uses a fixed `360px` flex basis so the 225x225 tile grid keeps its own internal scrolling and does not overlap Delete Action/Delete Mappings. |
| 33 | + |
| 34 | +## Playwright Impact |
| 35 | + |
| 36 | +Playwright impacted: Yes. |
| 37 | + |
| 38 | +Added/updated focused coverage for: |
| 39 | + |
| 40 | +- Gestures device containers have no excessive bottom whitespace. |
| 41 | +- Capture accordion/container has no excessive bottom whitespace. |
| 42 | +- Gestures/Capture contents fit without internal clipping. |
| 43 | +- Captured Mappings tile click point remains reachable and is not covered by mapping action controls. |
| 44 | +- Selecting a tile mapped to `Keyboard KeyP Press` highlights the visible selected used-control chip. |
| 45 | +- Selecting a tile mapped to `Keyboard KeyP Press` highlights the Captured Mappings tile input token with `is-selected-mapping-input` and `aria-current="true"`. |
| 46 | +- Pressing `KeyP` again while the `Cancel / Keyboard / KeyP / Press` token is selected adds `is-action-active`, sets `data-input-mapping-action-active="true"`, and shows the `#f59f00` token ring until keyup. |
| 47 | +- The visible selected chip is `Keyboard KeyP`, with saved control metadata `KeyP` and saved gesture metadata `Press`. |
| 48 | +- Equivalent physical-control chips are asserted for Mouse and Game Controller mappings. |
| 49 | +- Equivalent selected tile-token highlighting is asserted for Keyboard, Mouse, and Game Controller mappings. |
| 50 | +- Highlight is driven by selected tile data, not by pressing `KeyP` again. |
| 51 | +- Active capture highlight and saved used-input highlight can coexist without the active capture style being weakened. |
| 52 | +- Existing Keyboard/Mouse/Game Controller selected used-control coverage remains in the PR105 gesture regression. |
| 53 | + |
| 54 | +## Validation |
| 55 | + |
| 56 | +PASS: |
| 57 | + |
| 58 | +- `node --check tools/input-mapping-v2/js/controls/CaptureControl.js` |
| 59 | +- `node --check tools/input-mapping-v2/js/ToolStarterApp.js` |
| 60 | +- `node --check tools/input-mapping-v2/js/controls/PreviewPanelControl.js` |
| 61 | +- `node --input-type=module -e "await import('./tools/input-mapping-v2/js/ToolStarterApp.js'); await import('./tools/input-mapping-v2/js/controls/PreviewPanelControl.js'); await import('./tools/input-mapping-v2/js/controls/CaptureControl.js'); console.log('input mapping controls import ok');"` |
| 62 | +- `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs` |
| 63 | +- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs -g "keeps Input Mapping V2 spacing compact and highlights saved selected inputs" --reporter=line` (`1 passed`) |
| 64 | +- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs -g "selects Input Mapping V2 gestures for capture and highlights used controls" --reporter=line` (`1 passed`) |
| 65 | +- `npm run test:workspace-v2` (`63 passed`) |
| 66 | +- `git diff --check` |
| 67 | +- `git status --short -- games samples start_of_day` returned no sample/game/start_of_day changes. |
| 68 | + |
| 69 | +Corrective iteration: |
| 70 | + |
| 71 | +- An initial expanded gesture regression timed out after the new PR106 flow made that already-long test exceed the per-test timeout. The PR106 assertions were split into a focused test, and the final targeted/full validation passed. |
| 72 | +- After review feedback that the original spacing fix had been removed while avoiding tile/action overlap, the compact accordion behavior was restored with a bounded Captured Mappings area and additional Playwright coverage for internal clipping and tile hit testing. |
| 73 | +- After review feedback that the selected used-input highlight was not clear, the Capture used-control display was changed from full mapping text to highlighted physical-control chips with saved gesture metadata. |
| 74 | +- After review feedback that the expected result should be visible on the Captured Mappings tile token itself, the Preview Panel now marks selected action tokens with the same selected-input class and a token-level glow. |
| 75 | +- After review feedback that the action still did not visibly show as "in play", the tool now applies a separate `#f59f00` live pressed-state ring to the matching Captured Mappings token while the saved keyboard input is held. An initial mouse live-state attempt re-rendered during tile clicks, so the final implementation stays scoped to the requested keyboard press feedback. |
| 76 | + |
| 77 | +## Full Samples Smoke |
| 78 | + |
| 79 | +Skipped by explicit PR instruction: do not run the full samples smoke test. |
| 80 | + |
| 81 | +## Manual Validation |
| 82 | + |
| 83 | +1. Open `tools/input-mapping-v2/index.html`. |
| 84 | +2. Add/select `Cancel`, select Keyboard Press, click Capture Keyboard, press `P`. |
| 85 | +3. Select another mapping tile, then select `Cancel` again. |
| 86 | +4. Expected: the `Cancel` tile token `Keyboard / KeyP / Press` is highlighted with a visible glow, `Keyboard KeyP` is highlighted in the Capture used-controls area without pressing `P` again, and hover/title metadata includes `Press`. |
| 87 | +5. Press and hold `P` again. |
| 88 | +6. Expected: the `Cancel` tile token `Keyboard / KeyP / Press` shows an orange `#f59f00` ring while `P` is down, then returns to the selected glow after keyup. |
| 89 | +7. Click Capture Keyboard while `Cancel` is selected. |
| 90 | +8. Expected: active capture highlight is stronger/distinct while the saved used-input state remains present. |
| 91 | +9. Inspect Gestures and Capture accordions at desktop and narrower widths. |
| 92 | +10. Expected: responsive wrapping remains intact and there is no excessive empty bottom space inside gesture cards or the Capture content. |
| 93 | +11. Add enough mapping tiles to fill Captured Mappings. |
| 94 | +12. Expected: the tile grid scrolls internally and tiles are not covered by Delete Action/Delete Mappings. |
0 commit comments