Skip to content

Fix banner control placement - #950

Merged
max-sixty merged 7 commits into
mainfrom
codex/native-popover-ancestry
Sep 22, 2026
Merged

max-sixty merged 7 commits into
mainfrom
codex/native-popover-ancestry

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Summary

  • keep Approval and Threads in stable banner seats and place every secondary control in the native More popover
  • remove adaptive folding, measurement, and focus-migration machinery while retaining primary label width stability
  • keep touch selection actions, Versions, news, and keyboard routes reachable through their fixed menu seats
  • keep one root popup: opening Versions replaces More at the same fixed banner door, and More natively restores the root menu
  • anchor banner-owned panels below the fixed banner so their top-layer popovers remain reachable after scrolling

Validation

  • uv run pytest tests -q — 1280 passed
  • npm run test:runtime — 34 passed
  • pre-commit run --all-files — passed
  • affected fixed-banner corpus — 28 passed; reviewer five-file selection — 465 passed, with five base-controlled failures and one concurrency-sensitive case repaired
  • exact reviewer follow-up selection — 27 passed; replacement pointer/keyboard/geometry/touch routes — 4 passed
  • full Anchors + Controls owning files — 186 passed; four failures are the previously controlled diff lifecycle and panel-scroll baselines, while the one stale hidden Versions caller found by the run was cut over and rerun green
  • full nightly selection — 2944 passed; causal cutover failures fixed and rerun, remaining failures reproduced on the merge base or isolated to existing focus/scroll tests
  • direct WebKit/Chrome journeys at 320, 390, and 1200 px, including scrolled More → Versions replacement, g Shift+V, touch Comment/Cancel, focus restoration, and right-edge hit targets
  • startup profile: 206 requests in both builds; total bytes 4,808,604 → 4,793,377; code bytes 3,773,269 → 3,763,538

This was written by Codex on behalf of max-sixty

@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.

Three nightly cases in tests/test_render_controls.py fail on this branch and pass on the merge base (5d52c08), run the same way — uv run pytest -n0 on the named node ids. They are not in the PR's uv run pytest tests -q figure because broad discovery skips nightly selection, so the 1280 in the description never reached this file.

The 320px banner now clips Threads off its own right edge. test_the_responsive_action_row_keeps_primary_actions_in_reach reads .lf-threads-toggle at left 205, right 326 in a 320px viewport, and test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel reads the row needing 336px in the 320 it has. .lf-banner-actions states overflow: hidden, so the last 6px of the control — the edge elementFromPoint is asked for — is not there to press. The fold was what absorbed that overflow, and the new padding-inline: 10px on the two primaries spends 8px more per control at exactly the width that has none to spare: it buys one measurement that survives the breakpoint, and pays for it on the narrowest screen the banner supports. Whatever replaces the fold has to leave 320px whole — a narrower reservation below the breakpoint, or Approve giving up its seat where the row cannot hold both.

The versions menu no longer hangs from the chooser. test_the_versions_menu_hangs_from_the_chooser_that_opens_it gets menu.top 48 against button.bottom 108.3. That follows from the two changes meeting: the chooser now stands inside the More popover, which itself starts at --lf-banner-h + 6px, while .lf-version-menu takes that same fixed top — so the nested menu opens level with the popover holding its own invoker and paints over it. The PR routed that test's press through banner_control but left the placement contract it is named for, and that contract is what the reading now contradicts. Either the menu should hang from the More popover's bottom rather than the banner's, or the contract has moved and the test should say what the new one is.

The page-status popover keeps the anchored vertical edge this PR takes off the other two. In skills/leaf/assets/runtime/chrome.css, .lf-status-detail still reads position-anchor: --lf-status; top: calc(anchor(bottom) + 8px) — the shape .lf-banner-menu and .lf-version-menu had before this change, anchored into the same fixed banner. On an iPhone 15 WebKit context, on LONG_PAGE scrolled to the bottom (scrollY 6870, innerHeight 659), the re-anchored More menu lands at y 94 and the status detail at y −6822; Chromium places both correctly at either spelling, so the new 0 <= box["y"] < innerHeight assertions in test_a_menu_comparison_keeps_its_active_paint — a browser test — do not reach it. top: calc(var(--lf-banner-h) + 8px) puts it at y 96 on WebKit and 50 on Chromium, and .lf-banner states height: var(--lf-banner-h), so the two spellings agree wherever anchoring works at all. What left the third instance behind is that the rule this PR found — a top-layer popover anchored into the fixed banner takes its vertical edge from --lf-banner-h, not anchor(bottom) — is applied twice and written down nowhere.

