Repository navigation
fix: read no playground field from a control a preview widget generated - #6375
Merged
Merged
Conversation
Since #6231 a playground reads every named `input`, `select` and `textarea` inside it as a field, and draws one `<form>` around its rail and preview. A widget in the preview that draws its own named controls then had them read as the page's fields. motion-playground's `lf-motion` transport draws `<input name="time">` and `<select name="speed">`, so the playground took both as fields and posted a `tune` of `{time: 0, speed: "1", timing: …}` with no user input. That event is the at-rest write the nightly render gate reports on motion-playground (`data-lf-user-override` and `childList` on `lf-playground#panel-motion`, a doubled `requestFrame`). A control inside an element marked `data-lf-gen` within the playground, which `offer`, `offerElement` and `generatedElement` write on everything a widget generates, is now no field, as the view's header already said of an inspection setting in a form of its own. The playground's own wrappers carry no such mark, so the page's fields are unaffected. The playground-view runtime test now has a generated range and select in its fixture; it fails before this change and passes after it. `test_page_fixture_renders[motion-playground]` fails on main and passes with it. Refs #6297
This was referenced Nov 18, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 18, 2026
… them into a generated element (#6384) #6375 made a playground ignore every control inside a `data-lf-gen` element, so that a preview widget's own generated controls (`lf-motion`'s `time` and `speed`) stop counting as the page's fields. It put that test in `member`, which the view also uses to find the page's own submit and reset buttons and its `<output for>` slots. A page script that moves its authored submit button into a container it built with `generatedElement` now loses that button, so Leaf draws its own rail and action bar beside the page's. `test_a_page_draws_the_actions_of_a_playground_without_controls` covers exactly that page, and it failed on main in push run [44269587200](https://github.com/max-sixty/leaf/actions/runs/44269587200) with two `.lf-playground-rail, .lf-playground-actions` elements where it expected none. `output[for]` slots were exposed to the same exclusion, because the view itself marks each slot with `generatedElement`. The generated-control exclusion now applies only where the view collects named `input`/`select`/`textarea` fields. Page buttons and outputs follow the membership rule they had before #6375. #6375's case is unchanged: a widget's generated field control is still no field. Verification: - `test_a_page_draws_the_actions_of_a_playground_without_controls` fails on main (the CI run above) and passes on this branch. - `pnpm run test:runtime` passes (1020), including the generated range and select fixture #6375 added to `tests/runtime/playground-view.test.mjs`. - `test_page_fixture_renders` (`--run-nightly`) for `motion-playground`, `alert-thresholds`, `data-explorer` and `playground` passes, so motion-playground still posts nothing at rest. - 13 field, submit, output, reset and page tests in `tests/browser/widgets/test_playgrounds.py` pass. Refs #3985 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
Since #6231, a playground reads every named
input,selectandtextareainside it as a field, inside the one<form>it draws around its rail and preview. A widget in the preview that draws named controls of its own then has them read as the page's fields. On motion-playground,lf-motion's transport draws<input name="time">and<select name="speed">. The playground took both as fields and postedtune {time: 0, speed: "1", timing: …}while nobody touched the page. That event is the at-rest write the nightly render gate reports onmotion-playground:data-lf-user-overrideandchildListonlf-playground#panel-motion, and arequestFramethat ran twice. The403from/api/eventin #6297's local teardown is the same post.The fix is one more condition in the playground's field membership (
playground-view.js). A control inside an element markeddata-lf-genwithin the playground is no field.offer,offerElementandgeneratedElementwrite that mark on everything a widget generates, andpassages.jsreads it as "not authored". The view's header already said that an inspection setting in a form of its own is no field. A widget's generated controls now count the same way, without each widget having to dropnameor wrap its controls in a form. The playground's own wrappers carry no such mark, so the page's fields are unaffected. A control a page script creates without the mark is still a field.Verification
tests/runtime/playground-view.test.mjsadds a generated range and select to its fixture. It fails before this change and passes after it.pnpm run test:runtimepasses (1012).test_page_fixture_renders[motion-playground](--run-nightly, Linux) fails on main with the at-rest findings and passes with this change. A request listener on the served page records no/api/eventpost at rest after the change, where main posted thetuneabove.test_page_fixture_renders[playground|alert-thresholds|data-explorer]and five field tests intests/browser/widgets/test_playgrounds.pystill pass.This leaves part of #6297. The focus-ring finding on motion-playground (
test_each_sampled_focus_ring_is_shown_whole_in_its_surface) still fails with this change and has a separate cause, recorded on the issue. The code-comparison and notification-playground layout fixes are in #6373.Refs #6297 — automated triage