* feat(studio): the code editor follows studio's light and dark theme
Replaces One Dark with a Studio editor theme whose colours are theme.css variables: eight syntax role tokens (One Light and One Dark hues held at 4.5:1), editor surfaces from Studio's roles, all measured by the contrast ratchet.
* test(studio): the code editor theme takes every colour from a theme.css token
* fix(studio): code stays at 4.5:1 when a selection or search match sits on the active line
Syntax tokens are tuned for the selection over the active line, which the ratchet now measures; matches are outlined rather than stacking another wash; the search panel's pressed button and special characters follow the theme; unused tooltip rules go.
* fix(studio): code matches carry no background, and types read apart from constants
Search and selection matches are outlined only, so CodeMirror's lime match wash and stacked washes are gone; type and constant tokens split by hue in both themes.
* fix(studio): the current search match reads apart by width, not colour alone
A 2px accent outline on the current match and a muted 1px outline on other copies of the selected word.
* test(studio-server): history prune tests allow a file time a moment past Date.now()
* ci: temporary probe for the history prune test flake
* fix(studio): timeline scroll-end timer no longer fires after unmount
* ci: remove the temporary history prune probe
* test(studio): check the virtualizer teardown with a spy and a 200 ms wait
* test(studio): start an edit accuracy benchmark for manual editing (work in progress)
* test(studio): an edit accuracy benchmark for manual editing
Drives real pointer and keyboard gestures in the built CLI Studio on generated one-element projects and scores tracking, drop jump, reload drift, undo fidelity and smoothness in composition px.
* test(studio): move render drift out of the first benchmark PR
Render drift against a producer frame ships in the stacked follow-up so this PR stays near the size budget.
* test(studio): keep the edit accuracy bench clean under fallow
Builds the grid as a product of its axes, drops unused exports and marks the harness functions that fallow scores as complex.
* test(studio): report edit accuracy with the Studio and bench commits it measured
Moves scoring and the report files into report.mjs, stamps both commits at start, counts undo byte failures apart from the worst box, and survives Studio swapping the preview iframe mid-read.
* test(studio): bank the edit accuracy baseline measured on main
660 cases on main ae914334f: 0 pass all six checks, 304 pass everything but smoothness. Five cases that hit a harness error in the full run were rerun and spliced in.
* test(studio): state the edit accuracy build prerequisite in the runner header
* test(studio): keep the edit accuracy baseline one line per case under the formatter
* test(studio): store edit accuracy baseline values rounded up
Rounding to the nearest 0.01 stored seven 0.502 px tracking results as 0.5, which reads as a pass at the 0.5 px limit.
* test(studio): score edit smoothness on dropped frames and main-thread work per frame
* test(studio): measure edit accuracy on a still preview and score press jump
Snapshots wait for the preview frames and the box to hold still for 1 s, so Studio's asynchronous reload after a save is measured, not raced. A preview that never settles fails the metrics it feeds instead of erroring.
Adds press jump (box at press against the box before it, 0.5 px). Smoothness counts only dropped frames beyond a blank-page control driven the same way in the same Chrome; unknown trace data fails smoothness alone.
The runner takes the suite lock per chunk of 8 cases (--lock), reads the port Studio announces, keeps undo history and tmp projects inside the case dir and removes them on a signal, and stamps the CLI tree's commit and bundle hash.
* test(studio): stamp the edit accuracy build with the Studio bundle as well as the CLI
The CLI bundle hashed the same for two different Studio builds; Studio's index.html names its hashed assets, so the stamp now covers it.
* test(studio): regenerate the edit accuracy baseline on main after the settle fix
Full grid on main 14e87005d with the settle fix, press jump and the smoothness control: 70/660 pass, 314/660 pass everything but smoothness, 0 harness errors, 0 unsettled. Scored without render, which #4764 adds.
* test(studio): wait for each edit accuracy undo write before sending redo
Undo and redo each wait up to 15 s for their own write, like the settle; redo is sent only once undo landed, and a write that never lands fails undo with undoTimeout instead of scoring an untested redo. The reload waits for the files to hold still. The headline is now the accuracy count, with smoothness on its own line against the control. The settle compares each read with the window's first read, and a CLI outside a git tree no longer stops the run.
* perf(studio): light ui and player entries for a host's first screen
* perf(studio): the ui entry's logo no longer loads the studio header
* test(studio): refuse only packages studio itself depends on
* test(studio): the light entries also refuse the hf-ids parser
* feat(shader-transitions): add playSeamTransitionLoop to preview a seam on a loop
Plays a catalog transition's real WebGL effect between two already-decoded
frames on a caller-supplied canvas, looping 0->1->0 every second. The
caller supplies the two seam frames itself, so this takes two
CanvasImageSource frames directly rather than resolving any DOM scene.
Reuses the existing webgl.ts primitives hyper-shader.ts's full composition
engine already relies on; no GSAP timeline, no scene capture, no
multi-transition scheduling here, just setup + a render loop.
shaderName is the catalog block's own name. 12 of the 14 shader-tagged
catalog blocks match their shaders/registry.ts key verbatim; two are
aliased internally (domain-warp-dissolve->domain-warp,
chromatic-radial-split->chromatic-split) since those registry keys are
also engine/producer's canonical TRANSITIONS[...] names and weren't
renamed to match the catalog. Every other catalog block (including the
CSS/motion-only ones) has no WebGL implementation and throws, so a caller
can fall back to its own render for those.
Re-exported from @hyperframes/studio (new workspace dependency on
shader-transitions) so a consumer of studio and core needs no deep import.
* fix(shader-transitions): keep the WebGL context alive across stop()
- stop() called WEBGL_lose_context.loseContext(), which permanently kills
the canvas's WebGL context -- a later playSeamTransitionLoop() call on
the same canvas (a popover reusing its element across hovers) would pass
the null-context guard with the same dead context object and silently
render nothing. Delete the program, textures and buffer this call
created instead, matching the granular-release idiom hyper-shader.ts
already uses for its own reusable contexts.
- ready never resolved if stop() ran before the first frame (a hover that
ends within one frame, well under 16ms), hanging any caller awaiting it
forever along with everything it closed over. stop() now resolves ready
too; resolving an already-settled promise is a no-op for the normal path.
Also: resolveReady() only needs calling once, on the first frame, not every tick.
* test(shader-transitions): extract shared running-loop setup, dedup per fallow
* fix(shader-transitions): pass accent colors, fix leaks and validation
- renderShader's colors argument was undefined, so u_accent/
u_accent_dark/u_accent_bright stayed at WebGL's zero default. 7 of the 14
shader blocks (domain-warp, ridged-burn, sdf-iris, ripple-waves,
gravitational-lens, thermal-distortion, light-leak) use those uniforms
for their glow/burn colour, so the preview silently rendered without it
for half the catalog -- the "plays the real effect" claim was false for
those seven. Exported webgl.ts's DEFAULT_ACCENT_COLORS (hyper-shader.ts's
own fallback, previously only inlined twice there) and pass it through.
- Each linkProgram() call leaked its compiled vertex and fragment shader
objects (created, attached, linked, never deleted) -- a real WebGL
browser never frees them on its own, and this call is on a hover-repeat
path via a reused canvas. Fixed in webgl.ts's linkProgram itself, which
every caller in this package routes through, not just this new one.
- loopMs was never validated: 0 divided to NaN progress, negative values
ran the shader backwards, Infinity froze it at 0 -- all silently, no
caller-visible error. Now throws synchronously for a non-finite or
non-positive value, matching the function's other synchronous-throw
contract (unknown shader, no WebGL context).
- getFragSource() and the catalog-alias lookup both did an unguarded
plain-object index (shaders[name], CATALOG_SHADER_ALIASES[shaderName]),
which returns Object.prototype members for names like "constructor"
instead of undefined -- an unusual shaderName could reach the shader
compiler with a garbled error or an unintended match. Both now use
Object.hasOwn.
Tests: second half of the loop (progress descending, not climbing past 1),
both catalog aliases (only one was covered before), all four invalid-loopMs
shapes, the accent-color uniforms actually being set, and webgl.test.ts's
new deleteShader assertion. All mutation-verified non-vacuous.
* test(shader-transitions): dedup the two timing tests per fallow
* fix(shader-transitions): apply default accent colors and validate loop options
renderShader now defaults colors to DEFAULT_ACCENT_COLORS instead of the
caller deciding, so playSeamTransitionLoop no longer renders 7 of 14 shader
blocks with a zeroed-out accent. Validates width/height alongside loopMs,
switches the catalog alias map to a Map so a bogus name never resolves an
Object.prototype member, and fixes linkProgram to only delete the shader it
created itself.
* fix(shader-transitions): free GL resources when seam-loop setup throws
A bad fromSource/toSource reaching uploadTextureSource previously left
whatever quadBuf/program/textures had already been allocated dangling,
since playSeamTransitionLoop throws before returning a handle a caller
could call stop() on. Trims three over-limit JSDoc blocks and drops a
redundant prototype-pollution rationale now that getFragSource guards it.
* chore(shader-transitions): trim seam-loop comments to the comment ratchet
* test(shader-transitions): unknown-shader throw covers names on Object.prototype
* fix(studio): ship component styles as their own stylesheet for embedders
Studio's component rules (timeline clips, loaders, range inputs, toasts and
the rest) lived only in the app sheet, so a page that embeds Studio's
components with theme.css got unstyled clips and dark-on-dark labels. They
move unchanged into components.css, exported as
@hyperframes/studio/components.css; studio.css keeps the app shell and
imports it, so Studio's compiled CSS has the same rules.
* test(studio): read moved component rules from components.css
* test(studio): catch class rules nested in the app sheet's layers and media blocks