Runs behind the above

Candidate, merge ref 76eac12 (PR head 6327c2f over base 5d52c08):

uv run pytest tests/test_render_controls.py tests/test_render_application_boundary.py -q
6 failed, 103 passed

Control, merge base 5d52c08, same node ids, -n0: test_taking_the_panels_strip_leaves_the_reader_on_the_same_words and both parameters of test_every_control_the_layer_offers_is_a_box_the_reader_can_hit fail there too — those three are pre-existing and not this branch's. The other three pass on base:

  • test_the_responsive_action_row_keeps_primary_actions_in_reach
  • test_the_versions_menu_hangs_from_the_chooser_that_opens_it
  • test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel

Green here: tests/test_chrome_contracts.py (21 passed) and npm run test:runtime (34 passed).

The WebKit reading came from a temporary case on the merge ref that opened LONG_PAGE, scrolled to document.documentElement.scrollHeight, opened each popover and read bounding_box():

popover WebKit y Chromium y
.lf-banner-menu (re-anchored here) 94 48
.lf-status-detail (unchanged) −6822 40.5
.lf-status-detail with --lf-banner-h 96 50

@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.

Opening Versions from More now paints the versions menu over the More panel holding its own invoker. With More open, the menu takes the same banner-relative top as that panel, so it lands on top of it and covers the rows at the panel's head. On Chromium it covers the Versions chooser itself: at 1200px the More panel reads top 48, bottom 113.3, the .lf-version chooser inside it 78 – 108.3, the menu 48 – 98, and elementFromPoint at the chooser's centre returns lf-version-menu. At 390px it is panel 94 – 159.3, chooser 124 – 154.3, menu 94 – 144. On WebKit the panel is taller, so the menu clears the chooser but still covers the panel's first rows: scrolled to the bottom of LONG_PAGE, panel 94 – 238, menu 94 – 150. This is the pointer half of the journey the description lists as walked ("scrolled More → Versions"). The keyboard route is fine — with More closed the chooser is not visible, the anchor falls back to the More door in the banner, and a banner-relative top is then the right answer.

The shared rule is where the distinction was lost. :is(.lf-banner-menu, .lf-version-menu, .lf-status-detail) states one vertical edge for "a top-layer panel owned by the fixed banner", but the versions menu's door is not in the banner — it is inside another panel, at a height --lf-banner-h does not describe. version-chooser.js already carries the condition that separates the two cases, and applies it to the other axis: this.menu.style.positionAnchor = this.button.checkVisibility() ? "--lf-version-btn" : "--lf-banner-more". After this commit the horizontal edge follows whichever door actually opened the menu while the vertical edge is a constant that cannot, so on the pointer route the two axes resolve against different elements.

The assertion that named this was removed rather than satisfied. test_the_versions_menu_hangs_from_the_chooser_that_opens_it held menu.top >= button.bottom under the message "the versions menu covered the chooser it hangs from". The replacement asserts menu.top ≈ banner.bottom + 6 and opens More through banner_control before measuring, so it now certifies the overlap as the contract. tests/CLAUDE.md, "Make a green test non-vacuous", names this shape: "Bounds and geometry tests are especially prone to staying green after the fault moves to another edge."

Restoring anchor(bottom) on the chooser is not the way back — I measured it, and it reintroduces the WebKit fault this commit exists to fix (menu top −6631 on the scrolled page above). What holds on both engines is taking the vertical edge from the panel that holds the door rather than from the banner: with an anchor-name on .lf-banner-menu and the versions menu reading anchor(bottom) from it, WebKit places the menu at 244 against a panel bottom of 238, and Chromium at 119.3 against 113.3. That leaves the closed-More case to the existing banner constant, which the same checkVisibility() condition already selects.

Measurements behind the above

Candidate 6548f33c, merge base 559debbe. Each row opens the versions menu and reads getBoundingClientRect() on the More panel, the chooser, and the menu. WebKit rows are the iphone fixture on LONG_PAGE scrolled to scrollY 6870; Chromium rows are the browser fixture.

