Repository navigation
Fail any write that changes nothing, and fix the writers it found - #1418
Merged
Merged
Conversation
…, fixtures The trace a margin entry casts paints once per frame from where the gesture ends, rather than clearing on a close and repainting when the returned focus names the same target in the same task. page-geometry's unused traceTarget, a second writer of the same box, is gone. The thread list writes every shown card's disclosure from its one choice and the cards drop the native `name`: naming a card beside an open one made the browser close it and the list open it again. A card the browser opens itself becomes the choice. A folded row's Draft mark repaints in the frame, so a send paints the row once from the message rather than once for the emptied box. Syntax highlighting skips a block whose tokens are still on their way, so a message rendered twice in a turn no longer writes the same spans twice. lf-toc restates no href when a destination's id changes; lf-targeting and the playground's copy control say only what changed. The MCP app reports its own size instead of the SDK's reading, which set the root's height to max-content and back on every resize; a complete-page payload decides the frame's visibility before writing it; an unchanged snapshot keeps its tree. A test now asserts the size report reaches the host. Test fixtures and probes that restated or took back a value now say only what changes: fixture widgets write through keeps, rebuilt nodes are marked as different, scrub positions and a sidebar reading run as separate tasks, the thread-filter fixture reuses its rows, and the thread test no longer asserts the removed `name` attribute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Each place the keyboard layer and the page chrome wrote and took back in one task now gets its final value once: - Shortcut bar trim: a row off the line keeps its width out of flow and unseen (chrome.css), so the trim works out which rows fit from the widths they have instead of showing every row and hiding the ones that wrap. - Bottom status: rises over a covering thread panel's foot by a stylesheet rule keyed on the panel's modal state; syncLayout states only the foot's height instead of resetting and re-lifting the status to measure it. - Key chips (Go-to hints, target-picker hints, Ask chips): measured at their anchor off where they stand (geometry.js boxAt) and written once, to whole pixels, which the inline style reads back exactly. - Ask binding-badge faces stay lent while their route stands; one that is not exposed is transparent rather than restored and lent again each pass. Exposure reads the whole hit-test stack, so it reads the same worn or withheld. - Version picker: aria-expanded has one writer; a comparison presents its pending base in one presentation rather than unlit then lit. - Status disclosure: aria-expanded through keeps. - Auxiliary surfaces: the covering boundary hands over from one surface to the next in one step, with one inert record for the boundary, and other surfaces stay out of the background their own slides own. - Slide: a skipped exit writes no leaving marks. - Notices: taking a notice down is drawn at the end of the turn, so a walk that hides one and an acknowledgement that shows the next write it once. - Banner controls: showBannerControls moves several contributions in one paint; touch controls use it. - Composer: the suggest mode renders after the bar stands on the anchor; a stored draft whose passage does not stand opens nothing. Tests that wrote and took back in one task now do it across tasks (the shot presses, the targeting arm/reset, the nested modals, the walk-position and spent-control probes, the pulse dot class), and the shortcut row probes skip rows off the line (visibility). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- A synchronous place hold (`around`) claims no anchoring: inside one task only reflow moves a scroller, so its correction pays for every movement since the reading and absorbs what the browser's anchoring did in a forced layout. Only a hold that spans tasks sets `overflow-anchor: none`, and a hold replacing another writes the style once. The card transcript and the Page Map sheet use `around`. - Margin contribution changes reach the projection once per task (microtask), so a publication updating several contributions or a widget moved between parents paints one state. A registration asked for a control or layout settles first. - `paintKeys` reflects once per task, so a render and the focus that lands after it do not paint the moment between them. A refused scope is reported and the rest still paint; the ambiguity test now reads the paint after a microtask and consumes the reported refusal. - A projected datum's target key is its projection and datum key: generated rows all indexed -1 among authored siblings, so two datums shared one margin host. The failed-surface test now expects one marker per datum. - Margin options open from the entries' reading and render once, already open. - Holds are decided whole, then written; a reaction lands the user once; a settled suggestion asks its margin after its fold; a reading region's cue leaves at the end of the task, so a moved host keeps it. - Tests: helpers stop restating a lent tabindex, the passage sweep unhides only page content, and the dense-margin fixture updates without forcing a render per contribution. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Sep 29, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
A pending syntax pass can overwrite newer code text during a live update; see the inline reproduction.
…s land The tokenizing guard left a second pass to the one in flight, which then wrote the text it had read before the await over a block rewritten meanwhile. The pass now re-tokenizes when the text or the language changed during the await. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 29, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 29, 2026
…ard without clearing it (#1419) Two load-only failures the write sensor from #1418 reported in full nightly sweeps, both fixed at the writer, and the sensor's visual-mark exemption removed. **Sub-pixel style writes.** The comment's visual mark was never placed twice. Its position was written from raw floats, and a length recombined from client coordinates and a fractional scroll offset (`documentPoint`) differs below layout precision from pass to pass on a box that has not moved. Chrome queues a style mutation for that, but serializes the length to six significant digits, so the attribute text reads unchanged. `keeps.js` now owns `atLayoutPrecision` (round to 1/64px) and `layoutPx` (its CSS text), with the rule in its header, scoped to style properties the browser re-serializes; custom properties keep their text verbatim and fall outside it. Every writer of a measured length to such a property uses them: the aim, trace and mark boxes (one `standOver` in `target-paint.js`), the floating boxes, drawings, the thread card's clip, the margin lanes' clip, the design-mode name, the page search's matches and the contents map's lens. A shaped paint rounds its size and clone offsets the same way, so a repaint of an unmoved shape finds the clones it holds equal. **Thread card cleared and re-placed.** Placing an open card afresh (a thread transition, or the card moving to another margin entry) went through the close path, which deletes `data-lf-plane`, the position and the opacity, and the next placement wrote them back. It now only forgets the previous placement (`forgetThreadPreviewPlacement`): it drops the hold and supersedes any placement in flight, and the card keeps its spot until the new one lands. Clearing is for closing (`unplaceThreadPreview`). That leaves "not yet placed" as one declared fact: `chrome.css` keeps a card without `data-lf-thread-placement` at opacity 0 and out of reach, in place of the inline opacity the close path used to write. Without it, a card opened while the positioning module was still loading stood fully drawn and pressable at the top left (`test_a_thread_card_is_unseen_until_its_first_placement_lands`). `floatingPlacement.position()` drops an answer a later placement superseded before it writes the plane or the way of standing, so a stale answer can no longer put the card back in the page plane at the newer placement's spot (`tests/runtime/floating-placement.test.mjs`). The contents map's face trial and the margin's withheld-row measure keep their exemptions in `tests/write_watch.js`: each chooses a state by applying it to the live element, and neither has a mutation-free measure (a `visibility: hidden` row still adds scrollable overflow). Full suite with `--run-nightly`: 3436 passed, 3 failed. Two pass in isolation; `test_substantial_options_stack_and_align_their_facts` fails the same way on a tree without this branch. None is a write finding. `npm run test:runtime`: 183 pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
While a CSS highlight holds a range (any page with a quoted comment), Chrome repaints the whole document on every DOM write, including a write that changes nothing. #1406 fixed the scroll path and #1409 checked the corpus scroll by scroll. This PR does two things. It fails any test whose page makes a write that changes nothing. It then fixes the writers that check found, mostly by giving each place one writer and writing only when the value changes.
The sensor
tests/write_watch.jsruns on every page thebrowserfixture opens, in the document and in every shadow root, from before the first byte parses. It judges writes one script at a time, meaning each MutationObserver delivery: the microtask checkpoint that ends a listener, a frame callback or a task. A place that ends the script with the value it started with is reported as a browser problem, whether the script restated the value or took it away and put it back. A child-list write counts when it puts back nodes equal to the ones it removed (isEqualNode). Judging per frame was measured and rejected, because it flags separate genuine inputs that land in one frame.The exemptions are few:
EXPECTEDlists writes made for a reason of their own: CodeMirror's mount, Web Awesome's attribute reflection and its shadow trees, thelf-tocface measure, Sortable's ghost class, and a visual-mark TODO.tabindexstop and the.lf-margin-clusterlf-withheldmeasure.aria-*reflection writes are ignored.lfUnwatched(fn)drops writes an instrument makes while it reads the page, which includes the render gate driver'scall.scroll_writesnow reads the same recorder (window.lfWrites).restless_writesbecamescroll_followers, which only fails a place written on every scroll step, because the sensor already catches the same-value case.The writer fixes
runtime/keeps.jsis a new runtime primitive.keeps,keepsHiddenandkeepsTextmoved there fromwidget-elements.js, and about 40 importers were cut over. It compares against what the node would read back, so a boolean or count compared raw no longer rewrites the attribute on every pass. Reflected setters (hidden,disabled,title,className,classList.add/remove) rewrite the attribute even at the same value. Code usestoggleAttribute/classList.toggle(name, force)orkeepsinstead.rendering.jsafterScript(callback)runs a paint once, at the end of the script that asked for it. It is used where a render and the focus that lands after it would otherwise paint the moment between them:paintKeys, margin contribution changes and update-focus landing,reach.js, notice takedown, and gallery controls.title, and the version picker, Ask banner face and approval face write onlydata-lf-key-title.setRuntimeRootAttribute, and root-state doors write only changes.decidePins/paintPins), so a pin is painted even when the tokens did not change.traceTargetis gone.widget-elements.jsreserve()measures a clone.lf-tocshifts rows through#fitRows/#fitLabels.user-place.jsgainsaround(mutate)for one synchronous mutation. It claims nooverflow-anchor, so the scroller's style is never written and taken back in one task. The card transcript and the Page Map sheet use it. Its constraint, thatmutatemoves no scroller itself, is stated in the module header.syntax.jswrites no spans for a block with nothing to color. A second pass leaves a block to the pass already in flight, and that pass colors the text the block holds when its tokens land.openfrom one choice.field-sizingfor the textarea.visual-reviewsets shot controls before the shot connects.Behaviour that moved
details[name]. Naming a card beside an open one made the browser close it, and then the list opened it again. The list now owns exclusivity; a card the browser opens itself, or anlf-reveal, becomes the choice.test_render_outboxinjects its optimistic fault at#sug-refilldata-lf-state, where the paint now writes.lfUnwatched.skills/leaf/assets/AGENTS.mdandtests/AGENTS.mdstate the rule (write only what changed, one writer per place,afterScript) and how a test handles an exemption.Testing
Full suite including nightly tests: 3433 passed, 4 failed.
test_substantial_options_stack_and_align_their_factsandtest_ask_action_binding_badges_use_the_available_card_action_seatsalso fail onmain.test_a_growing_comment_is_independent_of_page_controlsandtest_published_example_has_the_normal_leaf_layoutpass in isolation, so they are load flakes.npm run test:runtime(182 tests), eslint and pre-commit pass.🤖 Generated with Claude Code