Skip to content

Give view selection, native observation and clipping one owner - #4852

Merged
max-sixty merged 7 commits into
mainfrom
codex/lit-render-ownership
Oct 31, 2026
Merged

max-sixty merged 7 commits into
mainfrom
codex/lit-render-ownership

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

View membership was evaluated by both Python and the browser, parser-time content observers kept running after the runtime took ownership, and margin annotations used a clipping walk that disagreed with native hit testing. Give each of these rules one owner: the browser evaluates selectors, runtime arrival observation replaces the startup observer, and margins consume the shared clipping geometry. A visible button that escapes an intermediate clip now retains its comment control.

The render checks also share layout-shift collection while preserving their separate observation windows and retaining anonymous sources in the single startup summary; passive advice names only locatable sources. Every direct child of a trace comparison must now contain a recording; shared introductory text belongs outside. This lets the browser hide later recordings during parsing. At widths where the prose and note fit exactly, the note now stands beside its passage instead of wrapping. Shared geometry now follows rendered ancestry through slots and shadow trees, so all geometry consumers use the same clipping rules.

This is an ownership consolidation, not a large line-count reduction. Tests account for most added lines. Generic selectors can still change membership while parsing; authored-state capture and revision continuity remain necessary.

Validation: browser bundle build and full pnpm check (713 runtime, 29 build and 88 Worker tests); focused browser checks for initial trace selection, sidebar placement and an annotation whose target escapes clipping. Prior focused cases cover observation windows, reconnects, scrollers, slots and sticky headers. Independent Opus review approved the consolidation after removing unlocatable passive advice and duplicate sidebar coverage.

This was written by Codex on behalf of max-sixty

Let the browser evaluate view membership, end parser-time native observation when the runtime watcher starts, and share layout-shift collection without merging evidence windows. Keep native authored defaults and CSS first-paint placement. Trace comparisons now require each substantive child to contain a recording.
Remove the margin ancestor walk and use the canonical clipping reader up to each stable seating boundary. This keeps positioned and slotted targets commentable while preserving viewport, sticky-cover and scroller policies. Cover the complete escaped-target comment interaction; make the sticky-strip check scroll by the actual pin and the strip height rather than its pre-scroll position.
# Conflicts:
#	browser/layouts.css
#	dist/kernel/kernel.json
#	dist/kernel/runtime/bundle-comment-placement.js
#	packages/playwright/widgets/lf-trace-compare.js
@max-sixty
max-sixty merged commit 20ac359 into main Oct 31, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/lit-render-ownership branch October 31, 2026 21:21
leaf-agent added a commit that referenced this pull request Nov 1, 2026
Four browser tests closed borrowed pages before fixture teardown could
read their health. Remove those closes and the cleanup-only try/finally
blocks, leaving the browser fixture to read health, cancel routes and
close contexts. All behavioral assertions remain.

The ownership audit fails on the original four closes and passes after
this change. The focused selection reports five passes (ownership, first
replay, observation windows and both delayed-shift cases). Ruff and
Python compilation pass. The native-layout case still fails because its
exhibit shrinks from 189.25px to 187.96875px; the same failure
reproduces on current main at `769a84cf1`, and is owned by #4985.

This preserves the native layout and rendering lifecycle introduced in
#4724 and the observation-window coverage in #4852; only teardown
ownership changes.

Closes #4926 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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