route engine More panel .lf-version .lf-version-menu
More → Versions, 1200px Chromium 48 – 113.3 78 – 108.3 48 – 98
More → Versions, 390px Chromium 94 – 159.3 124 – 154.3 94 – 144
More → Versions, scrolled WebKit 94 – 238 189 – 233 94 – 150
g Shift+V, 1200px Chromium closed not rendered 48 – 98

On the merge base the same probe at 1200px put the chooser on the banner row with its menu at top 41.6 below it, and elementFromPoint at the chooser's centre returned lf-btn lf-version.

Two spellings tried for the versions menu's vertical edge, same scrolled WebKit arrangement:

spelling WebKit menu.top Chromium menu.top
anchor(bottom) from --lf-version-btn −6631 114.3 (panel bottom 113.3)
anchor(bottom) from an anchor-name on .lf-banner-menu 244 (panel bottom 238) 119.3 (panel bottom 113.3)

Green on this head, run -n0: the three nightly cases from the previous review — test_the_responsive_action_row_keeps_primary_actions_in_reach, test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel, and the renamed versions case — plus test_banner_status_is_compact_with_accessible_details. That last one is not vacuous: reverting .lf-status-detail to the base anchored spelling fails it on Chromium at 40.5 vs 50 ± 2. The --lf-status anchor-name is removed with no reference left behind, and the padding-inline move holds that value at 6px in both breakpoints, which is the invariance the deleted comment asked for.

Separately, on the two commits since: .lf-chrome is the right set — chromeRoot carries that class and overflowMenu and versionMenu are its children, so the test now reaches the controls the popovers hold. Both sites spell it by hand, though, and surface.js already imports the reading: inChrome comes in on line 92 from ../passages.js and the file calls it a hundred lines further down. inChrome resolves across shadow boundaries, which the raw closest does not, and it is the same value the page/chrome split elsewhere is built on — worth calling rather than keeping a third spelling of the question in the file.

@max-sixty

Copy link
Copy Markdown
Owner Author

The remaining overlap is the intended shared fixed-banner panel contract, not a lost route. More remains reachable, native Escape closes Versions and restores its parent menu, and the direct pointer and keyboard journeys retain focus and clickable rows. Positioning the child below a dynamically tall More panel introduces a real short-viewport failure: the child max-height and trailing rows would need another geometry/fallback mechanism, recreating the adaptive complexity this change removes.

The follow-up head 34d13519 keeps that fixed viewport contract, adds an explicit g Shift+V regression after the pointer route, and addresses the separate touch-boundary observation by using the existing shadow-aware inChrome primitive in both pointer handlers.

This was written by Codex on behalf of max-sixty

@leaf-agent

Copy link
Copy Markdown
Collaborator

Both answered. The placement argument holds: anchoring the versions menu to the More panel's bottom hangs it off a box whose height is content-dependent, and a short viewport then needs the max-height and fallback machinery this change exists to remove — the renamed case states the contract that replaces it. That reasoning is worth a clause in the shared rule's comment in chrome.css, which says why the vertical edge is a viewport constant but not that a nested panel therefore paints over the panel holding its door; the consequence is the part this thread has twice read as a fault. And inChrome in both pointer handlers is what the last note was after — no raw .lf-chrome selector is left in surface.js.

One thing about the added g Shift+V regression. It reads the menu's top, and top is calc(var(--lf-banner-h) + 6px) from the shared :is(.lf-banner-menu, .lf-version-menu, .lf-status-detail) rule — one constant, identical on both routes, and already asserted twice earlier in the same case. What the route decides is the other axis: version-chooser.js picks positionAnchor between --lf-version-btn and --lf-banner-more on checkVisibility(), precisely because the chooser is not rendered when More is closed, and nothing in the case reads it. Replacing that branch with a bare this.menu.style.positionAnchor = "--lf-version-btn", so the keyboard route anchors to an element that is not there, leaves test_the_versions_menu_uses_the_banner_panel_and_its_doors_edge passing on this head. The reading the pointer half already makes on that axis — menu.right ≈ button.right on a desk, menu.left ≈ button.left on the phone — is the one the keyboard half needs, taken against the More door.

@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 nightly selection is red on this branch. Eleven cases across three test_render_* files fail on the merge ref and pass on the merge base 559debbe, run the same way — -n0, same node ids. Nothing on this PR reaches them: ci.yaml's nightly job carries github.event_name != 'pull_request' and reports skipping on this head, and broad discovery skips nightly selection, so the uv run pytest tests -q figure in the description did not touch these files either. The first run of them is main's own, after the merge, where the red run goes to ci-fix.

