Repository navigation
Patch inside a tab set's members instead of rebuilding the page, and stop an idle corpus repainting - #1279
Merged
Conversation
An in-place revision treats every upgraded widget as atomic: its module owns everything under it, so any change to its markup evicts it and re-inserts the new one. The corpus, and any page written as tabs, sits inside one lf-tabs, so a one-sentence edit rebuilt the whole page. On the corpus that was a 2.1 s insertBefore that reconnected every widget, rebuilt five lf-specimen iframes, re-collected the margin once per reconnecting widget, and fetched the revision document a second time after the install. A new registry key, `x-patch: members`, says a widget's module builds its controls beside its members, leaves them where the author wrote them, and reads only their attributes. lf-tabs declares it. The patch then reaches inside such a widget while the two revisions agree on its shell: its own attributes and each member's tag and attributes, in order. A change to the shell (a tab added, a label renamed) still rebuilds it. The schema allows the key only on an upgraded members container, and `$keys`, docs/registry.html and the packages.md table describe it. Measured with bench_page_latency's corpus revision transition: requests 33 -> 10 and bytes 2.18 MB -> 686 KB, and presented in 1.3 s against 3.0 s in the same probe (timings on a loaded machine). New test: a sentence edited in one tab keeps the tab set, the open tab and the question in the other tab; a revision adding a tab rebuilds the strip. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
lf-sort-film started playing when it had client rects, which it still has inside a tab hidden with `until-found`. On the corpus it played behind the Triage tab at frame rate, and each step's `parts.update()` announced a layout change that made anchor-controls repaint the whole thread presentation and re-read the page: about 6 full passes a second on an idle tab, which is the input delay the corpus comment and move timings carried. `checkVisibility()` answers false under a content-visibility: hidden ancestor, so the film now waits for a tab the user opens. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ails name Each thread presentation pass asked addressableSays for every margin target's words, and each call walked the target's text asking every text node where it stands; on the corpus that was about 200 ms of a comment's pass. `elementReading` keeps that answer for a page element exactly as long as the page reading, since the one watcher already says when either moved; chrome and detached nodes are read afresh. The watcher also counted the thread panel rewriting `name` on its <details> rows as a change to the page's words. `name` is watched for slot assignment, which only a <slot> does, so it now counts only there. A corpus comment re-read the page 3 times instead of 6. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 27, 2026
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.
The corpus page missed the in-tab responsiveness objectives in
notes/user-feedback-responsiveness.md: a new revision took ~2.8 s to swap in (1 s objective), and a comment ~220 ms and a board move 111–155 ms to paint (100 ms). Profiling each transition found three causes, none specific to the corpus.A revision rebuilt the whole page. The in-place patch treats every upgraded widget as atomic, and the corpus (like any page written as tabs) sits inside one
lf-tabs. So a one-sentence edit evicted the tab set and re-inserted the page: one 2.1 sinsertBeforethat reconnected every widget, rebuilt fivelf-specimeniframes, and re-collected the margin once per reconnecting widget. It also fetched the revision document a second time after the install. A new registry key,x-patch: members, whichlf-tabsdeclares, says the module builds its controls beside its members and reads only their attributes. The patch now reaches inside such a widget while the revision keeps its shell: its own attributes and each member's tag and attributes, in order. A shell change (a tab added or relabeled) still rebuilds it.An idle corpus repainted the thread layer about 6 times a second. The example
lf-sort-filmauto-played inside a tab hidden withuntil-found, which still has client rects. Each step announced a layout change, and that re-ran the whole thread presentation and re-read the page. This was the input delay behind the comment and move timings. The film now plays only whencheckVisibility()says it is shown.Each thread pass re-read margin targets' words.
addressableSayswalked every margin target's text on every pass, about 200 ms of a corpus comment.elementReadinginpassages.jsnow keeps that answer exactly as long as the page reading, under the same mutation watcher. The watcher also counted the thread panel rewritingnameon its<details>rows as a change to the page's words.namematters only on a<slot>, so it counts only there. A corpus comment now re-reads the page 3 times instead of 6.Measured with the #14 benchmark's transitions on one corpus page:
The machine's load average was 30–70 throughout, so read the times as direction, not values. The requests and bytes are exact.
Left alone: triage-board's revision is served at 163 KB against 3.8 KB stored. 142 KB of that is the runtime stylesheets every delivered document inlines (
delivery_sheets), sent uncompressed by the local server. Production compresses it to about 11 KB.🤖 Generated with Claude Code