Repository navigation
Ask one question of whether the user sees a box, and land only what it says isn't shown - #5361
Merged
Merged
Conversation
…t says isn't shown Leaf answered "is this in front of the user?" several ways: declared window chrome for the floating panel's row, occluders for a view open above it with stacking levels and a largest-uncovered-rectangle search, a covered share for travel, and local readings in travel (`readableDestination`), the read state and off-flow surfaces. Now the floating panel declares the one box it covers (geometry.js, `declareCover`), and `seenRect` is the one answer: what of a box no scroller clips and that box doesn't cover, cut along the scroll axis, keeping the larger part above or below it. A box in the top layer or inside the panel is never covered. `shownWindow`, key badges, Go-to's chips and paint drawn above the chrome read the same box. Every nearest landing now asks one question first, `alreadyShown`: Tab arrivals, entering a reply, travel (`m`, `t`, links) and the walks. A box is shown where a nearest landing would move nothing: the user sees it out to its margins (a focused control's ring room around the box wearing its ring), and a box longer than its room fills the room. A key pressed while the page still glides reads the box where the glide will leave it too, as `readableDestination` did. `scrollIntoView` is the one landing; `scrollIntoReadingBand` is gone, and `sideways: false` keeps a landing off scrollLeft. Only a reply row growing under keystrokes skips the question and keeps its foot in the band (`keepInBand`), as before. Removed: `declareWindowChrome`, `windowChromeBoxes`, `inWindowChrome`, `declareOccluder`, `coveredShare`, `underOccluder`, `clipsPastSurfaces`, `rightCover`, `restingBox` and the occlusion pass in the clip walk; `readableDestination`; `scrollIntoReadingBand`, from the package API too. What the user sees change: - A paragraph partly beside an open panel view reads as unseen until the view closes: the panel's box takes its whole band, so it isn't marked read, travel lands it, and the keys treat a focused control there as scrolled away. - A view open above the panel's row now also narrows the room comment boxes, the margin and Go-to's chips keep to, as the row did alone before. - Tab onto a box taller than its room that shows only in part now brings in as much of it as fits, as the walks and travel already did; a thread too tall to show, returned to or landed as a whole, still stays where any of it shows. - A control beside the panel within its reach stays put on arrival, where travel used to scroll it above the reach. Kept as before: a box taller than the window that is partly in view still scrolls to show as much of it as fits; `g z` and a diff file's landing move only up and down, and `g z` aligns in the item's own reading region without moving the page around it. Tests rewritten: - `test_an_open_view_covers_the_page_beneath_it` now asserts a paragraph partly beside the open view reads as unseen, and whole once the view closes. - `test_a_box_is_already_shown_whole_where_it_fits_and_in_part_where_it_cannot` becomes `test_a_box_is_already_shown_where_a_nearest_landing_would_move_nothing`: a tall box with 30px in view is no longer shown, and a nearest landing brings its opening to the band's top, after which it is. `test_a_key_onto_a_control_at_a_scrollers_edge_shows_its_ring` failed in Firefox on the prototype by 2^-16 px: measured with the ring's room, a joined option group's row never fit its log, so the radio landed flush and the row stood a float's rounding past the log's foot. The fit is now the ring box's own and the ring's room is the focused control's margin, so the row lands 10px clear; "already shown" compares edges at layout precision so a flush box isn't landed again.
…answers to "seen" An independent review of the previous commit found three regressions and three places that still answered "is this in front of the user?" their own way. - The room a landing has was the overlap of every scroller's landing band where it stands now, so a 250px box whole in a 300px pane whose foot was below the window read as longer than its room, counted as shown, and stayed cut off. The room is now each band's size (`roomOf`): what a landing could give the box. A box longer than its room is shown once what the user sees of it spans the room. Each box a landing moves now reveals what the boxes inside it will show of the destination, so the page brings up the pane a tall item fills rather than aiming at the item's far end. - The walk to the boxes that scroll a destination started at its parent, so a landing on a fixed element, as a Tab's arrival on one below the window makes, scrolled the page while the element stood still. A fixed element now has no box to scroll. - The panel gave way to a Tab's arrival by raw overlap with its open view, so arriving in a native popover above the view closed it, though `seenRect` counted the popover whole. It now asks the cover's own rule (geometry.js, `covered`), which leaves the top layer and the panel's own contents uncovered, and gives way only where the view is the part that covers. - The panel's declared cover read the card's layout box, which stands transparent at its rest while box-motion.js carries the panel's surface from where it stood. It now reads the drawn outline (`following.outline()`), so what reads as covered follows the panel the user sees as it opens and closes. - Page search marked a match's lines by its own split into the largest piece clear of the chrome. It now reads what the user sees of each line as `seenRect` does (geometry.js, `inFront`), so a match in the band an open view covers is out of sight there, its part beside the view included. Where a key chip may stand keeps its own geometry, a different question, and key-badge-placement.js says so. - lf-trace landed a Moment's picture when its top or foot crossed the window's edge. It now asks `alreadyShown`, which the widget API exports, so a picture a pane clips or the panel covers lands too. - module-scroll-and-motion.md said `block` applied in every box that scrolls a target; it applies in the target's own reading region, and the boxes inside and around it reveal it nearest. What the user sees change, beyond the previous commit's list: - A Moment's picture cut off by a pane or under the floating panel now comes into view. - A page search match in the band an open panel view covers is not marked there, as the rest of Leaf already counts it unseen. New tests, each failing on the previous commit and passing here: - `test_a_box_whole_in_a_pane_below_the_window_is_not_yet_shown` - `test_a_landing_on_a_fixed_box_moves_nothing_around_it` - `test_a_tab_into_a_popover_over_an_open_view_leaves_the_view_open`
… to land A second review found three regressions in the previous two commits, and they clustered in the landing mechanics the prototype had rewritten: how far each scroller moves, through nested panes and containing blocks. The cutover asked for one decision feeding the landing, not a new landing engine, so landing-scroll.js is main's again (the reading-band moves, the inner walk, `landedBox`, `landingRoom` and its `until`) with only these changes: - `alreadyShown` is the one decision every nearest landing asks first, including a Tab's arrival, which no longer has a reading of its own (`ringShown`). It reads `seenRect`, so the panel's cover counts; a destination the user is on or inside is measured out to its ring's room, as `ringShown` measured a Tab's arrival, and any other by its own box, as main's `alreadyShown` did; its edges compare at layout precision; a motion under way must leave it seen too, as `readableDestination` did; and a box taller than its room is shown where main's own reading-band moves would bring no more of it in, so (a) holds by main's arithmetic rather than a second one. - `scrollIntoView` takes `sideways: false`, which zeroes the inner walk's sideways reveal, for `g z` and a diff file's landing, and `scrollIntoReadingBand` is internal; `keepInBand` is that landing for the one caller that skips the question. - A fixed box ends the walk to the boxes that scroll a destination only where it is fixed in the window (geometry.js, `fixedInWindow`); one a transformed ancestor holds rides that ancestor's scrolls. Main stopped at every fixed box, so a fixed button inside a `transform` was never brought into view; this goes beyond main there. And one in the panel: whether its view stands over an arrival is read where its box comes to rest (`declareCover`'s `rest`, which `covered` reads), not where its motion has drawn it so far, which `seenRect` still reads. A Tab's arrival at a stop the view is still opening over puts the view away, as main's resting-box share did. Behavior against the previous commit: a tall item two panes deep lands its opening in the page's band again (it stood 50px above the window), and a stop under a view still opening puts the view away again. Against main, a fixed box a transformed box holds is now brought into view. New tests, each failing on b370b05 and passing here: - `test_align_current_tall_block_in_a_pane_in_a_pane_lands_its_opening` - `test_a_landing_brings_in_a_fixed_box_a_transformed_box_holds` (fails on main too) - `test_an_arrival_the_opening_view_will_cover_puts_it_away`
# Conflicts: # browser/leaf.js # browser/runtime/queue-walk.js
…d move The third review found that "already shown" read a box taller than its room from the net of the reading-band moves. A 300px box 100px down a 250px pane standing 100px above the band shows 150px of itself; main's landing scrolls the pane 100px down and the page 100px up, so the box stands where it stood with 250px of it in sight. The moves summed to nothing, so the box counted as shown and nothing moved. Two readings were short: the net, and the reading band alone, since the pane is no reading region and main's walk before the region (now `innerMoves`, shared with `scrollIntoView`) is the one that scrolls it. `landsStill` asks each of those moves, read where the destination stands now, which holds while every move before it is none. `fixedInWindow`'s comment now says what a null offset parent does and doesn't establish, citing CSSOM View: a fixed `display: contents` ancestor and a fixed `body` under a transformed root read as fixed in the window and are not handled. New test, failing on 0063ef5 and passing here: `test_a_box_longer_than_its_pane_is_not_shown_while_its_pane_could_show_more`.
leaf-agent
approved these changes
Nov 4, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 4, 2026
#5361 made the panel declare one box it covers, its row and any view open above it, and `shownWindow` takes every declared cover from the room it reads. `motionBand` reads that room for a node to decide whether its growth would be seen, and for a node inside the panel's own view the room came out empty, since the view covered itself. So news in the open thread never counted as moving what the user reads, and the panel stopped holding it: on main, `test_held_news_reads_whole_among_the_thread_s_controls`, `test_on_a_phone_held_news_gives_way_before_close` and `test_threads_grow_in_place_and_hold_news_until_asked` fail, and on this branch so does `test_news_in_an_open_thread_moves_none_of_its_controls`. `coverBoxes` already leaves a surface's own box out for a node it holds; `shownWindow` now takes the node it reads for (`item`) and passes it on, and `motionBand` gives it. All four tests pass.
This was referenced Nov 4, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 4, 2026
…rd does (#5390) The margin card drew a thread with `ThreadView`, and the floating panel built its own from three parts the primary reader lent it (the transcript, the held-news notice and the reply box), with its own quote, ✓, to-dos and rewrite wiring around them. The two copies had drifted: the panel's ✓ lacked the card's "Resolved by <agent>" label and its key command. Now both surfaces hand the whole thread to `ThreadView` and say where its parts stand through one contract: the panel stands the notice and ✓ on its head line and the reply box in its field, and the card stands them on its row of presses. `ThreadView` no longer asks which surface it is on. Each surface keeps its own placement, the edge it holds still, its scroller, its navigation and Close. ## What the user sees change, all in the panel - A thread the agent resolved names the agent on ✓ ("✓ Resolved by Codex · Reopen"), and ✓ declares `thread.resolve` and `thread.reopen`, so Enter on it runs the command, as a card's does. - An agent's Resolve that arrives while the user reads the thread waits behind "1 new", as in a card: ✓, the notice and the field's words change together when the user shows the news. Before, ✓ and the field flipped at once beside a notice still saying "1 new". Pressing ✓ while it waits shows the news and sends nothing. - Fixed: Resolve on a thread opened from Threads went back to Threads, where the user chose that it moves on to the next open thread, whenever the thread's record had been replaced since the panel drew it, as after `t` then Enter on ✓ or after the user's own reply. The thread is found by key now; `test_resolve_opens_the_next_thread_as_tall_as_it_holds` gives its threads replies and fails on main. - Fixed, from #5361: the panel's open view counted as covering the thread it shows, so the panel stopped holding news at all. `shownWindow` now takes the node it reads for and leaves out the cover of the surface holding it, as `coverBoxes` already did. On main, `test_held_news_reads_whole_among_the_thread_s_controls`, `test_on_a_phone_held_news_gives_way_before_close` and `test_threads_grow_in_place_and_hold_news_until_asked` fail; here they pass. ## Package API `parts.transcript` and `parts.news` are gone; only the panel used them. `parts.thread` takes optional `{head, reply, quote, landing, drawn}`, documented in `module-annotations.md`, "Owning the primary conversation presentation". Every place a nomination names is checked and slotted as its outlet is, so a place outside the widget refuses the update and a place in its shadow tree takes its part through slots. The primary reader forwards only those options, so the card's own (`CardOutlets`) never reach a package's thread. A package's whole thread with `quote: true` draws the quote as the panel does; its rules moved from the chrome's scope to `surfaces.css`. ## Where to look - `browser/runtime/thread/thread-card.js`: `ThreadOutlets`, `CardOutlets` and `ViewOutlets`; the boxes a thread draws apart; `#settle`, whose landing and reader each container states; `#createReply`, which hands the reply's words `{resolved, attention}` of the thread as drawn; `#drawQuote`. - `browser/runtime/thread/primary-reader.js`: one path for every place a nomination names (`placesOf`), placing each part before drawing it. - `browser/runtime/floating-panel.js`: the panel's outlets and landings; its quote, ✓, to-dos and settlement wiring are deleted. - `browser/runtime/annotation-overlay/thread-preview.js` and `thread/inline.js`: the card's and the seat's outlets. - `browser/runtime/geometry.js`: the cover fix above. ## Size 49 files, +1229 −893. Runtime JS is about +28 lines of code and +116 of comments: `floating-panel.js` −81, `thread-card.js` +227. What this buys is one owner for each part of a thread, not fewer lines. ## Checks - Firefox stills of 45 card, seat and panel states show 0 px change; Chromium's `retained-quote` and `retained-quote-full` are unchanged. An independent review of each commit's code and the held-Resolve captures found nothing left to fix. - `pnpm run check:browser` and `pnpm run test:runtime` pass, as do the focused browser tests for panel threads, held news, Resolve, Reopen, Undo, quotes, seats and package threads. - `test_a_resolve_s_notice_stands_for_that_resolve_alone` now expects the notice's Undo to take back a Resolve the agent picked up at once, the rule #5320 set; main never reaches that step, since it stops at the Resolve bug fixed here. - Inherited, failing on main too: `tests/browser/test_render_outbox.py::test_z_takes_back_the_thread_the_user_just_resolved` (main's push runs, #3985), `tests/journeys/test_render_anchors.py::test_a_data_bound_diff_aims_and_selects_one_source_line` (a comment's anchor now carries `prefix` and `suffix`; it fails at that assertion on main, before the lines this branch changes) and `tests/browser/drafts/test_reply_sessions.py` `[margin-accepted]`. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 4, 2026
… already drawn on screen (#5392) News in a thread now follows the convention chat and document apps share: it draws at once in the thread you're in, waits behind "N new" in a thread on screen you're not in, and draws at once above and below the window, where the browser's scroll anchoring keeps what you read still. This is the second step of the cutover to one way of knowing what's on screen, after #5361. ## What changes for the user - **In the thread you're in** (focus in it, its reply box included, or your send still in flight), the agent's news draws at once: a new turn, a step, an edit. The control you're on stays still: what stands above it scrolls up by the growth, as a chat does, and what stands below it moves. Where the page can't scroll by all of the growth, as on a page shorter than its window or a short tab at the page's foot, the control moves by the rest. Before, the answer waited behind "1 new" until you went to it. - **A resolution or reopening the agent makes in the thread you're in** still waits behind "1 new", as before, since showing it would move the thread between the open ones and the Resolved disclosure, out from under you. A reading that brings an answer and a resolution together waits whole. - **A press into a thread holding news**, such as into its reply box, shows the news with the pressed control held still. Before, a press showed nothing. - **A thread the agent starts** in a seat on screen, or on a bare diff line, draws at once and moves what follows it. Before, it waited behind a notice. - **A reply that reopens a resolved thread** draws at once and moves what follows. Before, it waited behind a count in the Resolved summary. A thread on screen you're not in still holds behind "N new". The margin's card, the floating panel's thread view and the Threads list keep their own rules. ## How `inline.js` owns the in-thread rule, since it owns `holdBox`: `holdBox` holds the thread's reply box when focus is on the thread itself, and a message when focus is on it. The seat passes the hold over a change in the thread you're in unless it carries a settlement. Deleted: `HeldArrivals` with its `surfaces.js` wiring, the margin marker as a notice, `HeldNews`'s hold of new threads, the Resolved summary's count, `setSettlesAt`, the notice's reopened state and `NewsNotice.total`. `held-news.js` goes from 1,128 to 844 lines. ## Tests Deleted, with the behavior each guarded, now dropped: - `test_a_reopening_in_a_page_seat_waits_in_its_resolved_summary`: an agent's reply reopening a resolved seat thread waited behind the Resolved summary's count. - `test_a_reopening_in_a_folded_diff_thread_waits_in_its_summary`: the same in a diff outlet's Resolved disclosure. - `test_a_reopening_waits_where_the_reopened_thread_would_stand`: a reopening waited while the place it would land in the seat was on screen. - `test_a_thread_the_agent_starts_in_a_page_seat_waits_in_the_row_it_would_follow`: a new seat thread waited in the previous thread's row or the first-message row. - `test_a_thread_the_agent_starts_on_a_bare_diff_line_waits_at_its_margin_marker`: a new thread at a datum with no seat waited at its margin marker. - `test_a_walk_to_a_thread_a_diff_line_holds_lands_in_its_outlet`: a walk to such a held thread showed it in its outlet. - The helpers only those used: `_seat_comment`, `_agent_turn`, `_to_upper_third`, `ROUTE_LINE`. Rewritten: - `test_an_agent_turn_arriving_holds_still_the_page_box_being_typed_in`: guarded the turn waiting behind "1 new" with the box still; now the turn draws and the box stays, with a Firefox case. - `test_a_reply_held_in_a_diff_thread_is_read_once_the_keyboard_opens_it`, now `test_a_reply_in_a_diff_thread_draws_where_the_user_is_and_waits_elsewhere`: guarded a reply waiting in the thread the user had just written in, and a press into its box leaving it waiting; now that reply draws with the box still, and a second one, after the user leaves the thread, waits and shows by its notice or `t`, read once shown. - `test_replies_held_in_a_page_seat_show_when_the_user_turns_to_them[onto]`: guarded "`t` onto the thread already stood on is a stay, and the replies wait"; now a user standing on the thread sees them at once. Firefox cases for "opened" and "onto". - `test_a_new_step_waits_where_its_words_would_move_the_draft`, now `test_a_new_step_shows_at_once_in_the_thread_being_written_in`: guarded a progress step waiting where it would move the draft; now the step draws at once, and on a page that scrolls the draft stays (shift-watched), while on a short page it moves down by the step. - `test_held_news_says_one_count_of_all_it_holds`: the user reads beside the thread rather than drafting in it, since news no longer waits in their own thread. - The `hub-seat-held-news` stills state reads beside the thread rather than drafting in it. - `test_progress_the_user_spoke_after_keeps_its_steps_and_its_place`: a rewrite of a step the user spoke after waited behind the thread's notice ("1 message edited") while they stood on its toggle. Now the rewrite draws at once, the steps stay shown or hidden as the user left them, the toggle stays where it stood, and the user's message moves by the run's growth alone, less what the page scrolled away above the toggle. Its shift watch goes, since that move is the rule's result; the positions are asserted instead. - `test_opening_a_rewrite_keeps_room_the_thread_holds`: an edit shortening a message above the reply box the user had clicked into waited behind "1 new" until they pressed it. Now it draws at once; the room the thread holds, and a rewrite opened in it, still move nothing. - `test_a_summary_folds_its_messages_where_they_stand`: an edit retracting a summary waited behind the notice while the user stood on the summary's toggle. Now it draws at once, and the frame the summary moved still keeps the document it loaded. New: `test_an_agent_resolving_the_thread_the_user_is_on_waits_behind_its_notice`, the agent resolving the seat thread the user stands on with no draft: the thread stays open and focused with "1 new", and pressing the notice shows the resolution. ## Size Runtime code −439 lines net (+200 −639), tests −574 (+223 −797), CSS −9. ## Measured On command-hub's `#goal-parser` thread at 1440×900, in Chromium and Firefox: | Case | main | this branch | |---|---|---| | Reply box focused | answer waits behind "1 new" | answer drawn; box moves 0px | | Reading below the thread | waits; read line moves 0px | waits; read line moves 0px | | Thread above the window | drawn; read line moves 0px | drawn; read line moves 0px | > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 5, 2026
…lds (#5397) Four renders took the reader's place away from the browser's scroll anchoring: they replaced the node anchoring held, or turned anchoring off where the reader reads. This fixes each at its render. `main`'s place keeper (`placeKeeper`) and the seat's hold (`holdBox`) are unchanged, and none of the fixes fights them. This is the first part of the places step of the cutover to one way of knowing what's on screen, after #5361 and #5392; the one hold that replaces those two (#5396) follows, once a generated test of every case lands. Pixels are `origin/main` → this branch, measured with `leaf-dev probe` in Chromium and Firefox alike unless named. ## Message words keep their nodes through an edit A message's words reconcile through `setRenderedChildren` (`thread/messages.js`, `keptWords`), the matching a revision uses, instead of a Lit `.innerHTML` binding. An edit keeps every node it leaves alone and rewrites a changed paragraph's words in place. Neither engine anchors again on a node that replaces its anchor, so the old binding lost the place on every edit. - Reply box focused and scrolled away, an edit from another tab grows the first paragraph of a message above the window: the second paragraph being read moved 126px → 0. - With that first paragraph on screen it still moves 126px: anchoring holds the paragraph that grows, and the growth is inside it. Only a hold fixes that case. - The seat's own holds are unchanged: reply box with an answer arriving above it 0 → 0, Send focused as a reply appends 0 → 0. A margin card's focused message under an edit stays at 378px, as on `main`. The matching (`dom-children.js`) diffs each list of siblings, and a diff costs the list's length times the edits between them, so an edit that changed every paragraph of a message would cost the square of its length. A new rule of the matching, `diffWork`, bounds that, and the caller chooses it: message words call `setRenderedChildren(…, {bounded: true})`, and a list whose diff would cost more than 2^18 is replaced, as `.innerHTML` replaced it. Every other caller keeps `main`'s exact matching, unbounded: authored revisions, whose nodes carry the user's state (two fallbacks tried for them each gave the read paragraph's node away in some revision `main` handles), and the Markdown file preview, which already reconciled through `setRenderedChildren`. Completing a Markdown reference definition turns a reference in every paragraph into a link: | Paragraphs | 250 | 500 | 1,000 | 2,000 | |---|---|---|---|---| | Chromium, `main` (`.innerHTML`) | 0.7ms | 1.2ms | 2.3ms | 8.8ms | | Chromium, this branch | 4.1ms | 5.7ms | 9.4ms | 19.5ms | | Firefox, `main` | 5ms | 11ms | 24ms | 57ms | | Firefox, this branch | 10ms | 15ms | 32ms | 78ms | Without the bound, Firefox took 959ms at 2,000 paragraphs. A selection in a paragraph survives an edit elsewhere in the message, where `main` drops it. ## A revision edits inside a pane `lf-pane` declares `x-patch: members`, so a revision edits inside a pane rather than replacing it whole; the module reads only which child is which. A revision adding five paragraphs above a pane's window moved its reader 0 → 0 with `main`'s landmark restore, and now the pane and its body stay the nodes the reader had. For the user, a wheel in a pane while a revision lands there is no longer cut short by the replacement. ## A sidebar track keeps its own anchoring A sidebar page's track body no longer sets `overflow-anchor: none` on its own scroller. The aside before the body keeps that property (#5383), which keeps the page's anchoring off the track. A block growing 200px above the line read in the track moved it 200px → 0. A revision adding a verdict above it stays 0 → 0 with no frame out of place, so the landmark restore and anchoring don't fight. ## The dial's glide no longer drags Firefox's anchoring The dial's gliding blocks carry `overflow-anchor: none` in their keyframes, so a block is no scroll anchor while it glides. Firefox anchors on where a box is drawn, so anchoring on a gliding block scrolled the page by its glide. With motion on, Skim then Read on the detail example: | | Chromium | Firefox | |---|---|---| | `main` | −0.2, −0.2px | 360.7, 347.9px | | this branch | −0.2, −0.2px | −0.3, −0.1px | The paragraph wrapped in an `em` lands at −0.3 and −0.1px in Firefox too. One sequence gets worse in Chromium. After a turn has glided, and before any scroll, growth above the reading line, such as an image loading, moves the paragraph read by the growth: 200px in the reviewer's probe, 0 on `main`. While the blocks glide Chromium anchors on something other than them, and keeps that anchor after the glide until the next scroll. Firefox moves in that sequence on `main` too. The trade is that rare move in Chromium for the 360px Firefox move on every dial turn with motion on; the stale anchor is the next fix. ## Tests Each new browser test fails with its fix undone. - New: `test_an_edit_above_the_paragraph_read_keeps_it_where_anchoring_holds_it` (both engines), `test_growth_above_the_window_moves_nothing_read_in_a_sidebar_track` (both engines), `test_a_turn_that_glides_keeps_the_place_in_every_engine` (both engines; Firefox's case fails without the keyframes), a runtime test that `setRenderedChildren` keeps the nodes an edit leaves, and one that a bounded rendered list of 2,000 paragraphs, every one rewritten, is replaced (without the bound it fails, after 4.7s). - Rewritten: `test_revision_restoration_yields_to_input_while_a_diagram_loads[patch-wheel]` read the pane's offset mid-glide and expected it back, which held only while a revision replaced the pane. With the pane patched in place the wheel carries on past that offset, as the user's wheel should. The test now waits for the wheel to settle and checks that what it brought into view stays where it stood; without `x-patch`, the 220px wheel never takes the pane past 300px and the test times out. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
pushed a commit
that referenced
this pull request
Nov 5, 2026
…place of placeKeeper and the seat's hold (#5396) One Leaf hold now keeps the user's place where the browser's scroll anchoring can't, replacing `placeKeeper` and the seat's `holdBox`. This is the places step of the cutover to one way of knowing what's on screen, after #5361, #5392 and the anchoring fixes in #5397. It passes every case of the hold-still matrix (#5398) that `main` passes, in Chromium and Firefox, and six that fail on `main`. ## The one hold Scroll anchoring keeps the reader's place through re-renders and revisions since #5397, but it holds the first box on screen, so it can't keep three places still: a control under the user's hands below growth on screen, the reading line when growth starts between anchoring's box and the line, and a place the change hides. `user-place.js` holds those once, after the change has drawn: - `holdPlace(node, standIn)` reads where `node` (an element, or a range over words) stands and returns the step that scrolls it, or what `standIn(node)` names once the change hid or removed it, back there. - `holdUserPlace()` takes it around a reading from outside the tab, where `state-application.js` applies the reading, and keeps it once the page shows it, whichever surfaces the reading redraws. Page Map takes it around a widget's own contribution joining with no reading behind it. A gesture's own result is never held; its handler places it. - The place is, in order: a field the user types in; then the control under a resting pointer (only a control a press acts on, `PRESSES`, and nothing once a mouse has left the window) or the focused control, whichever input came last; then, if focus is scrolled away, the words at the reading line (`readingAt`, a range over the letter a quarter of the way down the window). A thread the user sent from stands at its reply box (`standsAt`). - The keep puts back the first of these the change moved. A place the change left still keeps its scroller, so a later place in it moves nothing. It yields to what the user did since the reading: a scroll they or a landing chose, one still under way, a press, or a key anywhere but in the field it holds, so typing into that field leaves the place kept. - The dial holds the block it folds, with the gist standing in for it. Page Map's sheet is a reading region while it stands, so its list is the scroller that keeps its row. The press-in-place correction in `floating-panel.js` uses `holdPlace` for its arithmetic. The revision landmark restore (`version.js`) stays as on `main`, and a revision takes no hold, since the two undid each other by up to 82px. ## Measured The matrix, `tests/journeys/test_page_holds_still.py`, 50 cells × 2 engines: `main` passes 80 and fails 20; this branch passes 86 and 14 stay expected failures. The six it fixes, both engines: | Cell | `main` | this branch | |---|---|---| | Reading × edit growing the paragraph read | 84px | 0 | | Reading × edit shrinking a message above | −42px | 0 | | Diff gutter Comment × deletions above | 100px | 0 | A new seat thread drawn above the place moves it by the thread on `main` (153px, which the matrix allows); here it stays at 0. The cases independent reviews found that a fixture can reach are new matrix cells, each holding still on `main` and here: typing then a pointer parked on a margin pin, on page background, or on a message's words; reading line 40 of an 80-line message whose start the agent grows or shrinks by five lines; and a disclosure the user opens while `lf-diff` still waits on a syntax grammar. Words between line breaks inside a widget's open shadow tree hold still too, checked with a probe, since no bundled widget draws them. ## Behavior changed - A re-render that replaces the very element the reader reads can move them by what grew above their line in it (the user's choice, 4 November). No keyed re-render hands the place to a node drawn under the same identity. - A presenter that paints a reading's change frames after it arrives, as `lf-diff` does while it waits on a syntax grammar, shows the move until the keep runs, and typing in that window ends the hold, since the caret keeping itself in view is a chosen scroll (+75px after a letter, +86px after an arrow key, measured with a presenter held back). The hold's header records the limit. - Two rarer paths move the reader where `main` holds them, left without a rule of their own: growth above the reading line inside a closed shadow tree, where the hold can only name the host (±150px measured; the only bundled closed root is the text field's), and a press inside a child frame while a presentation is pending, which the page's input watch can't see (140px). - In Firefox, an answer arriving during a smooth scroll or a wheel's glide is yielded to, so the scroll finishes and the place moves by the answer, where on `main` the hold's write stops the scroll short. In the matrix's smooth scroll × reply above, the reply box ends −105px along the scroll's −300 (the 195px answer pushed it back), against −40px on `main`; the revision cell fails on both, by an amount that varies run to run. Both stay expected failures. Playwright's Firefox wheel fires no `scrollend`, so an answer straight after it counts as mid-scroll too; the matrix waits that out. - `widget-api.js` exports `holdPlace` and `readingAt` in place of `placeKeeper`; `lf-dial` is the bundled consumer, and `module-scroll-and-motion.md` describes them. `headerInset` is no longer exported, and `offFlowSurfaceOf` is deleted. ## Tests - **Deleted:** `placeKeeper`'s runtime tests in `user-place.test.mjs`, which guarded its candidate order, clamp correction, nested keepers on one scroller, the identity hand-off, the band-top rule and its anchoring claim. - **Rewritten:** `test_an_edit_above_the_paragraph_read_keeps_it_where_anchoring_holds_it` is now `..._holds_it_with_the_reply_box_scrolled_away`, which needs the reading line. - **New:** `test_a_thread_joining_page_map_above_the_row_the_user_is_on_leaves_it_still` (focus and resting-pointer aims); runtime tests for each rule of the hold (growth anchoring left, a hidden node's stand-in, the first moved place, a still place keeping its scroller, yielding to a scroll under way, to a press and to a key at a control while typing into the held field keeps it, a typed field before a resting pointer that names only a control, a mouse leaving the window, until-found folds); the matrix cells above, with the six fixed cells' expected-failure marks removed. Each rule's test fails with the rule undone. ## Size Runtime −141 lines net (+360 −501), `lf-dial.js` −20, tests +164, docs +28. > _This was written by Claude Code on behalf of max-sixty_
This was referenced Nov 5, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 5, 2026
…ow the window (#5496) Since #5361, a diff file's Comment opens a floating comment box, not its inline box at the end of the file, whenever the file's end is below the window. #5361 replaced `seatFab`'s question "does a panel stand over this seat?" (`underOccluder`) with "does the user see this seat?" (`seenRect`). Its intent was one way to answer "is this in front of the user", and its list of visible changes doesn't include comment boxes. `seenRect` also cuts at the window's top and bottom, so a seat that is only scrolled out of view now counts as unseen too. In `pr-walkthrough`, once `]` opens a file's hunk, that file's thread outlet sits at y≈914 in a 900px window. The inline seat is refused and the box opens floating. That is the failure `test_each_sampled_focus_ring_is_shown_whole_in_its_surface` reports (`#pr-exact-patch .lf-diff-file-comment did not open an inline response`). `seatFab` now refuses a seat only where the chrome covers it (`covered`, the same cover rule `seenRect` cuts with). A seat under the floating panel's room still sends the box to its home, as #5361 intended. A seat that is only scrolled away takes the box, and the field's focus scrolls it into view, which is what happened before #5361. One behavior moves further than a plain revert would: a seat the chrome covers *in part* is now refused too, where `seenRect` accepted any visible part. A box whose seat is half under the panel opens at its home rather than half hidden. Seats inside the panel itself are unaffected, since `coverBoxes` skips the cover that holds them. On screen, in the new `leaf-dev stills --state diff-file-comment` (pr-walkthrough's longest file opened beneath the window's top, then its Comment pressed, 1440×900): on main the box opens floating over the contents column, away from the file; with this change it opens in the file's thread at the file's end, scrolled into view under the file's pinned header. | main | this PR | | --- | --- | |  |  | Verification: - New `test_a_file_s_comment_opens_inline_where_the_file_ends_below_the_window` (`tests/browser/widgets/test_diffs.py`): an 80-line file in a 1200×700 window. On main, no inline composer opens. With the change, the inline composer opens, its field takes focus and is in the viewport. - Ran the ring journey restricted to `pr-walkthrough`. On main it fails with the reported assertion. With the change, every `pr-walkthrough` scope opens its surface with no ring faults. The only remaining failure is the check that other examples' scopes were reached, which the one-page restriction drops. - `pnpm run test:runtime` (816 pass) and `pnpm run check:framework` pass. Three `tests/browser/test_render_diff_controls.py` tests (`test_file_tree_lands_at_the_file_start_after_reading_down[document,pane]`, `test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place`) fail the same way on unmodified main `018fc2587`, so this change doesn't cause them. This fixes the failure the issue currently reports. The earlier scheduled runs' ring faults (`lf-ask.lf-projected-location` rings 5px past the window, runs 41816958231 and 41622727492, both before #5361) are a separate cause that #5432 bears on. So this PR refers to the issue and doesn't close it. Refs #5459 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 5, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 5, 2026
#5500) #5252 moved the margin layout's size watch on the body and the column out of `registerMarginRow` and into the layout pass, so that a first paint wouldn't read the column once per row. That also delayed the watch's first deliveries to a later pass, while the page was still settling. On `pr-walkthrough`, `notification-playground` and `thread-panel-gallery`, the layout pass those deliveries trigger then resizes boxes the observer loop has already delivered, and Chromium raises `ResizeObserver loop completed with undelivered notifications`, which fails `test_page_fixture_renders` at teardown. The first registered row now starts the watch with one column read, as it did before #5252. The layout pass still keeps the observed column current, so the rows after it read nothing, which keeps #5252's saving. Nothing changes on screen. **Verification.** `uv run pytest --run-nightly "tests/journeys/test_render_gate.py::test_page_fixture_renders[<page>]"` fails on main (`f8808301f`) for all three pages and passes with this change. `pnpm run test:runtime` passes, as do `check:browser` and the margin browser tests `test_rail.py` and `test_pins.py`. `test_entries.py::test_an_inline_contribution_name_needs_no_physical_margin` fails both with and without the change; #5473 tracks it. <details><summary>How the cause was found</summary> - `git bisect` over `19757c94c..8b759a5`, running the `notification-playground` case and marking only the ResizeObserver error as bad, lands on `7f857fd0f` (#5252). Its parent `aef8926c5` passes. - I logged each `sizeObserver` delivery up to the error. On `pr-walkthrough`, the last delivery before the error is the margin watch's first notification for the column (`MAIN.layout-sidebar`), which arrives after the page's other observers have already delivered several rounds. On `notification-playground` the watch hadn't delivered at all before the error. There the final write is the playground's `--playground-controls-height` in its own observer, and removing that write also clears the error. So the playground's write is one way a late-settling page trips the loop, not a separate cause. - Putting the watch's start back at registration clears the error on all three pages. `tests/browser/test_render_controls.py::test_sample_host_view_changes_leave_its_scroll_and_keyboard_position`, which the issue also names, has a different cause. It passes at `7f857fd0f`, bisects to `61afa3016` (#5361), and still fails with this change. #5486 tracks it. </details> Closes #5464 — automated triage Co-authored-by: leaf-agent <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Nov 5, 2026
…own controls wear their keys (#5551) Three of the seven tests #5486 tracks fail because #5361's single cover box for the floating panel is read wrongly in two places, and one of them also hides a test step #5392 made stale. This fixes those three; the other four have separate mechanisms that are still being diagnosed under #5486. - **`test_a_seat_send_at_the_window_foot_shows_the_thread_it_started[verdict]`.** `seenRect` kept the larger part of a box above or below the panel's cover, so the 14px strip between the panel card (842–886) and the window's foot (900) counted as seen. After a verdict seat's send, its reply box showed only that strip, so `returnToThread` skipped the landing and left the sent message under the panel. A cover now takes everything from itself to the window edge it stands nearer (`coverCut`). `shownWindow` already used that rule, and now `uncovered` (behind `seenRect`, `inFront` and paint cuts) uses it too. - **`test_required_page_failure_retains_composer_seat_focus_and_caret`.** `covered` read an empty box as covered, because nothing is left of a box with no height. The widget's empty seat `b` (720×0) was refused the comment editor, although nothing stood over it. `covered` now asks whether a cover cuts the box. The test's later step expected the thread that loses its seat to wait behind "1 new" in the rail. #5392 deliberately replaced that hold with drawing the thread at once, so the step now expects both threads drawn. - **`test_a_thread_obligations_done_press_keeps_its_keys_and_one_workflow`.** Key badge placement kept every chip off every cover. Since #5361 the panel's cover spans its open view, so the Done button inside the panel's own thread view lost its key face. A chip now keeps off only the covers over its own control (`coverBoxes(owner)`, which already leaves out a surface for what it holds). Chips for page controls still keep off the whole panel, as #5361 intended. What the user sees: a message sent from a seat at the window's foot lands clear of the panel, the comment editor takes an empty widget seat, and controls in the panel's thread view show their digits again. #5361's rule that what a panel view covers counts as unseen is unchanged. **Verification.** Each of the three fails on `main` and passes on this branch's head, rebased on `8bece180c`. `pnpm run test:runtime`, `check:browser` and `test:browser` pass. `test_go_to.py`, `test_key_surfaces.py`, `test_composing.py`, `test_reading_place.py` and `test_render_floating_panel.py` show no new failures. The four failures there also fail on unchanged `main`: three are in main's run 42074354782, and `test_sending_flashes_only_the_new_message[card]` fails the same way locally on `main`. <details><summary>The four #5486 tests this leaves</summary> These still fail with this change, each with its original message: - `test_render_aim.py::test_a_pointed_comment_keeps_the_rows_still_owed[thread]`: `t` now gates its start landing on `alreadyShown`, a nearest-landing question. A section taller than the window that fills it counts as shown, so `t` no longer lands the section's top. The old `readableDestination` asked whether the whole destination stood in the landing band. - `test_current_location.py::test_the_obligation_walk_keeps_its_place_when_a_version_lands` - `test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down` - `test_render_controls.py::test_sample_host_view_changes_leave_its_scroll_and_keyboard_position` (ResizeObserver error at teardown, still present after #5544) </details> Refs #5486 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Nov 5, 2026
Travel and the walks land a destination at its start or centre, but since #5361 they decided whether to land by asking `alreadyShown`, which asks whether a *nearest* landing would move nothing. A nearest landing moves nothing for a box taller than the window that already fills it. So `t` to a thread on a long section the user is reading inside, and a diff file chosen in its tree after reading down, stopped bringing in the destination's opening. Before #5361, `readableDestination` always landed a tall destination's opening. #5361's description lists no such change, and two tests that protect it went red. `alreadyShown` now takes the `block` of the landing that follows. A box taller than its room counts as shown only where that landing would move nothing. Travel's start and centre gates, its departure plan, the queue walk and the change walk pass their block. Every nearest caller (Tab arrivals, entering a reply, returning to a thread, `scrollIntoView`'s own nearest check) keeps today's answer. For a box that fits its room, the block changes nothing. This fixes three of the seven tests #5486 tracks. Each fails on `main` (`19e31482b`) and passes here: - `test_render_aim.py::test_a_pointed_comment_keeps_the_rows_still_owed[thread]`: `t` lands the thread's section at its top again. - `test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down[pane]` and `[document]`: choosing a file in the tree lands its first line again. - `test_current_location.py::test_the_obligation_walk_keeps_its_place_when_a_version_lands`: a test-only change. Its 400px window left the decision the user stands on taller than its room and under the floating panel. It passed before #5361 only because that hid the decision, so the version's restore didn't land it. Since #5468 a key lets go of a focused control the user can't see, so that setup tests something else. At 600px the decision fits and stays on screen with the earlier obligation's words above it, which is the case the test describes. It still tells the kept walk place from the viewport's reading, since a walk from the reading block would step to `t-baffles`, not `t-bath`. **Verification.** `pnpm run test:runtime` (819) and `check:browser` pass. The landing change also ran with `test_obligation_walk.py`, `test_threads.py`, `test_render_navigation.py`, `test_render_diff_controls.py`, `test_render_aim.py`, `test_current_location.py`, `test_reading_place.py`, `test_changes_in_place.py`, `test_seated_threads.py` and `test_go_to.py`. Every failure there also fails on unchanged `main`. #5551 fixes three of the other four tests, through the floating panel's cover. The last one, `test_sample_host_view_changes_leave_its_scroll_and_keyboard_position`, stays open on #5486. Refs #5486 — automated triage Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 14, 2026
`page check --render` now refuses a page with `under-panel` when a word stays under the floating panel's row however far the page scrolls. Leaf keeps the panel's room as body's bottom padding (`--lf-foot-room`), and a page could lose it with no check saying so: a reset that zeroes body's padding, a body held to the window's height that its content runs past, a `main` or `body` that scrolls itself, or a fixed bar at the window's foot. Until now the covered-words reading compared the page's words only with each other. No CSS keeps the room against all of those, since the page can end its content past any box Leaf pads, and an `!important` padding would override spacing the author set on body. So the gate reads the outcome. `paintedRuns` gives each run a second box, where it would stand with every scroller at its end, by lifting the run by the scroll each scroller above it has left, so the reading scrolls nothing. `coveredWords` reports a run whose end box overlaps a box the panel covers (`coverBoxes`, now exported through `check-api.js`). The examples' render suite now holds Leaf's own Layouts to the room too. What the diff doesn't show: words in a bar the page sticks to the window's foot go unreported, since the reading lifts that bar from where it sticks (the header says so). The commit was written on 2026-11-03 against `windowChromeBoxes`, which #5361 replaced. It now reads `coverBoxes()`, which the gate takes before it opens a thread, when the panel's box is its row, and runs beside the covered-words sweep #5769 added. Evidence: when written, it fired on none of 198 real pages the markup check accepts, the 45-page example corpus or the plain pages, agreeing with an independent reading that scrolls each scroller to its end, and it fired on each of seven hand-made pages that lose the room, at the desktop and phone windows. On this branch it fires on none of the 48 authored pages at 1280, 540 or 360px, and the full gate refuses a page that zeroes body's padding at every width from 360 to 1920px. Max asked for this during a stale-work sweep; a subagent had committed it locally and never opened a PR. Tests: `test_words_the_panel_covers_at_the_page_s_end_are_reported` (room kept, reset, `main` scrolls, `body` scrolls) and the covered-words and `paintedWords` neighbours pass, as do `pnpm run check:browser` and pre-commit. CI's `test` job fails one test, inherited from main: `test_every_skill_file_reads_in_one_command` finds `.claude/skills/developing-leaf/SKILL.md` at 30,189 bytes since #5820; this branch leaves that file alone, and #5967 shrinks it. > _This was written by Claude Code on behalf of max-sixty_
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 first step of the cutover to one way of knowing what's on screen. Leaf answered "is this in front of the user?" several ways: declared window chrome for the floating panel's row, occluders with stacking levels and a largest-uncovered-rectangle search, a covered share for travel, Search's own split of a match into the largest piece clear of the chrome, and local readings in travel, the read state, off-flow surfaces and
lf-trace. Now the floating panel declares the one box it covers (geometry.js,declareCover), where it is drawn and where it comes to rest, andseenRectis the one answer: the part of a box no scroller clips and that box doesn't cover. Whether the panel's view gives way to an arrival (covered) and Search's marks (inFront) read the same cover.Every nearest landing (Tab arrivals, entering a reply, travel with
m,tand links, the walks, andlf-trace's Moments) asks one question first,alreadyShown, which the widget API now exports. The landing mechanics aremain's:landing-scroll.jschanges only that decision (+201/−71). A box taller than its room is shown where none of the moves a nearest landing would make, each scroller's on its own, would bring more of it in.Runtime JS is 124 lines smaller (+542/−666 across browser, packages and one example); tests +268/−22, docs +35/−28.
What the user sees change
lf-tracecut off by a pane or under the panel now comes into view.mainnever scrolled to it.fixedInWindowreads a nulloffsetParent, which a fixeddisplay: contentsancestor also gives; that case isn't handled, as onmain.Kept as before: a tall box partly in view still scrolls to show as much as fits;
g zand a diff file's landing move only up and down; Tab arrivals measure out to the focus ring's room and other landings measure the box itself.Removed
declareWindowChrome,windowChromeBoxes,inWindowChrome,declareOccluder,coveredShare,underOccluder,clipsPastSurfaces,rightCover,restingBoxand the occlusion pass in the clip walk; Search's largest-piece split;readableDestination; Tab's ownringShown;scrollIntoReadingBandfrom the package API (internal now, behindkeepInBandfor a reply row growing under keystrokes).Review and tests
Three rounds of independent review (Codex) ran against
mainin Chromium and Firefox. Each regression they found has a test that fails without its fix:test_a_box_whole_in_a_pane_below_the_window_is_not_yet_showntest_a_landing_on_a_fixed_box_moves_nothing_around_ittest_a_tab_into_a_popover_over_an_open_view_leaves_the_view_opentest_align_current_tall_block_in_a_pane_in_a_pane_lands_its_openingtest_a_landing_brings_in_a_fixed_box_a_transformed_box_holds(fails onmaintoo)test_an_arrival_the_opening_view_will_cover_puts_it_awaytest_a_box_longer_than_its_pane_is_not_shown_while_its_pane_could_show_moreRewritten:
test_an_open_view_covers_the_page_beneath_itasserts the paragraph partly beside the view is unseen;test_a_box_is_already_shown_whole_where_it_fits_and_in_part_where_it_cannotbecomestest_a_box_is_already_shown_where_a_nearest_landing_would_move_nothing. 135 selected browser tests pass in Chromium and Firefox, withpnpm run checkand the runtime suite (777).