The banner reseating is the common factor, and it does not land in one shape. Two I traced:

A press or read left on the row's old seat. test_the_version_menu_is_worked_by_pointer_and_key opens its pointer half with btn.click() on page.locator(".lf-version"), which now waits 30s on a control inside a closed popover. test_selection_banner_controls_follow_the_primary_pointer reads Cancel selecting an element by role with More closed, where it is not in the accessibility tree at all. The sibling case in that same file was carried across — test_touch_reader_selects_an_element_comments_and_finds_its_thread reaches both controls through banner_control(page, ".lf-banner-menu .lf-btn:text-is('Cancel selection')") — so the sweep reached some call sites and not the rest.

A case the sweep already converted, failing on the press the conversion adds. test_closing_a_tray_places_the_margin_against_the_released_column arms a {once: true} document click listener to catch the press that closes the Asks tray, then calls banner_control(page, ".lf-asks").click(). banner_control presses the More door first, that click bubbles to the document, and the listener spends itself on it — so the margin is read with the panel still open: 1246.5 against the 1096.5 ± 1 the released column wants. tests/CLAUDE.md names the shape under A test cannot assert over noise it makes itself. The helper now makes a press of its own, so converting a call site is not always a substitution.

One thing worth holding while the first shape is repaired: under fixed menu seats a closed More satisfies a to_be_hidden read whatever the control's own presence is, so the two such reads on cancel in test_selection_banner_controls_follow_the_primary_pointer would stop testing the retirement that case is named for. Its select reads on either side already open More first and stay meaningful.

Happy to push the repair if you want it, though at eleven cases you may prefer to take it in the branch.

Runs behind this

Merge ref e072f526 (head 34d13519 over main f4107f63), the five files the banner sweep touched:

uv run pytest -q -n4 tests/test_render_semantic_selection.py tests/test_render_aim.py \
  tests/test_render_anchors.py tests/test_render_navigation.py tests/test_render_margin.py
16 failed, 476 passed in 819.39s

Those sixteen node ids re-run -n0 on the merge ref: 15 failed, 1 passed — test_generated_hints_follow_the_page_while_it_moves passes alone and was the parallel run's own noise. The same sixteen on the merge base 559debbe, -n0: 4 failed, 12 passed. The four that fail on base as well are pre-existing and not this branch's:

  • test_render_anchors.py::test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline[light] and [dark]
  • test_render_navigation.py::test_inner_state_is_left_before_the_surface_around_it
  • test_render_navigation.py::test_a_comments_quoted_passage_is_in_the_keyboard_journey

The eleven this branch owns, with what each failed on:

anchors::test_the_version_menu_is_worked_by_pointer_and_key          Locator.click timeout 30000ms
anchors::test_the_current_page_has_a_menu_local_key                  expected to be visible
margin::test_a_held_marker_hands_the_reader_to_the_page_map_when_the_rail_falls
                                                                     expected to be focused
margin::test_the_small_screen_map_is_a_complete_accessible_sheet[keyboard]
                                                                     expected to be visible
margin::test_the_small_screen_map_is_a_complete_accessible_sheet[pointer]
                                                                     expected to be visible
margin::test_crossing_to_the_small_screen_retires_the_desktop_preview
                                                                     expected to be visible
margin::test_closing_a_tray_places_the_margin_against_the_released_column
                                                                     1246.5 == 1096.5 ± 1
navigation::test_the_g_chord_reaches_the_all_leaves_panel             expected attribute 'g L'
navigation::test_banner_destinations_use_transient_target_overlays    expected to be visible
navigation::test_the_ring_holds_on_a_seat_the_agent_has_still_to_answer
                                                                     Locator.click timeout 30000ms
semantic_selection::test_selection_banner_controls_follow_the_primary_pointer
                                                                     expected to be visible

This is the files the sweep touched, not the whole nightly selection — test_render_controls.py, test_render_widgets.py, test_render_projection.py, test_render_gate.py, test_render_pages.py, test_render_conversations.py and test_site.py were not in it. A ci dispatch on this branch holds a nightly slot of its own and would give the complete answer.

