Skip to content

Keep a playground's readings following their fields while a script writes the instruction - #7339

Merged
max-sixty merged 1 commit into
mainfrom
fix/playground-readings-with-provider
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/playground-readings-with-provider

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A playground's <output for="NAME"> reading stopped following its field once the page's script registered an instruction provider: render() in playground-view.js filled readings only when no provider's instruction was drawn. The view now fills every reading on every draw, and a provider's instruction replaces only the lf-playground-output's words. The playground's author instructions already promise this ("An <output for="NAME"> anywhere in the playground shows field NAME's current value"), so no prose changes.

The skip dates from when readings could stand only inside lf-playground-output, which a provider's instruction replaces whole; #6231 let a reading stand anywhere in the playground and kept the skip. The shipped code-comparison example shows it: with leaf-dev probe --base, two ArrowRight presses on its width range move the field to 460 while the reading stays at 420 on main and reads 460 on this branch.

Max asked for the fix after a reading on one of his pages didn't move as he dragged its range.

Tests: the new runtime test "a reading follows its field while a script's provider writes the instruction" fails on main (reading "3", expected "1.5") and passes here; tests/runtime/playground-view.test.mjs passes.

This was written by Claude Code on behalf of max-sixty

…ites the instruction

An `<output for="NAME">` in a playground's rail or preview kept its authored text once the page registered an instruction provider: the view filled readings only when no provider's instruction was drawn. Dragging a range beside its reading left the number where it was written, as on the shipped code-comparison example, whose width reading stayed at 420 as the slider moved to 460.

The branch dates from when readings could stand only inside `lf-playground-output`, which a provider's instruction replaces whole. Since #6231 a reading may stand anywhere in the playground, as the playground's author instructions promise, so the view now fills every reading on every draw and lets a provider's instruction replace only the output's words.

The new runtime test, "a reading follows its field while a script's provider writes the instruction", fails on the previous view (reading "3", expected "1.5") and passes now.
@max-sixty
max-sixty merged commit cf87509 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/playground-readings-with-provider branch November 27, 2026 03:52
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.

2 participants