Repository navigation
Thread panel follow-ups: no walk strip over a covering panel, Tab lands above Reply, reaction list as a popover - #1834
Conversation
…rip for it
Over a covering (narrow) thread panel, the bottom status's walk position
("Thread 2 of 2") stood over the list, so chrome-layout.js measured it and
shortened the list by a 65px strip across its whole width. The strip took
two lines from the thread being read to show what its open card and pinned
title already say.
The status now shows only transient feedback over a covering panel — a
notice, or Go to with nothing to reach — and that clears the visible reply
as notices already did. With nothing left to reserve, the list's foot is
its focus-ring room again, and `--lf-threads-foot`, `--lf-list-foot` and
the layout's bottom-chrome reading go.
Tests: the narrow walking case of the long-thread edges test, and the
covering-sheet test's walk, now assert the status is hidden and the list
keeps its height, where they asserted the strip.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Threads panel pins an open thread's reply row at the list's foot, over the turns that scroll under it, but nothing told the browser so: focus moved into view only out of the list's box, and the row is inside it, so Tab onto a reaction button there scrolled 3px and left it under the row. The turns now carry a bottom scroll margin, as they carry the title's height as a top one: the row's height plus its ring room and the landing's, so a landing stops above the row with its ring clear. The row grows with its draft, so the thread card reads its height with a size observer (`--lf-thread-reply-h`). The row itself takes no margin: the caret lives in it, and a cover the caret stands in (scroll-padding on the list) makes the browser scroll on every key. New test: Tab onto a reaction button placed under the row lands it above the row with its ring room and hit-testable, and typing in the pinned row mid-thread does not carry the list to the thread's end. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Opening a reply's reactions raised its whole message (z-index 4) so the list drew above the messages after it, and once that message scrolled under the pinned Reply row its words drew through the row: the row sets no stacking order, and nothing a row raised could stay below it. The list is now an auto popover in the top layer whose source is its trigger, so a press on the trigger is not a light dismiss, hung below the trigger by anchor positioning and flipped above where the window has no room below. It follows the message as the list scrolls and goes when the trigger leaves the list. Closed, it is still the strip's in-flow row of standing reactions; its open styling reads `:popover-open` alone, so a light dismiss leaves no frame where the closed list shows every choice in flow. Nothing in the thread is raised any more, so the Reply row takes the title's stacking order and covers every layer a row raises. The popover's platform return of focus to its opener counts as the layer's own (`returningFocus`, focus.js), so a thread re-render's hold still lands the user where they stood when a remote resolve takes the strip away. Behaviour that changes: an open list stands over the pinned Reply row when its message scrolls there, and over the title's lower edge for the last stretch before its trigger leaves the list; the long-thread edges test keeps its midline assertion with the new reason. A click outside or Escape closes the list by the platform's light dismiss. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The reaction popover remains open after its trigger scrolls out of the thread list. I opened the first reply’s reactions in a long thread and scrolled that reply offscreen: the palette still matched :popover-open, and reactArmed still kept the reaction scope active. position-visibility: anchors-visible changes its paint, but it does not dismiss the native layer. Tab, arrows, and digits therefore still target that offscreen reply instead of the thread the user is reading. Close the popover and disarm its reaction scope when the trigger leaves the list’s visible area.
The list is an auto popover in the top layer, and `position-visibility` only stopped painting it once its trigger scrolled away, so the reaction scope stayed armed and Tab, arrows and digits answered a reply the user had scrolled past. The list now closes when its trigger leaves view. `e` opens the latest reply of the thread the user stands in, which may be out of view, so it now brings that reply into view first. A nearest landing honours the target's bottom scroll margin as it did the top, so the reply lands above a long thread's pinned Reply row. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The new offscreen-dismissal path leaves a visible shift when the reaction list closes. The long-thread test passes its popover assertions, then the shift watcher reports reaction chips and the shortcut control moving 144px without input. CI hit this in all three viewports; I reproduced it with -n2. Removing only the new wheel step makes all three pass, while waiting for scrolling to settle after the wheel does not. The scroll-triggered close needs to leave the surrounding controls in place before this change is ready.
CI failed: the offscreen reaction dismissal moves controls during the long-thread wheel test.
The shift watch credited a portal's movement with its anchor's scroll only when the anchor's name was unique in its tree and the portal's insets were inline. A reply's reaction list names its trigger once per strip under `anchor-scope` and states its insets in shadow.css, so on Linux CI, past Chrome's recent-input window, the list following a wheeled message read as moving without input. The watch now resolves a name inside the `anchor-scope` that limits it, and reads direct anchor insets from the portal's own tree's rules as well as its inline style. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The stylesheet scan can reject valid anchored motion. In tests/shift_watch.js, declaredRules keeps the last matching rule's inset, but CSS may choose an earlier, more specific rule. I reproduced this with #field { top: calc(anchor(top) + 10px) } followed by .field { top: 50px }: Chrome followed the anchor, while the watcher set anchorY false and reported typing in textarea#field.field moved textarea#field.field when the anchor scrolled. That makes the stability gate fail on a page whose portal is behaving correctly. The inference needs the effective cascade, including specificity, layers and importance, or a declaration from the anchor's owner; source order alone cannot establish which inset applies.
The watch took the last matching rule's inset in sheet order, but the cascade can choose an earlier, more specific rule, so an anchored rule overridden by a static one could credit a portal's independent move. No API reports the cascade's choice, so a rule-declared inset now counts as anchored only when every declaration that could win it is a direct anchor inset: an important inline one alone, else the important rules, else the inline style, else every matching rule. The reaction list's closed-state reset drops `inset: auto`, which its static position ignores, so its open insets are the only ones stated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The stylesheet scan in declaredRules makes the comment composer too slow to type into. The PR test job timed out at Locator.type in nine test_render_send_placement cases. I reproduced document-target at this head (30-second timeout); the same test passes on current main in about 10 seconds. In the PR tree, restoring main's shift watcher or suppressing only declaredRules' stylesheet scan also makes it pass in about 10 seconds. The scan runs through the page's style rules during frame readings, so it needs a bounded way to find candidate inset declarations before this head can pass CI.
CI failed: the stylesheet rule scan makes comment typing time out in test_render_send_placement.
…-sheet index Scanning every stylesheet rule on every frame for each anchored box, even one a placer had positioned inline, slowed the watched page enough on Linux CI that typing into the comment box timed out. An inline inset is a placer's and stands as it did; a box without one reads only the rules that state an inset, gathered once per sheet. Typing under 4x CPU throttle took 12.9s, against 12.4s before the watch read rules at all and a timeout with the full scan. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The shift watcher can miss a real typing shift when a stylesheet !important inset overrides an inline anchor inset. The reproduction and suggested fix are inline.
…watch An author rule `top: 50px !important` beats an inline anchored inset, but the watch trusted the inline value, so a field held still by the rule and moved by its margin as its anchor scrolled was credited to the scroll. A box with an inline inset now reads the important rules that match it; only an important inline inset stands alone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…) arms for :has() The reply row's rules selected `:has(> .lf-thread-reply) > :not(…)`, a `:has()` before a target naming nothing, which Chrome restyles from the document root on every write. #1834's scroll-margin rule hid the same shape inside a top-level `:is()`, which the test never read. Both now key on `.lf-thread-content`, and the test reads each arm of a selector that is one `:is()`/`:where()`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…seen (#1880) The runtime's reading of what is on screen (`geometry.js`) took the sticky headers over a scroller's top out of its band (`headerInset`, `--lf-top`), but nothing at its foot. A long open thread in the Threads panel pins its reply row at the list's foot, so a turn under that row read as seen, and read acknowledgement (`thread/read.js`, which counts a message read once its whole extent has been shown) could count the part under the row. A box sticking at a scroller's foot now passes its height and offset to what it stands over as `--lf-bottom`, registered beside `--lf-top` in `theme.css`. `footerInset` reads it the way `headerInset` reads `--lf-top`, and `visibleBand` and the clip walk take that band out at the foot as they do at the top. The reply row is the one such footer; its `scroll-margin-bottom` (from #1834) now derives from the same value, so where a landing stops and what counts as seen agree. Since #1862 the clip walk's bands also feed target paint, so paint over thread content under the row is cut there too. Both of the row's rules key on `.lf-thread-content`. #1834 had keyed its scroll margin on `:is(… :has(> .lf-thread-reply) > :not(…), … *)`, a `:has()` before a target that names nothing, which Chrome restyles from the document root on every write. `test_no_has_rule_restyles_the_whole_document` missed it because it read only top-level compounds; it now reads each arm of a selector that is one `:is()`/`:where()`. Content in a card with no reply row now takes a ring's room of bottom scroll margin, which the list's own scroll padding already gives it. The long-thread edges test in `test_chrome_contracts.py` now asserts that a turn straddling the reply row's top reads as seen only down to the row; it fails without the change. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…1901) A decided suggestion could keep showing its retired words: the slot carried `data-lf-retired`, the `state.css` rule applied, and Chromium still computed `display: inline`. The style was stale. The operation that left it stale was a forced style read inside a hidden tab panel, made by `bounds.js` from a MutationObserver. ## Cause On every content change of a bounded block (`data-lf-bound`), `hold.sync` found the block's scroller by calling `getComputedStyle` on every box inside it (`scrollerOf`). The feature gallery's "Page & layout" tab holds bounded logs, and an inactive tab panel is `hidden="until-found"`, which is `content-visibility: hidden`. Each read forced Chromium to style that skipped subtree. A Chrome invalidation-tracking trace of a failing run shows the sequence: - a row is added to a log in the hidden panel, and `:has()` invalidation marks `#bg-gallery-tabs` for a subtree restyle and `main` for a local one; - in the same task, `declaresBound` reads style inside the panel, which forces a display-lock style update (1011 such reads in a failing run, against 1 in a passing one); - that update restyles neither `main` nor `#bg-gallery-tabs` and clears the dirty bits above them, so `#bg-gallery-tabs` stays dirty with nothing pointing at it; - every later write under it is never restyled, including the reject's `data-lf-retired` on `#bg-insert lf-new`. `#bg-gallery-tabs` is never resolved again for the rest of the run. The forced pass orphaning a dirty ancestor is a Chromium defect. I could not reduce it to a page without Leaf. ## Fix - `bounds.js`: `sync` asks `skipped(bounded)` first, as geometry.js's other readers of skipped content do. A skipped block keeps the scroller it had, or stands as its own, and renews its size observation. The first delivery after the block is drawn syncs again, so an `end` log that grew while hidden opens on its newest entry. - `reach.js`: `paintReadingReach` and `paintSidewaysReach` check `unpainted` themselves. Review found that a bounded block arriving in a hidden panel registered as a reading region and had its downward cue painted at once, reading `overflow-y` and scroll extents in skipped content from the same MutationObserver. ## Evidence - Issue journey (`test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood`), on macOS Chromium 153: at 0e52b1b it failed 25 of 32 copies, and 0 of 20 with the `bounds.js` change applied there. - Main stopped reproducing after #1880 removed a non-subject `:has()` rule (bisected over the 18 commits from 0e52b1b). That rule supplied the pending subtree invalidation. Adding a no-op rule of the same shape back to `chrome.css` (`.lf-zz-a:has(> .lf-zz-b) * {}`) fails 8 of 10 copies on main, and 0 of 20 with this change. - New test `test_logs_in_a_hidden_tab_open_on_their_newest_entries` grows one bounded log in a hidden tab, adds a second, and checks that neither has its style or scroll extents read while the tab is hidden, then that both open at their newest entry, twice. It fails without the `bounds.js` change, without the `reach.js` change, and without the renewed size observation. - The tests that exercise bounded blocks, reading regions, and reach cues (71 cases) pass, as does `npm run test:runtime`. `test_render_controls.py::test_each_sampled_focus_ring_is_shown_whole_in_its_surface` fails on current main without this change too. ## A more underlying fix? Unverified. Other runtime readers still force style or layout in hidden panels: `shownParts` for target paint (deliberate, per geometry.js's header), `readingPosture` in `recordRegions` and `scrollersSettled`, `margin-layout.js`'s `scrollFollows`, and `user-view.js`'s `seenRect`. With this change and the provoking `:has()` rule, the issue journey stopped failing (0 of 20), so none of them was seen to leave style stale. The run that would settle it is a journey that makes one of them read a hidden panel while an ancestor holds a pending `:has()` subtree invalidation. Its candidate fix is for those primitives to answer skipped content themselves (a last-seen scroller, an empty shown set) instead of each caller asking `skipped` first. History read: `notes/margin-stuck-style.md` (#1506, #1695, #1719), #1834 and #1880. Fixes #1868 > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Three follow-ups to #1797, the pinned title and Reply row of an open thread in the Threads panel.
No walk position over a covering panel. When the panel covers the page (a narrow window), the walk's position ("Thread 2 of 2") stood over the bottom of the list, so
chrome-layout.jsmeasured it and shortened the list by a 65px strip across its whole width. The status now shows only transient feedback over a covering panel, a notice or an empty Go to, which clears the Reply row as notices already did. The strip,--lf-threads-foot,--lf-list-footand the layout's reading of the bottom chrome are gone. Pressington the last thread now shows no "nowhere further" cue there; what to show instead is left open.Tab and jumps land above the pinned Reply row. The browser scrolls focus into view only when the target is outside the list's box, and the pinned row is inside it, so Tab onto a reaction button under the row scrolled 3px and left it there. The thread's messages now carry a bottom scroll margin of the row's height plus ring room, mirroring the title's
scroll-margin-top. The row grows with its draft, sothread-card.jsmeasures it (--lf-thread-reply-h). The row itself takes no margin, because the caret lives in it and a cover around the caret (scroll-padding on the list) makes the browser scroll on every key.The reaction list is a popover. Opening a reply's reactions raised its whole message (z-index 4), and once that message scrolled under the pinned Reply row its words drew through the row. The list is now an auto popover whose source is its trigger, anchored below it and flipped above near the window's foot. Nothing in a message is raised any more, so the Reply row takes the title's stacking order. The platform's return of focus to the opener counts as the layer's own (
returningFocusinfocus.js), so a thread re-render still lands the user where they stood when a remote resolve removes the strip. The list closes once its trigger is out of view (whenOffScreen), since its anchor only stops painting a top-layer list, which would otherwise keep Tab, arrows and digits on a reply scrolled away. Soe, which opens the latest reply of the thread the user stands in, first brings that reply into view, and a nearest landing (landing-scroll.js) now honours the target's bottom scroll margin as it already did the top, so the reply lands above the pinned Reply row rather than under it. Behaviour that changes: an open list floats over the Reply row, and can cover the title's bottom edge briefly before its trigger leaves the list; a click outside or Escape closes it by light dismiss.The shift watch (
tests/shift_watch.js) credited a portal's movement with its anchor's scroll only when the anchor's name was unique in its tree and the portal's insets were written inline. The reaction list's anchor name repeats on every reply underanchor-scope, and its insets live inshadow.css, so the list following a wheeled message read as moving without input once Chrome's recent-input window had lapsed (Linux CI). The watch now resolves a name inside theanchor-scopethat limits it, and reads direct anchor insets from the portal's own tree's rules as well as its inline style. No API reports which declaration the cascade chose, so an inset counts as anchored only when every declaration in the tier that can win it is a direct anchor inset: an important inline one alone, else the matching important rules, else the inline style, else every matching rule. Rules that disagree credit nothing. The rules that state an inset are gathered once per sheet, and a box with an inline inset reads only the important ones, so the per-frame cost stays near the old watch's (typing under 4x CPU throttle: 13.1s against 12.4s). The reaction list's closed-state reset no longer statesinset: auto, which a static box ignores, so its open insets stand alone.test_render_shift_watch.pycovers scoped names, rule-declared insets, an anchored rule overridden by a more specific static one, and an inline anchored inset overridden by an important rule, with the existing faults still caught.Tests: new Tab-landing and
e-reveal tests intest_chrome_contracts.py; the long-thread edges test and the covering-sheet test now assert that a walk takes no room.