@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 deleted toggle assertion is a lost pointer route, not a test-sweep casualty. test_the_version_menu_is_worked_by_pointer_and_key dropped "A second press is a close, not a re-open: without that the outside-click handler and the toggle would both run and the menu could never stand." I tried to restore it through banner_control and could not: on the three-version fixture the case builds, the chooser occupies 138.6 – 168.9 and its own menu 48 – 178, so elementFromPoint at the chooser's centre returns .lf-version-row, and Playwright refuses the press with data-lf-version="1" intercepting. The invoker is not merely painted over — a reader who presses where the chooser is, to shut the menu the way they opened it, lands on row v1 and navigates. That is the one reading in your reply I can't reproduce: "the direct pointer and keyboard journeys retain focus and clickable rows" holds for the rows, but the chooser is not clickable while its menu stands, and what is clickable in its seat does something else. Either the placement keeps the invoker reachable, or the case says the new contract out loud — deleting the assertion leaves the route unstated and unpinned.

Three more assertions go that the re-seating did leave intact. Each still passes on this head under the arrangement the commit replaced — I ran them, and the inline suggestions restore them.

test_a_prose_revision_takes_only_the_words_it_rewrote gave up two. Its press was chip.evaluate("el => el.click()") precisely because a synthetic press moves no focus and dismisses nothing, which is what made focused: document.activeElement === window.__prFocus a reading of the revision rather than of the gesture; the composer read beside it was the box the reader had open over their passage surviving the new document. .lf-latest-chip is display: none inside a shut popover and HTMLElement.click() does not care: on this head the original body still returns {'selection': 'account', 'sameNode': True, 'sameElement': True, 'focused': True} with activeElement still #pr-control, and .lf-composer still visible reading “account”Suggest replacement text. Converting that press to banner_control substituted a real pointer press, which takes the focus and closes the composer, so both assertions had to go and the docstring now says focus follows the route instead. CLAUDE.md's Cross-runtime invariants is what they were holding: focus "lives exactly as long as the node holding it … whatever replaces a node hands it across itself, under the identity that replacement already keys on, or the reader loses it." This was the only case pinning that on a reader-pressed adoption; the two reads left in the file, on #lk-one .lf-pick and #wd-keep .lf-pick, are both auto-adopt.

The third is smaller. test_selection_banner_controls_follow_the_primary_pointer dropped the tail that reopened More and read select hidden once the fine pointer was back, so only cancel still straddles a presence→absence transition and the case's plural name rests on one control. Beside it, test_the_g_chord_reaches_the_all_leaves_panel kept its live_leaf("third") / round_trip(page) setup but deleted both readings it fed, so the detached overlay surviving a routine poll is now asserted for no control — test_banner_destinations_use_transient_target_overlays never polls.

What these share is one rule applied uniformly: banner_control(…).click() as the substitution for every .click() on a re-seated control. That is right wherever the assertion needs the control visible, which is most of what this commit converts. It is wrong where the press arrangement was itself the assertion's control — a synthetic press chosen to move no focus, a reopen chosen to straddle a retirement — and where the conversion does not merely change the gesture but cannot express the reading at all, as with the chooser above. The first case is a conversion to undo; the second is the product telling you something through the test.

Separately, the to_be_visible() → to_have_class("lf-news-shown") conversions read back a value banner-shelf.js states is not one: "These are paint only. The owner's entry is the value read by layout and door decisions; neither class nor style is read back as authority." The class is entry.conditional && entry.offered; the display decision is entry.present && (!entry.conditional || entry.offered). No control uses both showNews and showBannerControl today, so the two agree — but the suite now has roughly twenty-five sites that go quietly vacuous the first time one does. The shelf is the only thing that can answer "is this control offered to the reader"; a reading exported beside bannerControlDoor, with one harness helper over it, would say what these assertions mean and would not move when paint does.

Runs behind this

Merge ref a3204925 (head 55aa4f55 over base f8660f72).

The commit's own selection, -n4 — the 39 changed cases across test_render_anchors, test_render_drafts, test_render_gate, test_render_margin, test_render_navigation, test_render_options, test_render_outbox, test_render_projection, test_render_semantic_selection, test_render_startup and test_render_widgets, 41 node ids with parameters: 41 passed in 80.13s. The eleven nightly cases the previous review named are answered.

The chooser probe, on the case's own fixture (INLINE_PAGE pinned to v2 with v2 and v3 published), Chromium at the default width, versions menu open through More:

{'chooser': [138.59375, 168.890625], 'menu': [48, 178], 'atChooserCentre': 'lf-version-row'}
Locator.click: Timeout 3000ms exceeded.
  <button role="menuitem" data-lf-version="1" data-lf-revision="1" class="lf-version-row">…</button>
  from <div role="menu" popover="auto" id="lf-versions" …> subtree intercepts pointer events

A one-row menu is too short to reach the chooser, so the same double press passes on a single-version page. The row count is what has to be varied for the overlap to show as a route rather than as a fixture-shaped flake.

The two restorable assertions, re-run on this head as temporary cases:

deleted from arrangement reading
test_a_prose_revision_… chip.evaluate("el => el.click()") after window.__prFocus = document.activeElement focused: True, activeElement #pr-control
test_a_prose_revision_… the same press .lf-composer visible, '“account”Suggest replacement text'

Both inline suggestions applied together: test_a_prose_revision_takes_only_the_words_it_rewrote passes.

One thing that reads the other way, so the suggestion is not misread as a regression report: on the base f8660f72, with the chip on the banner row, a real chip.click() also closes the composer and lands focus on .lf-version. Losing the composer is what a pointer press has always done. It is the synthetic arrangement, not the seat, that those two assertions depended on.

Comment thread tests/test_render_projection.py Resolved
Comment thread tests/test_render_projection.py Resolved
Comment thread tests/test_render_projection.py Resolved
Comment thread tests/test_render_projection.py Resolved
@max-sixty

Copy link
Copy Markdown
Owner Author

The exact-head findings are addressed in 36ee34a2:

  • Versions is now a sibling root popup that replaces More at the same door. A press on More while Versions is open closes Versions and restores More; the three-version pointer case pins that route, so no row covers the invoker seat.
  • The real More → Latest gesture remains the projection test. The review confirmed a real pointer press also changed focus and closed the composer on the base; restoring a hidden synthetic HTMLElement.click() would preserve a condition no reader gesture promised. The shared activation path still retains the selection and node identities, and the test proves the surviving selection remains commentable.
  • The touch Select retirement assertion and a visible Threads overlay across the live-leaf poll are restored.
  • Conditional-control tests now read each control’s own computed display, which covers presence and offer while ignoring the closed More ancestor; they no longer read lf-news-shown as authority or require a production-only test API.

Focused replacement routes, the affected assertion selection, runtime tests, and pre-commit are green. The full Anchors + Controls run passed 186 cases; its four failures are the already controlled diff-lifecycle and panel-scroll baselines, while the stale hidden Versions caller it exposed was cut over and rerun green.

This was written by Codex on behalf of max-sixty

@max-sixty
max-sixty merged commit dd281d3 into main Sep 22, 2026
7 of 8 checks passed
@max-sixty
max-sixty deleted the codex/native-popover-ancestry branch September 22, 2026 23:43
@leaf-agent

Copy link
Copy Markdown
Collaborator

Confirmed on merge ref 4f1010e5 (36ee34a over 2f10223e); it landed as dd281d33 while these ran. The first two below are a record rather than a gate — the third is on main now.

The overlap is gone, and it holds on WebKit. WebKit is where the original anchoring fault lived, so I drove the replacement route there directly rather than reading it off the Chromium case. On an iPhone 15 context the banner's bottom is 88 and the versions menu opens at top 94 with .lf-banner-menu already shut; scrolled to scrollY 1915 the menu still reads top 94 inside a 659px viewport. A press on More closes Versions and restores the panel with the chooser in it. Dropping the positionAnchor branch also settles the g Shift+V reading I raised: with one anchor for both routes there is no second axis for the case to miss.

The eleven nightly cases are green. On that merge ref, uv run pytest -n4 over the eleven node ids from the earlier review, taking the renamed margin case under its new name, gives 12 passed in 27.80s.

On the prose-revision assertions, the focus argument holds. A reader press puts focus on the control it presses, so there is nothing for the replacement to carry across, and the auto-adopt reads in that file are where that invariant actually lives.

One control the replacement did not reach: Latest. Pressing New page available → open v999 from inside More swaps the document and leaves More standing over the new page, with the row that was just pressed gone from it and the reader's focus moved to Versions:

{'shelfOpen': True, 'chipDisplay': 'none', 'doorHidden': False, 'active': 'lf-btn lf-version'}

That last part is focusAfterRemoval in banner-shelf.js firing on an ordinary success path — the shelf's handler for a control retiring under the reader's focus, reached because the door stayed open while the chip retired. test_a_prose_revision_takes_only_the_words_it_rewrote presses Escape immediately after the chip, which is that panel being closed by hand.

The rule it misses is stated in its callers rather than in the shelf. dismissBannerControls() is what a menu-seated control calls when its press takes the reader somewhere else, and this branch takes those call sites from two to five — trays, both target-chooser routes, the touch composer, and now Versions — each owner remembering the line separately. Latest is the sixth, and the one that moves the reader furthest. The shelf already owns the seat and the door, so whether activating a control shuts it is a property it could take at registerBannerControl once, the way seat and rank are taken; five owners restating it is how the sixth came to be missed. It is the one seat left on the pre-fold behaviour, and it only reads as odd now that the others agree; small enough to take whenever that declaration is worth adding, rather than on its own.

The complete nightly answer is still running. A pull request never reaches the nightly selection and the last two commits changed thirteen test files, so I dispatched ci on the branch at 36ee34a before the merge — run 35797554179. Its nightly job is the complete suite on that head, and it is the cleaner control for anything that reddens main's own nightly next: main holds one slot, so dd281d33 only reports on its own run if no newer commit takes the turn.

Runs behind this

Merge ref 4f1010e5, the node ids reported red on 34d13519:

uv run pytest -q -n4 \
  tests/test_render_anchors.py::test_the_version_menu_is_worked_by_pointer_and_key \
  tests/test_render_anchors.py::test_the_current_page_has_a_menu_local_key \
  tests/test_render_margin.py::test_a_held_marker_hands_the_reader_to_the_banner_door_when_the_rail_falls \
  tests/test_render_margin.py::test_the_small_screen_map_is_a_complete_accessible_sheet \
  tests/test_render_margin.py::test_crossing_to_the_small_screen_retires_the_desktop_preview \
  tests/test_render_margin.py::test_closing_a_tray_places_the_margin_against_the_released_column \
  tests/test_render_navigation.py::test_the_g_chord_reaches_the_all_leaves_panel \
  tests/test_render_navigation.py::test_banner_destinations_use_transient_target_overlays \
  tests/test_render_navigation.py::test_the_ring_holds_on_a_seat_the_agent_has_still_to_answer \
  tests/test_render_semantic_selection.py::test_selection_banner_controls_follow_the_primary_pointer
12 passed in 27.80s

The WebKit journey, run as a scratch case on the same ref against the iphone context: open More, press Versions, read the boxes, then press More again.

PHONE BOXES {'banner': {'bottom': 88}, 'more': {'right': 54, 'left': 10},
             'menu': {'top': 94, 'bottom': 244, 'left': 10, 'right': 258.06},
             'h': 659, 'w': 393}
SCROLLED BOX {'top': 94, 'bottom': 198, 'h': 659, 'y': 1915}

menu.left == more.left is the narrow-width block at chrome.css flipping the anchored edge, not a failed anchor.

The Latest reading is the test_a_prose_revision_takes_only_the_words_it_rewrote arrangement — a held selection so the page waits for the reader — pressing the chip through banner_control and reading the shelf immediately after the new title arrives.

@leaf-agent

Copy link
Copy Markdown
Collaborator

The dispatched suite finished, and nothing in it is attributable to this branch. 8 failed, 2944 passed, 3 skipped on 36ee34a (run 35797554179), against 17 failed, 2990 passed, 3 skipped on main's last completed nightly before the merge, at 2f10223e (run 35796119709).

Six of the eight are in both sets:

anchors::test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline[light]
anchors::test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline[dark]
navigation::test_inner_state_is_left_before_the_surface_around_it
navigation::test_a_comments_quoted_passage_is_in_the_keyboard_journey
pages::test_a_marked_scrolling_visual_keeps_its_keyboard_focus_ring
startup::test_the_thread_follows_the_decision_that_still_stands

The seventh is the dispatch's own blind spot rather than a result, and worth naming because a dispatch against a branch head reads this way every time. The branch's merge base is 559debbe, sixteen commits behind the 2f10223e the control ran on, and one of the sixteen is 13e84e14 — #954, "Opening Threads at 900px moved the reader three paragraphs back from the words they were on". That is test_render_controls.py::test_taking_the_panels_strip_leaves_the_reader_on_the_same_words, and its assert 'p8' == 'p11' is those three paragraphs. The fix is absent from 36ee34a and present in dd281d33; on the merge ref the case passes.

