Repository navigation
Consolidate generated UI into retained Lit render trees - #4393
Merged
Merged
Conversation
Unify panel and composer rendering, retain one initial/live widget drawing, and remove parallel DOM caches. Narrow composer subscriptions and make motion playback observable so framework updates do not fan out across unrelated controls. Generate composer action controls and update the package-facing API at protocol 29.
leaf-agent
previously approved these changes
Oct 27, 2026
leaf-agent
approved these changes
Oct 27, 2026
This was referenced Oct 27, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 27, 2026
The Another option badge test required Add's empty marker to change while the input event was still bubbling. #4393 moved composer controls into retained Lit trees with microtask updates, so that observation became stale even though Add is ready before the next frame and reachable by the next Tab. Observe the first frame after input and explicitly require Tab to focus Add, retaining the existing badge placement checks. This preserves the rendering consolidation and the keyboard behavior without changing product code or appearance. Validation: the original test fails on current main at the input-event assertion; the revised test passes, including the new focus assertion. The adjacent badge coverage also passes. Closes #4434 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 27, 2026
A refused optimistic comment removes its thread before the floating panel reconciles its route. The retained composer introduced in #4393 can read that stale route during its own update and pass a null thread to `replyAvailable`, interrupting refusal recovery. The field reader and panel template now require a current thread before reading reply availability. This preserves the retained renderer and native editor ownership intended by #4393. The visible behavior remains the existing refusal recovery: the rejected thread closes, the user's words return to their editor, and focus follows the existing intent rules. No layout, styling, or timing changes are introduced. Validation: the detached-comment test reproduces the reported exception before this fix. The same focused selection passes afterward: 24 browser cases, including all seven cases in the report and adjacent refusal/application-boundary transitions. The browser build and all 682 runtime tests pass. Existing regression tests provide coverage without adding another copy. A served command-hub startup comparison against the base keeps 45 code requests through widget upgrade and first server-state presentation, with 115 additional code bytes; both arms report no console errors or layout shifts. The document/code combined increase is 206 bytes. Timing was diagnostic only. Closes #4422 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 27, 2026
A refused comment removes its temporary thread before the retained reply field finishes repainting. The shared `fieldReading` still classified that missing subject as “Reply”, allowing the turn lead added in #4510 to call `threadAttention` without a thread. The field reader now returns an empty reading while its subject is absent, so both the hint and its lead stop describing a reply until the panel retires the route. This preserves the retained composition renderer and native editor ownership from #4393. The rejected thread still disappears and the user's words, placement and focus return through the existing refusal recovery. No layout or styling changes are introduced. Both reported browser regressions reproduce the null dereference on the base and pass with the fix. Validation also passes 10 adjacent refusal cases, four panel cases covering status, reply/walk labels and sending, the browser build, and all 684 runtime tests. Existing tests cover the transition without another reproduction test. A served command-hub startup comparison against the base keeps 45 code requests through widget upgrade and first server-state presentation, adding 158 code bytes. Both arms show no console errors or layout shifts. The added branch belongs in the shared field reading rather than a second null guard in the attention reader; it states whether the retained field still has a subject. Closes #4522 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Oct 28, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 28, 2026
) The retained composition renderer in #4393 inserted `leaf-composition-field` between the reply row and its editor. The diff's direct-child selectors still used the old structure, so every empty reply showed a full editor instead of the compact Reply face chosen in #4323. Update those selectors to follow the retained renderer, including the conditions that keep attachments and nonempty drafts open. Empty, unfocused diff replies now show one compact line without a frame or microphone. Focused replies and nonempty drafts keep the expanded editor. The existing regression failed on the base with a 40px field and visible Dictate control; it passes with the repair, and now also checks that leaving a nonempty draft preserves its expanded face and words. The adjacent pinned-header Tab check passes; all 695 runtime tests pass. Compared and inspected the `diff-file-reply` and `diff-file-reply-dark-touch` catalogue stills against the base: the empty second reply becomes compact while the first conversation's active draft retains its editor. Reproduce with `uv run leaf-dev stills 809f092 --state diff-file-reply --state diff-file-reply-dark-touch`. Closes #4433 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 28, 2026
) The DOM-write watch now credits the menu's remove-and-restore measurement of its line limits, while continuing to reject direct repeated assignments. Reopening during the closing fade retains the status nodes; `holdMenu` removes the previous opening's limits, measures the fresh text, and reapplies them. Equal dimensions therefore produce a necessary round trip that the watch previously rejected. This preserves #4393's retained menu controls and scroll position. That change removed the previous teardown on reopening, exposing the watch's assumption that an attribute returning to its original value did no useful work. The correction is confined to the held marker and line-limit-only styles passing through removal; it does not exempt arbitrary writes on these nodes. No product rendering changes. Validation: the new sensor regression fails before the correction and passes afterward, with controls proving direct restatements still report errors. Nine focused browser checks pass: both sensor cases, all six cases in the report, and the open-menu news stability case. Before the correction, five of the six reported cases reproduced the teardown diagnostic on current main; all six test bodies passed. The earlier CI artifact from run 40470206147 records all six cases passing before #4393. Closes #4435 — 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.
Move generated UI ownership into retained Lit trees and remove the parallel caches, state copies and render roots that had accumulated around them. Native editors, selection, media playback, capture loading and semantic presentation still keep their existing owners.
wireInput; its public contract now takessendClassand exposessync.button. All callers and the package reference are updated, with protocol 32 marking the changed public API.Validation after integration:
pnpm run checkpasses (29 build tests, 681 runtime tests and 85 Worker tests), lint passes, and 23 focused browser cases cover drafts/carets, attachments, rewrites, panel transitions and screenshot inspection. Two additional motion journeys pass. After integrating source stylesheet delivery, six focused cases rechecked first-paint retention, the full comment/reply journey, status animation and draft/caret continuity. Four focused cases passed again after adopting main’s consolidated boot function. A status-animation test now samples known animation phases after base/candidate probes demonstrated that its previous 400 ms sample could hit two identical phases on both versions.Independent Opus review found and rechecked two performance fixes: composer focus/hint/error subscriptions are scoped to the affected field, and motion playback state updates command controls through a signal. Its follow-up found no remaining actionable issue. Native screenshot popover expanded state and light-dismiss keyboard cleanup were verified in the browser.
A fresh independent live review after integration found no actionable issues: drafts and mid-text carets survive search and folding, keyboard comment/reply sends complete, and Send/Dictate hover/focus presentation is correct in light and dark. Microphone recording and alternate-submit behavior were outside that live pass.
Base/candidate startup comparison against main at
5c6ce8f5cretains 39 code requests for the screenshot example. Combined document/code bytes before first server-state presentation increase by 7,535 bytes: retained initial rendering moves 37,818 bytes into the document while removing 30,283 bytes from requested code. No console errors or layout shifts were observed.The authored source and documentation shrink by 74 lines; regression tests add 380 lines and generated bundles add 152. This removes ownership duplication rather than every native lifecycle boundary: editor sessions, authored DOM reconciliation and capture races remain necessary owners.