space-game KeybindingConfigHUD: screen-centred dialogs ignore clicks after the panel is dragged #1078

Closed
opened 2026-08-13 13:34:16 +00:00 by spikerj · 1 comment
Owner

Wave 8 coverage a3 (KeybindingConfigHUD in projects/spikersoft/src/app/_components/_games/space-game/hud/keybinding-config-hud.ts).

createConflictDialog / createBackendLoadDialog place the modal meshes at screen centre. handleClick however returns false immediately when the point is outside the 600×500 panel (isInBounds uses posX/posY).

Repro (unit, jsdom, mocked renderer — no GPU):

  1. setPosition(0, 0) (or title-bar drag the panel into a corner).
  2. showBackendLoadDialog() / showConflict(...).
  3. Click the Yes/No (or Swap) mesh centre.

Observed: handleClick returns false; onRebind is never called. The dialog is still visible at screen centre, outside the dragged panel.

Same class: clicks that hit the dialog background but miss the buttons also return false, so the parent can treat them as game clicks while a modal is up.

Expected: while a modal is visible, hit-test the dialog first (or consume every click). Do not require the panel AABB.

Covered by keybinding-config-hud.spec.ts (“dialog clicks miss when the panel has been dragged off the screen-centred modal”).

Wave 8 coverage a3 (`KeybindingConfigHUD` in `projects/spikersoft/src/app/_components/_games/space-game/hud/keybinding-config-hud.ts`). `createConflictDialog` / `createBackendLoadDialog` place the modal meshes at **screen centre**. `handleClick` however returns false immediately when the point is outside the 600×500 **panel** (`isInBounds` uses `posX`/`posY`). Repro (unit, jsdom, mocked renderer — no GPU): 1. `setPosition(0, 0)` (or title-bar drag the panel into a corner). 2. `showBackendLoadDialog()` / `showConflict(...)`. 3. Click the Yes/No (or Swap) mesh centre. Observed: `handleClick` returns `false`; `onRebind` is never called. The dialog is still visible at screen centre, outside the dragged panel. Same class: clicks that hit the dialog background but miss the buttons also return `false`, so the parent can treat them as game clicks while a modal is up. Expected: while a modal is visible, hit-test the dialog first (or consume every click). Do not require the panel AABB. Covered by `keybinding-config-hud.spec.ts` (“dialog clicks miss when the panel has been dragged off the screen-centred modal”).
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.