space-game PeriodicTableHUD: DEFAULTS button is never hit-tested #1085

Closed
opened 2026-08-13 13:54:41 +00:00 by spikerj · 1 comment
Owner

Wave 8 coverage a3 (PeriodicTableHUD in projects/spikersoft/src/app/_components/_games/space-game/hud/periodic-table-hud.ts).

createUI paints a 120×36 DEFAULTS rect next to CONFIRM (defaultX = confirmX - 130) but never stores the mesh, never sets userData.action, and handleClick never hit-tests it. selectDefaultElements() (Fe/Al/Si/Cu) is therefore unreachable from a click.

Repro (unit, jsdom, mocked troika / WebGLRenderer — no GPU):

  1. show().
  2. Click the DEFAULTS rect centre (the 120×36 mesh that is not userData.action === "confirm").

Observed: handleClick returns true (click consumed as a panel miss); getSelectedElements() stays []; onElementSelected is never called.

Expected: clicking DEFAULTS should run selectDefaultElements() (and typically refresh the selection callbacks / info text), matching the painted control.

Covered by periodic-table-hud.leftovers.spec.ts (“DEFAULTS button is painted but never hit-tested…”).

Wave 8 coverage a3 (`PeriodicTableHUD` in `projects/spikersoft/src/app/_components/_games/space-game/hud/periodic-table-hud.ts`). `createUI` paints a 120×36 DEFAULTS rect next to CONFIRM (`defaultX = confirmX - 130`) but never stores the mesh, never sets `userData.action`, and `handleClick` never hit-tests it. `selectDefaultElements()` (Fe/Al/Si/Cu) is therefore unreachable from a click. Repro (unit, jsdom, mocked troika / WebGLRenderer — no GPU): 1. `show()`. 2. Click the DEFAULTS rect centre (the 120×36 mesh that is not `userData.action === "confirm"`). Observed: `handleClick` returns `true` (click consumed as a panel miss); `getSelectedElements()` stays `[]`; `onElementSelected` is never called. Expected: clicking DEFAULTS should run `selectDefaultElements()` (and typically refresh the selection callbacks / info text), matching the painted control. Covered by `periodic-table-hud.leftovers.spec.ts` (“DEFAULTS button is painted but never hit-tested…”).
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). PeriodicTableHUD DEFAULTS button is hit-tested. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). PeriodicTableHUD DEFAULTS button is hit-tested. Closing.
Sign in to join this conversation.