Repository navigation
Slider change on drag end, drawer and popup checks, and a term-layers golden - #69
Merged
Merged
Conversation
…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.
Merged
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.
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:
change: a caller listening for change heard keyboard steps and missed drags. The drag moves intowebui/src/lib/sliderDrag.tsand dispatches one bubblingchangewhen it ends (released, cancelled or its capture lost) on a value other than the one it started at.scripts/slider-drag.test.mjsdrives it over a stand-in input and fails without the fix.scripts/modal-surfaces.test.mjschecks 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); theout: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 intowebui/src/lib/popoverPlacement.ts(applyPopoverPlacement, whichplace()calls), and the test drives it over a panel that measures as a border-box element does.tests/fixtures/browser/steering-term-layers-v1.jsonpins whatPOST .../steering/validateanswers (withoutparts) over a model-free composer, run through the served route:n_layersand 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-layeralong/onto(so the curved gains are pinned:{0}lowers to along 1.2, onto 0.25). The builder is intests/browser/test_browser_parity.py(PYTHONPATH=. python -m tests.browser.test_browser_parityrecomputes the outputs from the inputs; it is idempotent), andtest_browser_term_layers_fixture_matches_pythonrecomputes 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 share1.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
onoutrostartof its own, but Svelte 5's transition manager setsinerton any element as its outro starts, so a leaving dialog is already inert. The test pins that dependency.Test plan
ruff check .passespyright tests/browser/test_browser_parity.pypassespytest -m "not gpu" tests/browser tests/web tests/invariants tests/steering/test_layer_scoped_steering.py tests/server/test_drowse_api.py: 526 passednpm run check && npm run buildpasses 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)Notes
RecordedDemocan drop its windowpointerup/pointercancelworkaround and listen for change alone.