Skip to content

Widget: configurable launcher position, size and offsets - #555

Merged
neuromechanist merged 7 commits into
developfrom
feature/issue-553-launcher-size-position
Sep 30, 2026
Merged

neuromechanist merged 7 commits into
developfrom
feature/issue-553-launcher-size-position

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

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.

Field Values Default
launcher_position bottom-right, bottom-left bottom-right
launcher_size, launcher_open_size whole px, 44 to 96, open <= closed 56 bubble, 58 capsule; open is 80% of closed when only closed is set
launcher_offset_x, launcher_offset_y whole px, 0 to 200, from the side and bottom edges 20
launcher_mobile_offset_x, launcher_mobile_offset_y whole px, 0 to 200, at 600px wide and narrower the offsets above
  • The launcher shrinks from its closed to its open size with the capsule's animation and its corner held still, for the bubble as well as the capsule.
  • The label, the panel, the capsule (column and row) and the resize handle follow the position and offsets.
  • A page's setConfig takes 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.
  • NEMAR spells out its own values (the ones it already has) as the worked example.
  • Defaults are the stylesheet's fallbacks, so an unconfigured widget is drawn as before; this was measured against develop in Chrome.

Review

Reviewed with the PR review toolkit (Sonnet agents: code, tests, comments, silent failures, types) and every finding addressed. The findings that mattered:

  • The panel could be pushed off a small window by a large offset (its minimum width beat the offset-aware maximum); reproduced in Chrome at 320px and 390px, now fixed and covered.
  • The left-anchored capsule row reversed Tab order; the circles are now reordered in the DOM, including on resize.
  • Server ints are strict, so a YAML yes or off is refused instead of becoming a 1px or 0px offset.
  • setConfig no longer lets an undefined or wrong value lock out the community's own.
  • Tests that could pass vacuously (empty translate) now fail on empty; the harness has timeouts and captures page errors.

Testing

  • bun suites for every widget file, including the new test-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 CI
  • Existing real-Chrome checks: first paint (capsule animation, hover, 390px), color scheme, pop-out
  • Python: config, endpoint, drift tests pass; osa validate --community nemar passes
  • Full Python suite: 4042 passed, 18 failed. Seventeen are test_chat_resume_endpoint.py (401 responses on this machine, identical on plain develop), one is a documentation-URL check that needs the network.

Not done here

)

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.
@neuromechanist neuromechanist added enhancement New feature or request widget Related to frontend widget labels Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://feature-issue-553-launcher-s-demo.osc.earth
Branch feature/issue-553-launcher-size-position
Commit e9d55f5

This preview will be updated automatically when you push new commits.

@neuromechanist
neuromechanist merged commit 06bc4e8 into develop Sep 30, 2026
11 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-553-launcher-size-position branch September 30, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request widget Related to frontend widget

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant