Skip to content

Keep news from moving the bottom bar, the status chevron and the chrome's root - #1446

Merged
max-sixty merged 26 commits into
mainfrom
agent-aabb5a4e0b545e5fe
Sep 30, 2026
Merged

max-sixty merged 26 commits into
mainfrom
agent-aabb5a4e0b545e5fe

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

News no longer moves the banner's status chevron, the bottom status or the chrome's root, and the shortcut line no longer moves More as the page presents. I measured each move with PerformanceObserver({type: "layout-shift"}) and per-frame readings of the moved boxes. The lf-status-button, lf-bottom-status and lf-chrome patterns leave EXPECTED in tests/shift_watch.js. /lf-shortcut/ stays, for the reason given at the end.

  • The chrome's root. .lf-chrome is position: static and stands after main. Its padding-bottom was the document's room under the bottom bar, so any growth or shrinkage of the content above it moved the root, e.g. (0, 32) as an Ask grew at presentation and (0, -683) on a version change. That room is now the body's padding-bottom in theme.css, beside the banner's body::before, where the theme's own comment and skills/leaf/assets/AGENTS.md ("the render-blocking theme reserves the banner and bottom bar") already said it belonged. The root now takes no room. It has the same geometry, and leaf-dev stills shows no page difference in any of its 22 states. The bar's room is also there before the runtime mounts.
  • The status chevron. It trailed the status sentence, so every status the page wrote moved it, e.g. "Connecting…" at 129px becoming "Server offline — reconnecting; keep page open" at 346px. It now stands between the leaf and the sentence, which is the only difference the stills show. The sentence is the press's one changing part, and the press still grows rightward into its room.
  • The shortcut line before presentation. The line was drawn from the commands live before the page presented ("c comment on the page", "d / u page down / up"). Presentation then replaced that with "s comment on target", and More moved (-5, 0). No page key acts before presentation, since the bootstrap holds each press for the presented page. So renderShortcutBar draws nothing until pagePresented(), and presentPage's repaint draws the first true reading.
  • The bottom status. It is held at the bar's right end, so a new notice of a new width, such as "Saved — sent" giving way to "Updated to v4", moved its start edge (-5, 0) or (-39, 0). The Layout Instability API takes a box's start as its flow-relative inline start. The status now states that its start is the edge it stands by (direction: rtl), and each sentence keeps its own direction (unicode-bidi: plaintext). It looks the same as before.

Tests that moved focus, a selection or a modal by script now drive the page as a user does:

  • test_a_repaint_unsettles_the_rendering_until_it_lands presses the Threads toggle, and reads the settled state as the press goes down and after its click.
  • The two read-state tests that select "new route" in a diff drag across it with select, through one helper.
  • test_the_arrows_say_which_way_the_section_under_the_user_goes tabs to the summary.
  • test_native_top_layers_bound_the_keyboard_stack opens its modal and popover with presses.
  • The contents and excerpt tests select their words by triple-click and by drag.
  • The navigation and pane tests read the bar's room from body.

What's left:

  • /lf-shortcut/: 43 nightly tests still move More or a hint when the scope the line reads changes without a press. Most move focus or the selection by script. A few are news, such as a margin entry arriving beside a focused one, which adds "← / → move through margin entries" to the line. Stopping those means reordering the line to More, then the way out, then the contextual hints, so that news changes only the last item. That is a visible change to every page, left for a separate decision.

This branch also carries 8926f31 from draft-label-no-shift: the sensor now keeps every recent press in a nested frame, and counts a press in a same-origin page holding the frame. Before it, the key after a sample's Enter un-credited the Enter, so #1444's two sample tests reported the bottom status rising over the child's Threads panel.

🤖 Generated with Claude Code

max-sixty and others added 19 commits September 29, 2026 01:02
The first sensor read Chrome's Layout Instability API and failed a keystroke
that shifted any element holding the field or standing before it. On a find
that narrowed the Threads panel's list, the API reported page paragraphs 60px
below where every frame drew them, so its entries are not evidence of a move.

The sensor now measures the field itself. At each trusted `beforeinput` it
records the field's edges in the coordinates of every scroller that moves it,
stopping at a fixed ancestor, and every frame until the keystroke has rendered
compares them. A field whose opposite edges both moved was carried; one that
grew at an edge was not, so a composer pinned to the panel's foot may grow
upward. The watch ends at the runtime's settled reading, at news (a change to
`data-lf-reading`), at another key or press, or after a second, and it skips a
keystroke whose field an animation is already carrying.

Each exclusion answers a false report in the suite: replies arriving right
after a test typed (`test_incoming_reply_follows_*`), the Threads panel still
sliding in when a test typed into it (`test_a_settled_delivery_*`,
`test_a_website_turn_posts_*`), and a widget a test removed by script just
before `fill`. With `data-lf-folded` dropped from the Draft chip, the defect
#1393 fixed, the sensor fails
`test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata` with
"typing in leaf-text.lf-ui moved it by (0, 12)px".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Summing the scroll offsets of the field's ancestors misread the MCP app's
`position: sticky` composer, which stays at its frame's foot while the frame's
document scrolls: under load, 13 of 18 concurrent copies of
`test_snapshot_app_renders_general_and_anchored_feedback_without_claiming_delivery`
reported "typing in textarea#comment moved it by (0, -131)px". A scroll of the
document or of an element holding the field now ends the watch, as news, another
key or press, and an animation already carrying the field do, and the field's
viewport box is compared directly. `leaf-dev flake` runs that test, the
incoming-reply follow test and the delivery activation test clean in 18 copies
each, and the Draft chip without `data-lf-folded` still fails three of four
`test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata` cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The earlier commits on this branch said Chrome's Layout Instability API
reported page paragraphs 60px from where every frame drew them. That was
wrong. A buffered observer shows those paragraphs really moved, by +54, -32
and +131px, while the preceding diff comment was sent and the Threads panel
opened. The last shift painted just after the first keystroke, and the
per-frame read that seemed to contradict it started after the moves ended.

The API is right about what moved but not about why: it compares painted
frames, so a move laid out before a keystroke and painted after it is charged
to the keystroke. Rebuilt on the API with the same rendering window,
`test_package_thread_widgets_keep_local_filters_and_independent_subscriptions`
failed that way: the test removes a widget by script and then types, and the
removal's 27px move painted in the keystroke's first frame. Reading the
field's box with a forced layout at `beforeinput` folds every earlier change
into the baseline. The header now says so, along with the cost: a move painted
and undone between two animation frames goes unseen.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The API is the better evidence of a move. It compares painted frames, nets out
scrolling, and sees a move painted and undone between two animation frames,
which a box read at each frame cannot. What it cannot say is why a box moved.
It charges a move laid out before a keystroke but painted after it to the
keystroke's frame, as it did for the widget
`test_package_thread_widgets_keep_local_filters_and_independent_subscriptions`
removes by script just before it types.

So each keystroke still reads the field's box, and the box of every element
holding it, with a forced layout at `beforeinput`. A shift during the
keystroke's rendering counts only where it names one of those elements at a box
whose opposite edges both moved the same way from that reading. Moving the same
way leaves out a field gaining its focus ring, which grows its painted box on
every side. The report lists every other element the same frame moved, as a
lead for finding the cause. Because the API nets out scrolling, the rule for
an animation already carrying the field is gone: the Threads panel slides in
with a transform, and a transform is not a layout shift. The rendering still
ends at another key or press, at news, and at a scroll of a holder, since a
scroll moves every box after the reading at the key.

The observer hears a frame's shifts a task or more after the paint, so a test
whose last act was a keystroke used to end before the report. `conftest.py`
now judges the queued shifts (`takeRecords`) as each test body returns, while
the pages' servers still answer. Judging at fixture teardown instead let every
round trip deliver failed fetches from pages whose server had stopped.

With `data-lf-folded` dropped from the Draft chip, all four
`test_a_thread_keeps_submit_in_its_field_and_resolve_with_its_metadata` cases
fail, and so does
`test_agent_reply_arrivals_keep_open_panel_drafts_and_summarize_batches`, whose
own assertions pass. The full suite passes, and `leaf-dev flake` runs each test
that gave a false report on an earlier version clean in 18 concurrent copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The watched() docstring still described the first version, which also
failed typing that moved what stood before the field. The header now says
Chrome names at most five moved elements per frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The typing watch becomes `tests/shift_watch.js`, which reads Chrome's Layout
Instability API for both halves of the "Stability" rule: a shift Chrome reports
without recent input fails the test, as typing that carries its field already
did. `EXPECTED` lists the shifts the page makes today, by the elements they
move, each a defect whose lines go when it is fixed: the bottom bar as news
lands, the runtime root, a diff's section at first reading, a package Ask and
the paragraphs after it, ship-review's tasks, the process page's screenshot,
the MCP App's frame, a sample frame, and the gallery column.

A trusted `beforeinput` is typing whatever Chrome's input flag says: Chrome
does not count text inserted without a key (`fill`, `insert_text`) as input,
so a carry by `fill` had fallen outside the typing rule.

The fixture now lets the frames a test's last act changed paint before it
judges, since Chrome hands a frame's shifts over only once it paints; the
review on #1432 showed a `fill` that carried its field going unreported.
`test_render_shift_watch.py` holds both rules and that last keystroke.

A typing report now gives the box the key found and the two Chrome painted,
to say why on a machine where it cannot be reproduced.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Linux CI failed `test_a_settled_delivery_activates_one_fresh_document_with_continuity`
on a carry that was not one: the key read the panel's foot at its box, 1171,835
419x65, and Chrome's rect for it was 1108,835 92x65, since Chrome reports what a node
paints (here a shadow reaching 63px left) clipped to the viewport. Held against each
other the two differ at both edges. The typing rule now reads the same boxes again at
the start of each frame of a keystroke's rendering, and holds Chrome's named node's
box there against the key's. A rendering also ends at a frame that finds still running
an animation that moves a box, where one was running on the field or a holder at the
key: a panel sliding in carries the field for the press that opened it.

A trusted `beforeinput` counts as input for as long as Chrome counts a key, so a
frame after `fill` whose reading is missing is not judged as a shift without input.

Chrome names the five nodes a frame moved most, which differ between runs and
between macOS and Linux (CI found a margin cluster, the gallery's tabs, a task's
`::before`, and a package's thread filter under names the list did not hold). Each
`EXPECTED` pattern now names the region a known shift moves and matches any node in
it, and applies to shifts without input only, so it never hides typing's carry. Thread
cards moving as a reply lands above thirty later ones join the list.

`test_render_shift_watch.py` adds a composer standing past the viewport with a shadow,
which the old comparison failed, and a holder still sliding in.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The review on #1432 showed a `fill` followed 120ms later by an unrelated scripted
move going unreported: a trusted `beforeinput` excused every frame for the 500ms
Chrome counts a key. Now only the frames of that keystroke's rendering are the typing
rule's; a frame after it is judged like any other. A rendering that finds the motion
it began under still running no longer ends there, which would hand its remaining
frames to the no-input rule: it stops reading and judges none of them.

CI found the feature gallery's sections moving 32px as its options draw, beside the
column and tabs already listed, so that line now names the gallery's region.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Chrome credits no input to a frame nested in another page: in the MCP App's nested
Leaf page, a trusted click opened the versions menu and the shortcut bar's More moved
18ms later in a frame Chrome marked `hadRecentInput: false`. A trusted key or press in
the frame's own document now counts for the same half second Chrome counts one.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bottom bar's reservation moved to body, but two assertions in test_render_navigation.py still read .lf-chrome padding: FOOT_ROOM and the fine-pointer check in test_a_coarse_pointer_keeps_useful_status_without_keyboard_hints. They now get 0px; I ran both tests against this head and both failed on that assertion. Update those readers and their comments to measure document.body, so the gate verifies the new reservation owner. I can push this mechanical test repair if useful.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new assertion leaves lint red, so CI skips the test job.

Comment thread tests/test_render_navigation.py Resolved
leaf-agent
leaf-agent previously approved these changes Sep 30, 2026
max-sixty and others added 3 commits September 29, 2026 18:15
The nested-frame input window kept only the last press, so a key that arrived before
the observer judged an earlier key's frame un-credited it: in the clipped-sample
test, Enter opened the child's panel, the frame at 400ms moved its status, and `u`
at 404ms left that frame without input. Every recent press is kept now. A trusted key
or press in a same-origin page holding the frame counts too, as when the page around a
sample drives it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 0790a8c into main Sep 30, 2026
5 checks passed
@max-sixty
max-sixty deleted the agent-aabb5a4e0b545e5fe branch September 30, 2026 02:11
max-sixty added a commit that referenced this pull request Sep 30, 2026
A nightly run on Linux CI (36659812215) found 58 tests the local survey had not, most
of them a margin cluster placed after presentation. So the nightly-marked tests stay
off the watch, as #1451 had them, now decided beside the lists
(`known_shifts.watches_shifts`); the lists hold what the surveys and that run saw, for
whoever takes up each defect, and the reports #1446 and #1444 fixed are out of them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Sep 30, 2026
The shift watch from #1432 now knows the shifts pages make today by test
and region. Before, `EXPECTED` in `tests/shift_watch.js` held one set of
region patterns for every page. Chrome names only the five nodes a frame
moved most, which differ between runs and between macOS and Linux, so
each run turned up names the patterns missed. The only patterns broad
enough to catch them would have masked the runtime's own pieces, such as
margin entries and the comment box, on every page.

- **`tests/known_shifts.py`** names each test whose page still shifts
without input, by file and function, with a pattern for the region its
known shift moves. `clean_browser` keeps a report from that test only
when the node it names is in that region. Any other shift fails, as does
typing that carries its field. Four watched tests are listed today.
Fixing a defect deletes its entry.
- **The upgrade before presentation is known by when it happens.**
Widgets upgrade after the authored HTML has painted, and the frame that
presents the page carries every box their upgrade reshaped. This defect
is every page's, so `shift_watch.js` doesn't report a shift before a
page with the runtime is presented, or in the frame that presents it.
The rule is deleted when the upgrade is fixed, however that is done.
- **The nightly-marked tests stay off the watch**, as #1451 left them.
That decision now sits with the list (`known_shifts.watches_shifts`).
Their pages make hundreds of shifts, mostly that same upgrade: 781
reports across 321 test runs locally, and a nightly run on Linux CI
([36659812215](https://github.com/max-sixty/leaf/actions/runs/36659812215))
found 58 tests the local run had not. They watch again, with the entries
a fresh survey finds, once the upgrade is fixed.

The sensor also changed in three places:
- **Presses:** every recent press is kept, and a trusted press in a
same-origin page holding a frame counts as input to it. A later key had
un-credited an earlier one's frame, and #1446 has already carried this
fix to main.
- **Resize:** a keystroke's rendering ends at a window resize. A test
that resized right after typing had read as a carry.
- **Self-test:** `test_render_shift_watch.py` gains a press in the page
holding a frame, which fails without the change.

The everyday selection passes locally.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants