Skip to content

Slider change on drag end, drawer and popup checks, and a term-layers golden - #69

Merged
a9lim merged 7 commits into
mainfrom
webui/hosted-port-fixes
Nov 2, 2026
Merged

a9lim merged 7 commits into
mainfrom
webui/hosted-port-fixes

Conversation

@a9lim

@a9lim a9lim commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

Three small things the drowse.ai port to 6.0 found in shared code, landed here so the site can drop its workarounds when its pin moves:

  1. Slider fires change at the end of a drag. The Slider runs pointer drags itself (pointerdown is prevented), so the browser's range drag never starts and never fires change: a caller listening for change heard keyboard steps and missed drags. The drag moves into webui/src/lib/sliderDrag.ts and dispatches one bubbling change when it ends (released, cancelled or its capture lost) on a value other than the one it started at. scripts/slider-drag.test.mjs drives it over a stand-in input and fails without the fix.
  2. Drawer-inert and popup-fit checks. drowse.ai's browser specs checked that an open drawer makes the page behind it inert, that a leaving drawer and the token popover take no input while they fade, and that Sampling settings and the token probabilities fit the viewport. These are shared surfaces, so scripts/modal-surfaces.test.mjs checks them here: the shell rendered with Sampling settings open (header and notices inert, the dialog modal, DrawerOutlet's loading blocks and then the drawer, Close in the head above the scrolling body); the out: transitions Svelte runs with the element inert (pinned from Svelte's runtime source too); the dialog's box laid out from App's CSS (insets, size and min/max size per axis; a box the model cannot place is refused) at 320x780, 390x844, 667x375, 900x900 and 1440x900 (a fixed 960px width, or a height past the viewport, fails it), with DrawerOutlet's loading bars fitting the shortest dialog; and the token popover placed over those viewports and a pinch-zoomed one. The popover's placement, style writes included, moves unchanged into webui/src/lib/popoverPlacement.ts (applyPopoverPlacement, which place() calls), and the test drives it over a panel that measures as a border-box element does.
  3. A golden for the validate response's term layers. tests/fixtures/browser/steering-term-layers-v1.json pins what POST .../steering/validate answers (without parts) over a model-free composer, run through the served route: n_layers and each term's key, fitted layers, share and clause selection for layer-scoped pushes and ablations, the workspace band, a vector with a zero layer, ~ projections that drop the layers they zero (and | that keeps them), a flat % position, a curved % term with a clause, and repeats folded by IR key; the refusals composition answers in band; and each curved term's hook share and lowered per-layer along/onto (so the curved gains are pinned: {0} lowers to along 1.2, onto 0.25). The builder is in tests/browser/test_browser_parity.py (PYTHONPATH=. python -m tests.browser.test_browser_parity recomputes the outputs from the inputs; it is idempotent), and test_browser_term_layers_fixture_matches_python recomputes it.

Why

drowse.ai reimplements validate's term layers in its browser compiler and had no golden for them, only its reading of the Python. One thing the golden makes explicit: the response's share for a curved % term is mean 1 over the term's fitted layers (term_layers), while the share the hook applies (_manifold_layer_shares) is mean 1 over the layers its clause selects. 0.3,0.5 mood%n1{0} answers share [0.667, 1.333] over layers 0-1 and acts at layer 0 with hook share 1.0.

The drawer and popup checks were deleted from drowse.ai with the pre-Ledger specs; no behaviour changed here for them. In 6.0 the dialog has no onoutrostart of its own, but Svelte 5's transition manager sets inert on any element as its outro starts, so a leaving dialog is already inert. The test pins that dependency.

Test plan

  • ruff check . passes
  • pyright tests/browser/test_browser_parity.py passes
  • pytest -m "not gpu" tests/browser tests/web tests/invariants tests/steering/test_layer_scoped_steering.py tests/server/test_drowse_api.py: 526 passed
  • GPU smoke tests (not relevant: no model, fitting, generation or hook code changed)
  • npm run check && npm run build passes on Node 24 and the committed bundle is current (origin/main rebuilds byte for byte in the same environment, so the bundle diff is only this change)
  • Manually verified against a model (not done; the Slider change is covered by the script test)

Notes

  • New golden only; no existing golden changed. drowse.ai can replay it once its pin moves past this.
  • After the pin moves, drowse.ai's RecordedDemo can drop its window pointerup/pointercancel workaround and listen for change alone.

a9lim added 7 commits November 1, 2026 22:36
…alue

The Slider runs pointer drags itself (pointerdown is prevented), so the
browser's own range drag never starts and never fires change: a caller
listening for change heard keyboard steps but missed drags. The drag now
lives in lib/sliderDrag.ts and dispatches one bubbling change when it
ends (released, cancelled or its capture lost) on a value other than the
one it started at. scripts/slider-drag.test.mjs drives it over a stand-in
input.
…d token popover fit

drowse.ai's browser specs checked these shared surfaces; they belong
here. scripts/modal-surfaces.test.mjs renders the shell with Sampling
settings open (the header and notices inert, the dialog modal, DrawerOutlet
loading and then the drawer, Close in the head above the scrolling body),
pins the out: transitions that Svelte runs with the leaving dialog, scrim
and popover inert, computes the dialog's box from App's CSS at phone,
landscape and desktop sizes, and places the token popover over those
viewports and a pinch-zoomed one. The popover's placement moves into
lib/popoverPlacement.ts, unchanged, so it can be checked.
tests/fixtures/browser/steering-term-layers-v1.json: per case, what
POST .../steering/validate answers (without parts) over a model-free
composer, run through the served route: n_layers and each term's key,
fitted layers, mean-1 share and clause selection, for layer-scoped
pushes and ablations, the workspace band, a vector with a zero layer, ~
projections that drop the layers they zero (and | that keeps them), a
flat % position, a curved % term with a clause, and repeats folded by
IR key; the refusals composition answers in band; and a curved term's
hook share, which _manifold_layer_shares normalizes over the clause's
layers where the response's share is normalized over the fit. The
builder lives in tests/browser/test_browser_parity.py (run the module
to regenerate the outputs from the inputs); the test recomputes them.
The dialog's box is laid out per axis from its insets, size and min/max size,
so a height that outgrows the viewport fails, and a box the model cannot place
(content-sized, static, margins or transforms) is refused. DrawerOutlet's
loading bars must fit the shortest dialog. TokenLogitsPopover's style writes
move into applyPopoverPlacement, which the test drives over a measuring panel.
Each curved case records the lowered plan's per-layer along and onto, so the
curved gains and how they combine with the hook share are pinned too.
@a9lim
a9lim merged commit 4074844 into main Nov 2, 2026
12 checks passed
@a9lim
a9lim deleted the webui/hosted-port-fixes branch November 2, 2026 06:38
@a9lim a9lim mentioned this pull request Nov 2, 2026
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