Skip to content

feat: dropdown follow-ups — element-unit width, optional Button text, Navigatable.getControls() - #34

Merged
daedeloth merged 3 commits into
masterfrom
feature/dropdown-followups
Sep 9, 2026
Merged

feat: dropdown follow-ups — element-unit width, optional Button text, Navigatable.getControls()#34
daedeloth merged 3 commits into
masterfrom
feature/dropdown-followups

Conversation

@daedeloth

Copy link
Copy Markdown
Member

The three follow-ups to the dropdown control (#31) that were left on feature/dropdown-control after v1.2.14 was cut. The QuizWitz settings screen depends on all three, and its CI canary (tests/easelbone-dropdown-canary.test.js) fails against the published 1.2.14 until they ship.

  • Dropdown style.width is in element units — the game passes a symbol-unit width; on 1.2.14 the same number is read as stage pixels and the popover comes out the wrong width at every canvas size.
  • Button no longer requires a text placeholder — an icon-only button (the settings gear) throws "All buttons should have a text placeholder." on 1.2.14.
  • Navigatable exposes getControls() — the game forwards a view's control map to the player pool so vertically oriented views navigate on up/down for remote users too.

Cherry-picked cleanly onto master; npm run build is clean and the built dist no longer contains the placeholder throw. Publishing this as 1.2.15 lets the game bump its ~1.2.14 pins.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByQwVfWJtoX87ogrmKDg1M

daedeloth and others added 3 commits September 9, 2026 14:00
style.width was documented and used as absolute stage pixels. Its only
consumer (the QuizWitz settings screen) lays out in design units that
the view scales to the canvas, so it could never compute a correct
stage-pixel width at build time.

style.width is now expressed in the element's own units (nominalBounds
space, like every other metric) and multiplied by the measured _scale
at open() time.

Extends the dropdown example/test: the long dropdown now takes an
explicit width in element units, and dropdown-test.js asserts the
painted panel width equals width * scale within 2px.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByQwVfWJtoX87ogrmKDg1M
Button used to throw "All buttons should have a text placeholder." when
constructed on a symbol with no `.text` child. An icon-only button is a
valid use case, so the placeholder is now optional: convertText() only
runs when `element.text` is present, and setText() is a safe no-op on a
button that has none. The click wiring, keyInput, click(callback) and
Base's activate/deactivate animation are unchanged - the element still
has to be a MovieClip with the usual Up/Over/Down/Hit frames, since
Base#update drives it through those via gotoWithAnimate.

Verified in app/examples/controls.html: a third button built from a
copy of the Button symbol with its `.text` cleared before construction
(the asset library ships no genuinely text-less MovieClip, so this is
the closest faithful stand-in), asserted via tools/dropdown-test.js -
construction doesn't throw, a click still reaches its handler,
setText() doesn't throw and leaves the button clickable, and a normal
button on the same page still renders its label (BigText/TextPlaceholder
path untouched).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByQwVfWJtoX87ogrmKDg1M
A Navigatable picks its control map from options.orientation: a VERTICAL
view navigates on up/down and manipulates on left/right. That map is
private (this._controls), so only the view's own local bindings ever used
it — pool-routed input (phones, gamepads, the local keyboard device) is
bound by CatLab/Webremote's NavigateableProxy, which cannot see the view
and falls back to a hard-coded horizontal map.

getControls() is the public read of that mapping, so the pool manager can
forward it and a vertical view navigates vertically on every device. A
copy is returned: a caller may not mutate the view's own map.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByQwVfWJtoX87ogrmKDg1M
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

📦 PR Preview deployed!

Examples are available at:

@daedeloth
daedeloth merged commit da5665b into master Sep 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant