Repository navigation
Give a playground control's generated label an lf- id, so a comment on its words names the control - #6043
Merged
Conversation
…n its words names the control #6040 named each playground control by the visible span beside it through `aria-labelledby`, and gave that span the id `<playground>-<name>-label`. `ADDRESSABLE` takes any id not starting `lf-`, so Alt-aiming at a control's label words targeted the generated span instead of the authored `lf-playground-control`, and a comment there would anchor to an id the author never wrote. The span's id now starts `lf-`, the prefix anchoring already leaves to generated elements, as toc-view's lent ids and lf-gloss's tips do. Behavior restored: a comment aimed at a playground control's label words names the control (`test_a_comment_names_the_playground_member_it_points_at`, which failed on main at 0144d46 and passes now). Refs #3985
This was referenced Nov 15, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 15, 2026
…der Playwright 1.65 (#6045) `test_playground_range_preserves_preview_focus_without_cancelling_native_drag[firefox_browser]` has crashed Firefox's content process since #6040. The cause is upstream. Playwright 1.65's role locator reads `element.ariaLabelledByElements` in its isolated world, and Firefox segfaults once the page's own world has read that property too ([microsoft/playwright#43967](microsoft/playwright#43967), [Mozilla bug 2090055](https://bugzilla.mozilla.org/show_bug.cgi?id=2090055)). Playwright has closed its issue as fixed by the next Firefox roll, but every released Playwright up to 1.65.2 still ships `firefox-1572`. #6040 named the playground's range by `aria-labelledby`, so two page-world reads now reach it: - **Leaf's preview.** `labelsOf` and `markupName` in `browser/runtime/preview.js` read `ariaLabelledByElements` when the pointer or focus lands on the control. They now resolve `aria-labelledby` by id in the control's tree, so a Leaf page never reads that property in the page's world. Leaf sets no labelling elements from script, so this finds the same elements and changes no behavior. #6040's preview rule still holds: `test_a_control_whose_words_stand_beside_it_previews_nothing` passes. - **The test's own `dispatch_event`.** On a role locator, `dispatch_event` resolves the accessible name in the page's world, and the surrounding actions resolve it again in Playwright's world. That crashes Firefox with no Leaf code involved. The test now dispatches `pointercancel` through an element handle, which doesn't resolve the name again. Before the change, the Firefox variant crashed in 3 of 3 runs on main. With only one of the two changes it still crashes. With both, it passes 3 of 3 locally, on main after #6043 as well. Both changes cite the upstream issue in a comment, so they can be dropped once Playwright ships the fixed Firefox. <details><summary>Reproduction and checks</summary> With no Leaf code, Playwright 1.65.0 and `firefox-1572` crash on `<span id="l">Max</span><input type="range" aria-labelledby="l">` when `page.evaluate("…ariaLabelledByElements")` and `get_by_role("slider", name="Max").count()` both run, in either order. Either one alone passes, and so does an id lookup followed by the role query. On a Leaf page, hovering the range and then calling `get_by_role(...).count()` crashed before the preview change and passes after it. `role.dispatch_event(...)` followed by `role.count()` crashes whether or not Leaf has read the property. Passed: the three variants of the reproducing test, all of `tests/browser/controls/test_previews.py`, and the playground tests that select labels, take focus or hold a range press (139 tests). `pnpm run check:browser`, `pnpm run test:runtime` (980 passed) and pre-commit on the changed files also passed. </details> Closes #6044 — automated triage Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 17, 2026
A playground's controls are now a native HTML form. The author writes ordinary fields inside `lf-playground`, in an `<aside>` that is the rail: a range or number input, a checkbox with `role="switch"`, a `<fieldset>` of radios, a `<select>`, color and text inputs, `<output for>` for a reading, and the page's own `<button type="submit">` (and `type="reset"`). Everything else in the playground is the preview. The child tags `lf-playground-control`, `-choice`, `-value` and `-preview` go, with `x-within` and keyed `x-refers`, which only the playground used; presets and the agent's task text (`lf-playground-output`, `-preset`, `-setting`) keep their tags, since HTML has no element for either. Leaf reads fields by `name` inside one generated `<form>` around the rail and preview, which scopes each playground's radio groups. `tune` and `choose` record exactly as before; the browser's own value checking replaces Leaf's range, step and colour checks, and numbers reach CSS bare (`calc(var(--playground-radius) * 1px)`). What changes for users: duplicate or unknown control names fail in the browser rather than in `page check`, so a playground posted in a thread message is unchecked; pressing a label's words operates its control, reversing #6040/#6043; `g` no longer reaches playground fields; a quoted playground shows its fields disabled rather than hiding them. Candidate cards draw from the page's own CSS, 20 to 40 lines per example. Max picked this ("score it on the 15 cases, then land it as built") on a survey of places Leaf puts its own layer between authors and HTML. Scored on the 15 playground eval cases against main, Opus 5.5 author and judge: head passed 14 of 15, and `motion-design`, its one failure (a claim about tap playback on the page's own script), passed 2 of 2 on a rerun; base passed 12 of 15, failing three cases whose rubrics are converted to the new markup. Tests: `pnpm run check`, `test:runtime`, the focused model tests, every playground browser test, and 16 other tests that use a playground. Source +501/−895, tests +441/−927. > _This was written by Claude Code on behalf of max-sixty_
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.
#6040 gave each playground control's visible label span the id
<playground>-<name>-label, so that the input could be named witharia-labelledby. Anchoring treats any id that doesn't start withlf-as an authored target (ADDRESSABLEinbrowser/runtime/anchor-resolution.js). So Alt-aiming at a control's label words targeted that generated span instead of the authoredlf-playground-control, and a comment there would anchor to an id the author never wrote. The span's id now starts withlf-, the prefix anchoring already leaves to generated ids, as toc-view's lent section ids and lf-gloss's tips use.aria-labelledbyfollows the new id, so #6040's preview behavior is unchanged.test_a_comment_names_the_playground_member_it_points_atfailed on main (CI run 43706688461 and locally atbadc6f30a, withassert 'word-playground-word-label' == 'word') and passes with this change. #6040's owntest_a_control_whose_words_stand_beside_it_previews_nothingand the playground and preview tests selected by-k "label or name or preview"(144 tests) pass too. The exception is the Firefox crash below.This doesn't address the second failure #6040 introduced in the same run:
test_playground_range_preserves_preview_focus_without_cancelling_native_drag[firefox_browser]crashes Firefox's content process (signal 11). A bisect over74008ae53..0144d467alands on #6040, and the crash stops when the range input goes back toaria-label. It is tracked separately.Refs #3985 — automated triage