Repository navigation
Keep a playground's readings following their fields while a script writes the instruction - #7339
Merged
Merged
Conversation
…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.
leaf-agent
approved these changes
Nov 27, 2026
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.
A playground's
<output for="NAME">reading stopped following its field once the page's script registered an instruction provider:render()inplayground-view.jsfilled 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 thelf-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 shippedcode-comparisonexample shows it: withleaf-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.mjspasses.