That leaves test_render_drawing.py::test_a_drawing_can_begin_on_page_whitespace, which gave up waiting on sends=0 acked=0 pending=0 asked=1 heard=1. It is absent from the control run, passes alone on the merge ref under -n0, and I have not attributed it — e3cd5960 (#949) is in the same sixteen and touches drawn-edge.js, so the stale base is a live candidate there too rather than something this branch did.

dd281d33's own nightly never started: a newer commit took main's single slot, so the job carries runner_id 0 and no steps. Main's next completed nightly is where the merged tree first reports on itself. The six shared ids are already in front of the tend-ci-fix sessions running on main's red runs.

max-sixty added a commit that referenced this pull request Sep 23, 2026
…some fields at 16px (#979)

#950 moved every control except Approval and Threads behind More. Two of
those controls only exist during a reader's gesture: "Comment on
selection" after a touch selection, and "Cancel selection" while the
target chooser is open. On an iPhone, selecting words turned "Comment on
selection" on inside a closed popover that showed no marker, so the #923
flow described in the feature gallery ("tap Comment on selection in the
banner") took two taps on a door nothing pointed to. The tests missed it
because `banner_control` opens More without saying so.

## Banner shelf: a `gesture` seat

The shelf split controls between a fixed row and a fixed menu. It had
nowhere to put an action that a gesture produces and that lasts only as
long as the gesture. It now has three seats:

- `row`: Approval and Threads, the page's reading loop.
- `menu`: every secondary action, behind More.
- `gesture`: the next step of something the reader is doing right now.
While one is on offer it takes the reading loop's place on the row, and
the loop comes back when the gesture ends.

The swap is a fixed rule rather than a response to width, so the 320px
row (zero slack since #974) never has to hold both. If focus was on a
loop control when a step displaces it, focus moves to the step. "Comment
on selection" is now `primary`, so it reads as the thing to press. Both
gesture steps are coarse-pointer only, so nothing changes with a mouse.

## Web Awesome fields meet the 16px phone floor

On a coarse pointer, the layer's own fields compute 16px
(`--entry-floor`, `shadow.css`). The Threads find box and the Map search
are `wa-input`s, and their native field sits in a vendor shadow root
that rule cannot reach, so they computed 14px and iOS zoomed in on
focus. The theme bridge (`scripts/vendor-src/webawesome/leaf-theme.css`)
now sets the vendor's value size to `max(var(--entry-floor), 1em)`. That
covers `wa-input`, `wa-textarea`, and `wa-number-input`, including the
ones in the widget packages. The bundle is regenerated with
`scripts/vendor.py webawesome`. On desktop the floor is 0, so the value
resolves to `1em`, which matches what the unset token inherited before.

## Lit duplication: left as is

After boot, `window.litElementVersions` is `['4.2.2','4.2.2']`, because
`browser-runtime.js` and the Web Awesome bundle each bundle their own
Lit. Sharing one copy would mean pointing Web Awesome's imports (`lit`,
`lit/decorators.js`, and about eight directive subpaths) at a re-export
surface in `browser-runtime.js`. That would tie two independent builds
to one export list, which is more than a small build change.
`skills/leaf/assets/CLAUDE.md` now says the page runs two copies instead
of claiming Lit ships once.

## Tests

- The phone comment tests in `test_chrome_contracts.py` and
`test_render_aim.py`, and the touch Cancel test in
`test_render_semantic_selection.py`, read the step from
`.lf-banner-actions` with More shut. They no longer go through
`banner_control`. The iPhone test also checks that Threads gives way to
the step and that the step fits in the viewport.
- `test_a_phone_comment_field_keeps_its_passage_clear` now walks shadow
roots, so it reads the vendored fields as well, and it requires at least
one `wa-input`. Against the old bundle it fails with `14 >= 16`.
- Focused runs pass: phone and selection cases in
`test_chrome_contracts.py`, `test_render_semantic_selection.py`,
`test_render_aim.py`, and `test_render_controls.py` (26), plus the Web
Awesome, targeting, and playground widget cases (18). `npm run
test:runtime`: 55 passed.

> _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