Repository navigation
fix: read lf-options' members and shadow-root controls in the link preview and render gate - #7538
Conversation
…eview and render gate #7417 moved lf-options' controls into shadow roots. The link preview read a group's members through its declared root and found only a wrapper, so it no longer listed the options or marked the chosen one. It now reads the widget's own children. The render gate's clippedControls queried only the light DOM, so a clipped option mark showed up as clipped-content. It now collects offers from every open root and climbs the drawn tree. The aim sweep's AIM_POINT now follows open shadow roots, as AIM_CURSOR does, so it reaches the Add field and the option marks again. Closes #7527
|
@leaf-agent In
|
… checks a widget's control closestAcross finds a closed details outside a widget's shadow root, but the summary's contains() is false for the widget's shadow descendants, so clippedControls skipped a visibly clipped offer drawn there. It now asks renderedUnder. A browser test places a clipped shadow-root offer in a closed details' summary, which is reported, and one in its body, which is not.
|
Done in 0e9ba1d. The closed-details test in |
…ith repeat instead of keyed (#7541) #7420 drew the floating panel's stage with Lit's `keyed`, keyed by the opening, so each opening gets a fresh view node. When the key changes, `keyed` resets the part's committed value to a sentinel before the new value commits (`lit-html` 3.3's `directives/keyed.js`, also on Lit's `main`). So the old template instance never leaves the part's set of disconnectable children, and the `ref(declareView)` on that view keeps the whole closed view alive. Every view the panel drew stayed in memory. Opening and closing the versions menu kept about 61 nodes and one listener per round trip, which the closed-surfaces journey of `test_page_fixture_renders` reported on 50 corpus pages. The stage now draws a one-item `repeat` keyed by the opening, the primitive it used before #7420. `repeat` disposes the old item's part. Each opening still draws its view in a node of its own, so nothing the user sees changes. A comment at the site says why `keyed` isn't used there. **Verification** - `test_page_fixture_renders[alert-thresholds]` fails at the base with `the versions menu leaks nodes: [5302, 5363, 5424, 5485]` and passes here. `[feature-gallery]` passes too. - `[alert-review]` loses the leak finding but still fails on a resize finding that bisects to #7417. #7538 doesn't fix that one, so I filed it as #7540. - In an isolated probe on `alert-review`, six versions-menu round trips held 6613 → 7240 nodes at the base, and stay at 6878 here after the first trip. - `pnpm run test:runtime` (1237 pass), pre-commit, and 25 focused panel, Go-to and On tests pass. <details><summary>How the retainer was found</summary> I diffed two heap snapshots, taken around one round trip once the test harness had drained its own input records. Every old `.lf-fp-view[data-lf-route="versions"]` was retained by the panel's root part: `_$committedValue` → stage `ChildPart._$disconnectableChildren` (a `Set` that grows by one template instance per opening) → the instance's `ElementPart` → the view `<div>`. Other `keyed` sites in the tree (`records/thread/messages.js`, On's regrouping in `floating-panel.js`, `lf-diff`, the Playwright timeline) leak the same way only where a `ref` or another async directive sits under the key, and only when their key changes, which is far rarer than a panel view change. I left them alone. </details> Closes #7526 — automated triage Co-authored-by: leaf-agent <[email protected]>
#7417 moved
lf-options' controls into shadow roots. Two readers still walked only the light DOM, and one test read the old shape. Three scheduled journeys have failed since. Each fails onmainat6313a6f59and passes on this branch. #7417's design stays as it is.Regressions fixed
test_a_link_into_the_page_previews_where_it_points, Chromium and Firefox).membersPartinannotations/place-preview.tsread the group's members through the page reading, which now enters the group's declared root. That root holds a singledisplay: contentswrapper, so the preview found fewer than two like members. It then read the group as plain content, with no option marked chosen. A widget's members are its own children: the elements its answer names, whether it draws them in place or through a slot. The preview now reads those children.test_the_render_gate_reads_a_page_that_scrolls_sideways_only_between_viewports).clippedControls(render-checks/reachability.js) querieddocumentfor[data-lf-offer]and climbed byparentElement. It therefore missed every option mark, and an option row clipped by a fixed-height card showed up only asclipped-content. The check, whichpage check --renderruns on agent pages, now collects offers from every open root (openRoots) and climbs the tree as it is drawn (renderedParent). It also reads a closed disclosure's summary as drawn (renderedUnder), so a clipped offer a widget draws in the summary's shadow root is reported, as a new browser test checks. The test expectsclipped-controlagain. The 13 shipped examples that hold an option group raise no newclipped-controlfinding.A test reading the old shape
test_an_aimed_press_does_only_what_the_outline_promised[ship-review]reached itsexisting markpath by aiming at the group's Add field. That field now sits in the group's shadow root.AIM_POINTaskeddocument.elementFromPoint, which answers the shadow host, so it skipped the field and every option mark. It now follows open shadow roots, asAIM_CURSORbeside it already did. With that change, ⌥-clicking the Add field again promises the marked group and comments on it.Other checks
tests/browser/controls/test_previews.py,tests/browser/test_render_aim.py,test_trace_render_gate_restores_the_zoomed_time_windowandtest_a_shipped_log_replays_its_example_statepass.test_page_fixture_renderson the 13 option examples fails only on test_page_fixture_renders: the versions menu leaks nodes and listeners on 50 corpus pages since #7420 #7526's versions-menu leak (closed surfaces), as it does onmain.pnpm run checkandpnpm run test:runtimepass.Closes #7527 — automated triage