oficina / slides Public

Editor: the box's button is checked everywhere, or docks by the switch

Review fix round 2. buttonSpot returns nothing unchecked: every answer
passes one fits() test (inside the stage, over no handle). After its
five places it searches the whole stage, nearest the box's top end
corner first and within 48px of the box preferred; the search takes
the stage's edges and the handles' far edges as well as a 2px grid, so
it finds a place whenever there is one. With none it returns null, and
box-menu.mjs docks the button beside the view switch (data-docked).

Tests: the reviewer's 100x52 box, boxes filling stages, fractions, and
3000 seeded random boxes in stages from 160 to 1920 wide, each answer
checked and each null confirmed by a half-pixel brute-force search;
the docked fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 57f3e14bbe3c4e4e04a69332238ffa61e4760eda parent f47c524
6 files changed, +156 −42
  • fixtures/box-menu.mjs +15 −2
  • fixtures/box-menu.test.mjs +33 −1
  • fixtures/box-spot.mjs +35 −23
  • fixtures/box-spot.test.mjs +57 −0
  • internal/slides/credits/assets.json +1 −1
  • internal/slides/static/{editor.bd51417403608322.js => editor.e08a0a4c7c160e02.js} +15 −15
fixtures/box-menu.mjs

Loading diff…

fixtures/box-menu.test.mjs

Loading diff…

fixtures/box-spot.mjs

Loading diff…

fixtures/box-spot.test.mjs

Loading diff…

internal/slides/credits/assets.json

Loading diff…

internal/slides/static/{editor.bd51417403608322.js => editor.e08a0a4c7c160e02.js}

Loading diff…