Repository navigation
Widget: configurable launcher position, size and offsets - #555
Merged
neuromechanist merged 7 commits intoSep 30, 2026
Merged
Conversation
) Adds launcher_position (bottom-right or bottom-left), launcher_size and launcher_open_size (44 to 96 px, open never larger than closed), and launcher_offset_x/y plus launcher_mobile_offset_x/y (0 to 200 px) to WidgetConfig, validated at load and sent to the widget only when set. Config and API tests pass; the widget does not read the fields yet.
The launcher can sit bottom-left as well as bottom-right, be drawn at a configured closed size and shrink to an open size (bubble and capsule, 80% of the closed size when only that is set), and be moved by offsets from the side and bottom edges, with separate offsets at 600px wide and narrower. Position, size and offsets reach the stylesheet as a few custom properties whose fallbacks are today's values, so an unconfigured widget is drawn as before. A page's setConfig keys outrank the community's. Tested: bun suites for every widget file (new test-widget-launcher-geometry.js, existing assertions moved to numbers via test-support/css-px.js), the Python drift test for the limits, and a real-Chrome per-frame check (browser-harness/launcher-geometry-check.mjs) plus the existing first-paint check, all passing.
Adds the field table, an example, the size and animation notes and the validation behavior to docs/community-widget.md, the setConfig keys, and a changelog entry. Docs only; the behavior is tested in the previous commit.
Writes out the values NEMAR's launcher already has (bottom right, 20px offsets, 58px closed and 46px open) as the worked example of the new fields, and adds an endpoint test that only NEMAR sends launcher geometry. osa validate --community nemar passes; the rendering is unchanged, which launcher-geometry-check.mjs measures in Chrome for the default capsule.
…oint tests (#553) Review fixes. The launcher's pixel fields are strict integers, so a YAML yes, off or a quoted number is refused instead of becoming 1, 0 or a rounded number; the response model shares the same bounded types. The defaults are immutable and total (a new launcher shape fails a test, not a KeyError), and the open sizes, offset and open ratio are constants that the drift test pins to the widget's stylesheet fallbacks. New tests: the per-community route the widget reads carries the launcher fields, the model, LAUNCHER_GEOMETRY_FIELDS and the response agree, and the endpoint test compares each community with its own config instead of hardcoded NEMAR numbers. Python tests pass.
) The panel's minimum width and height give way to the room the offsets leave, so a launcher moved far in no longer pushes the panel off a small window (reproduced at 320px and 390px in Chrome). A left-anchored capsule row is reordered in the DOM, and again on resize, so Tab follows what is seen, replacing the reversed flex row. setConfig refuses a wrong launcher value with a warning so the community's value still applies, treats undefined as not set, and never throws over a BigInt or NaN; a null position is unset. The capsule is read from the widget, not from a later setConfig. Tests: the vacuous empty-translate checks now fail on empty, cssNumber refuses blank and non-finite values, and new cases cover offline page config, the pop-out, reduced motion, rounding, range ends, the 600/601 boundary, Tab order and hover. The Chrome check gains hover, Tab order, 320px and largest-value windows, page-error capture, a timeout, and fails on a timed-out wait. Widget suites, the Chrome checks and the first-paint, color-scheme and pop-out checks pass.
Fixes statements the review found wrong or stale: the 80% open size is rounded and never below 44, the malformed-value paragraph now covers the launcher, the defaults list is exact, and the harness README section is in its own place with claims that match the checks. Adds strict-number and setConfig behavior, and the resize note for the left side. Docs only.
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
This was referenced Sep 30, 2026
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.
Refs #553.
The issue stays open for the BIDS follow-up below.
Makes the widget launcher's position, size and offsets configurable, from the BIDS site feedback (bids-standard/bids-specification#2541) that the button is too small and covers the page's own buttons.
What changes
New
widget:fields, all optional; a community that sets none renders exactly as before.launcher_positionbottom-right,bottom-leftbottom-rightlauncher_size,launcher_open_sizelauncher_offset_x,launcher_offset_ylauncher_mobile_offset_x,launcher_mobile_offset_ysetConfigtakes the same settings in camelCase and outranks the community; a wrong value from a page is refused with a warning so the community's own value still applies.developin Chrome.Review
Reviewed with the PR review toolkit (Sonnet agents: code, tests, comments, silent failures, types) and every finding addressed. The findings that mattered:
yesoroffis refused instead of becoming a 1px or 0px offset.setConfigno longer lets anundefinedor wrong value lock out the community's own.translate) now fail on empty; the harness has timeouts and captures page errors.Testing
bunsuites for every widget file, including the newtest-widget-launcher-geometry.js(154 checks)launcher-geometry-check.mjs, new, in real Chrome: per-frame corner-drift sampling, hover, Tab order, 320px and largest-value windows, real mouse resize drag (286 checks); also wired into CIosa validate --community nemarpassestest_chat_resume_endpoint.py(401 responses on this machine, identical on plaindevelop), one is a documentation-URL check that needs the network.Not done here
launcher_size, position or offset, and a distincttheme_colorwith the BIDS maintainers, then reply on [ENH] design improvements for OSA chatbot button bids-standard/bids-specification#2541. Where the social buttons and the version menu sit on the live BIDS site has not been confirmed.