feat: dropdown follow-ups — element-unit width, optional Button text, Navigatable.getControls() - #34
Merged
Merged
Conversation
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
|
📦 PR Preview deployed! Examples are available at: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three follow-ups to the dropdown control (#31) that were left on
feature/dropdown-controlafter 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.style.widthis 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."All buttons should have a text placeholder."on 1.2.14.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 buildis clean and the built dist no longer contains the placeholder throw. Publishing this as 1.2.15 lets the game bump its~1.2.14pins.🤖 Generated with Claude Code
https://claude.ai/code/session_01ByQwVfWJtoX87ogrmKDg1M