Skip to content

Simplify Leaf UI hierarchy - #443

Merged
max-sixty merged 8 commits into
mainfrom
codex/simplify-ui-chrome
Sep 8, 2026
Merged

max-sixty merged 8 commits into
mainfrom
codex/simplify-ui-chrome

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Reduce repeated borders and passive controls so active workspaces, keyboard focus, and annotations carry distinct visual weight.

  • Keep developer diagnostics in banner overflow and make a lone version a passive label.
  • Replace resting button and thread frames with lighter active-state treatments.
  • Project element annotation rails above child surfaces and preserve full keyboard-focus rings.
  • Remove repeated thread-location copy and redundant neighboring-page link glyphs.

The responsive light/dark browser sweep and a context-blind reply task passed. All regressions identified in review now pass, as do the 910-case everyday suite and all repository hooks. In the complete 2,191-case browser-inclusive run, the six remaining failures reproduce unchanged on origin/main.

This was written by Codex on behalf of @max-sixty

Reduce repeated borders and passive controls across the banner, thread panel,
version selector, action buttons, and neighboring-page rows. Keep active and
keyboard-focus states explicit while making resting chrome quieter.

Project element annotation rails into Leaf's chrome layer so child surfaces
cannot cover them, and remove thread location copy already supplied by its
group heading.

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

Twenty-one nightly browser tests go red on this branch, and one of them is a real product regression rather than an assertion that needs updating.

The PR body's "complete local suite passes with 910 tests" is the everyday suite: uv run pytest tests reports 904 passed, 6 skipped here, and per tests/CLAUDE.md broad discovery skips every test_render_*.py module — which is every module this change touches. The complete suite is uv run pytest tests --run-nightly. I ran 7 of the 22 render files against this head and against the merge base (37b8478f), same platform, same -n and selection; the base has 5 failures, this head has 26.

The 21 failures this branch adds (base-verified)
tests/test_render_anchors.py::test_an_ambiguous_revised_passage_detaches_until_the_agent_moves_it
tests/test_render_anchors.py::test_a_passage_longer_than_the_pattern_is_anchored_whole
tests/test_render_anchors.py::test_one_neighbour_is_not_enough_to_identify_a_revised_comment
tests/test_render_anchors.py::test_a_selection_of_the_whole_page_still_finds_its_passage
tests/test_render_anchors.py::test_a_data_bound_diff_aims_and_selects_one_source_line
tests/test_render_anchors.py::test_the_menu_a_first_version_opens_is_a_menu_it_can_close
tests/test_render_anchors.py::test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline[light]
tests/test_render_anchors.py::test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline[dark]
tests/test_render_anchors.py::test_dismissing_versions_during_thread_upgrade_preserves_the_new_version
tests/test_render_conversations.py::test_a_thread_on_a_widget_in_a_reply_travels_in_the_panel_that_holds_it
tests/test_render_controls.py::test_a_phone_banner_folds_its_addresses_into_one_menu
tests/test_render_aim.py::test_an_aimed_press_does_only_what_the_outline_promised[ship-review]
tests/test_render_aim.py::test_design_mode_comments_on_what_a_press_lands_on_and_nothing_else
tests/test_render_navigation.py::test_the_feature_gallery_exercises_an_inline_diff_thread
tests/test_render_navigation.py::test_the_pointer_over_a_comment_lights_the_passage_it_is_about
tests/test_render_navigation.py::test_no_two_hints_on_the_key_line_say_the_same_word
tests/test_render_navigation.py::test_target_mnemonics_filter_the_generated_map_without_renumbering_hints
tests/test_render_navigation.py::test_banner_destinations_use_transient_target_overlays
tests/test_render_navigation.py::test_typing_in_a_selected_comment_wins_over_page_shortcuts
tests/test_render_navigation.py::test_a_text_box_keeps_its_keys_from_the_widget_around_it
tests/test_render_navigation.py::test_a_key_on_screen_is_a_key_that_works

Pre-existing at 37b8478f and excluded: the three 435.8px → 453.7px fold-geometry cases and test_a_coined_class_cannot_reach_the_chromes_rules in test_render_conversations.py, and test_an_inline_thread_uses_surface_focus_until_its_reply_takes_over in test_render_navigation.py. I did not run the other 15 render files.

A thread card can lose its quote for the life of the tab

Seven of those failures are one bug, and it is in the product. anchorLabel's new if (omitted === item) return "" fires when both are null: threadAnchorLabel passes group.target, which is undefined for every group without a heading (gone, page, top, layer, sent), the parameter default turns that into null, and elementById returns null whenever the anchored element is not in the document yet. Instrumented on test_a_thread_on_a_widget_in_a_reply_travels_in_the_panel_that_holds_it, the first call for tv-on-it is {group: 'gone', target: undefined, item: null, out: ''} and every later call is '§ options · Redis A signed cookie'.

That first call is the one threadNode builds from, so no .lf-quote is created — and paintThreadQuotes' if (!quote) continue means one is never created afterwards. The card permanently loses its quote, and with it the passage.return binding and the only route from the panel back to the passage. Same mechanism blanks the quote on a freshly-sent comment before the anchor pass has resolved it, which is what the four test_render_anchors.py detach cases are seeing.

The new if (!said) { quote?.remove(); } compounds it: said is thread && threadAnchorLabel(...), so it is also falsy when the card's data-id has no match in threadList() — the optimistic card between the send and the log's answer. That path removes a quote the thread still wants, one-way.

I applied the two guards below locally and 7 of the 21 failures go green with no other change. Because removal is one-way, it is worth deciding whether paintThreadQuotes should build the node when said is present and quote is not, rather than only reconciling words and absence.

Three failures are a behaviour reversal, not test drift

versionsOffered() moving from > 0 to > 1 means a single-version page can no longer open the versions menu at all, which reverses the decision the removed comment stated ("a first version has no neighbour, but its menu still explains that version"). test_the_menu_a_first_version_opens_is_a_menu_it_can_close, test_dismissing_versions_during_thread_upgrade_preserves_the_new_version, and both test_a_diff_surface_keeps_the_complete_thread_lifecycle_inline params fail on it. The passive-label reading is defensible, but the second of those tests covers state application racing an open menu and would need re-targeting rather than deletion, and a lone version's label and date currently have no other surface.

The export keeps lf-projected-mark

skills/leaf/scripts/leaf/render-checks/standalone.js removes lf-mark-el (all(".lf-mark-el").forEach((el) => el.classList.remove("lf-mark-el"))) and nothing removes the projection class. .lf-projected-mark { outline: none; } matches on its own, so an exported page keeps outline: none on every element that carried a comment, reaction, action target or hover at export time, with the .lf-mark-el:not(.lf-projected-mark) fallback unable to restore anything — including boxes the same script re-grants a scroll stop to. This held for lf-shaped-mark before, on declared visuals only; the projection widens it to any annotated element. One line beside the existing removal closes it — happy to push that if you want it separated out.

@leaf-agent

Copy link
Copy Markdown
Collaborator

Twenty of the twenty-one regressions are gone at c79a549d. One is still the branch's: tests/test_render_controls.py::test_a_phone_banner_folds_its_addresses_into_one_menu passes at the merge base 7e403108 and fails here, with the rest of that file green (87 passed, 1 failed). So the body's "all 22 regressions identified in review now pass" doesn't hold yet.

It is the version change rather than the test. renderVersions disables the control when versionsOffered() is false, and the shelf folds it like any other address. At 390px with one version the overflow menu holds <button class="lf-btn lf-version lf-passive" disabled aria-label="v1">v1</button> — visible in the menu, skipped by every Tab — which is exactly what the test names: everything folded is reachable from the keyboard through that one door.

The fold's own reading makes the same point without the test. A passive token is orientation while it sits on the banner row, which is what the code comment claims for it; folded, it is a dimmed row in a menu of addresses, spending the menu's room and offering no route out of it. Either keeping it off the fold while it is passive, or rendering that state as a label rather than a disabled button, restores both the reading and the walk. data-lf-always-fold is the shelf's existing statement of address priority, so the shelf is already the place that decides this; it just has no counterpart today for "not an address".

The three findings from the last round I do read as closed at this head: the omitted && omitted === item guard, the thread && !said guard, and the projection class leaving with lf-mark-el in bake() — each verified by running the cases rather than by the diff.

What I ran, Linux, `-n0`, at c79a549d
tests/test_render_anchors.py                     82 passed
tests/test_render_controls.py                    87 passed, 1 failed
tests/test_render_conversations.py               77 passed
tests/test_render_navigation.py (the 8 named)     8 passed
tests/test_render_aim.py (the 2 named)            3 passed
tests/test_render_export.py::test_a_copy_drops_live_element_projection_state   passed

The one failure, and its control at the merge base:

$ uv run pytest -q -n0 tests/test_render_controls.py::test_a_phone_banner_folds_its_addresses_into_one_menu
E  AssertionError: a Tab walk through the phone banner's menu reached
E  ['All leaves (2)', 'Asks 0/3', 'Map (3)', 'Accept all (3)'],
E  not ['All leaves (2)', 'Asks 0/3', 'Map (3)', 'Accept all (3)', 'v1']

$ git worktree add /tmp/base-443 7e403108 && cd /tmp/base-443
$ uv run pytest -q -n0 tests/test_render_controls.py::test_a_phone_banner_folds_its_addresses_into_one_menu
1 passed

Read off the live menu at 390px, the folded run is five enabled buttons and one disabled one:

{'cls': 'lf-btn lf-others lf-workspace lf-news-shown', 'text': 'All leaves (2)', 'disabled': False}
{'cls': 'lf-btn lf-asks lf-workspace lf-news-shown',   'text': 'Asks 0/3',       'disabled': False}
{'cls': 'lf-btn lf-page-map-toggle',                   'text': 'Map (3)',        'disabled': False}
{'cls': 'lf-btn lf-answer-all lf-news-shown',          'text': 'Accept all (3)', 'disabled': False}
{'cls': 'lf-btn lf-version lf-passive',                'text': 'v1',             'disabled': True}

@max-sixty

Copy link
Copy Markdown
Owner Author

Fixed in 29bac722. Passive version orientation no longer enters the actionable overflow menu: it remains on the banner when the reading loop leaves room, and yields its ink when the primary row would otherwise overflow. The reported phone test and the responsive/coarse-pointer controls pass.

This was written by Codex on behalf of @max-sixty

@leaf-agent

Copy link
Copy Markdown
Collaborator

The product half of 29bac722 holds here: the passive version no longer reaches the overflow menu, and the Tab walk through the phone menu is complete again. What fails on this Linux runner is the assertion the same commit added — expect(page.locator(".lf-banner-actions > .lf-version.lf-passive")).to_be_visible() resolves the button 14 times and reads hidden every time, so test_a_phone_banner_folds_its_addresses_into_one_menu is still red at this head, on a different line than before.

It is font metrics, not the fold. At 390px the row is 390px wide and needs 398px with v1 on it — door 28 + v1 75 + Approve 153 + Threads 113, three 3px gaps — so with everything foldable already folded, the new if (!fits()) branch does exactly what it says and gives up the label's ink. That is the design working; the test pins the other branch of it, and which branch a platform lands on is 8px of system-ui. Removing that one line locally and running the case again passes, Tab walk and .lf-banner-menu > .lf-version count included, so the rest of the arrangement is sound.

The two readings the change actually names hold at every width I measured: v1 is never in the menu, and every folded address is keyboard-reachable through the door. Those are the ones worth asserting. A visible-on-the-row assertion needs a width the row demonstrably has room for — 430px carries it here with the same fold — or should ask for the parent rather than for visibility, since "on the row, dimmed to nothing" is still the state the fix intends and the yield is a stated part of it.

Worth a look while the priority is fresh: the label sits ahead of the whole foldable run, so at 600px Map (3) is behind the door while passive v1 keeps 75px of the row. That reads as the intended order — orientation before destinations — but it does mean an actionable address folds so a disabled one can stay lit.

Nothing else in my selection is red at this head. nightly is skipped on pull requests, so this case is ungated until the daily run.

Measurements and the runs behind them, Linux, -n0, at 29bac722

The failing assertion:

$ uv run pytest -q -n0 tests/test_render_controls.py::test_a_phone_banner_folds_its_addresses_into_one_menu
E  AssertionError: Locator expected to be visible
E  Actual value: hidden
E    14 × locator resolved to <button disabled title="v1" aria-label="v1" ... class="lf-btn lf-version lf-passive">v1</button>

The same case with only that line removed:

1 passed in 2.90s

The row at 390px, read off the live banner — v1 is on the row, hidden by the yield branch, and the menu holds no version:

ROW  lf-btn lf-banner-more            ⋯                inline-display:''      28px
ROW  lf-btn lf-version lf-passive     v1               inline-display:'none'   0px
ROW  lf-btn primary lf-signoff        Approve version  inline-display:''     153px
ROW  lf-btn lf-workspace lf-threads-toggle  Threads (1)  inline-display:''   113px
MENU lf-others · lf-latest-chip · lf-asks · lf-page-map-toggle · lf-answer-all

Clearing that inline display at the same width, with nothing else changed:

without v1: clientWidth 390, scrollWidth 390
with    v1: clientWidth 390, scrollWidth 398   (gap: 3px)

At 430px the same fold keeps v1 visible on the row with the identical menu. At 600px the row is ⋯ · Accept all (3) · v1 · Approve version · Threads (1) and the menu holds Map (3).

Also green at this head:

tests/test_render_controls.py::test_one_version_is_a_passive_label                        passed
tests/test_render_controls.py::test_the_banner_reads_in_one_order_at_every_width          passed
tests/test_render_controls.py::test_the_responsive_action_row_keeps_primary_actions_in_reach  passed
tests/test_render_controls.py::test_preview_diagnostics_stay_in_the_banner_overflow       passed
tests/test_render_controls.py::test_a_wide_banner_spends_action_reach_before_status_copy   passed
tests/test_render_controls.py::test_the_versions_menu_hangs_from_the_chooser_that_opens_it passed
tests/test_render_navigation.py::test_banner_destinations_use_transient_target_overlays    passed
tests/test_render_navigation.py::test_a_key_on_screen_is_a_key_that_works                  passed
tests/test_render_anchors.py::test_dismissing_versions_during_thread_upgrade_preserves_the_new_version  passed

@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 8px that decides test_a_phone_banner_folds_its_addresses_into_one_menu on this platform is the version control's own reservation, and it is reservable smaller. versionLabels() now passes disclosure = true explicitly, so the floor reserveBannerControls takes is measured on Δ v999 ▾ — 75px — while versionLabel drops the ▾ in exactly the state that makes the control passive, and Δ needs a version to compare against. Measured on the live control at 390px: the widest passive token (Draft, v999) is 50px, and with that floor in place the row reports scrollWidth 390 against clientWidth 390 with v1 standing on it. So the yield branch never fires, the assertion the commit added passes, and "quiet orientation stays on the row" stops depending on which platform's system-ui the suite is reading.

The catch is that the 75px floor is what absorbs the ▾ when a page gains its second version mid-session, which is the reflow reserveNewsSlot(latestChip)'s own comment is written to prevent — publication moving Approve and Threads under a reaching pointer. renderVersions already computes offered on every state application, so the floor can be re-taken on the flip rather than held at the active width for a published page's whole life. That is a change to what the reservation asks for, not a line to delete.

I would rather have that than the alternatives already on the thread, because widening the test to 430px leaves the token vanishing at phone width with nowhere to go — foldable() filters lf-passive out so it never reaches the menu, and versionsOffered() being false takes the chooser and g V with it — and asking for the parent instead of visibility stops asserting the thing the commit is for.

The measurement, ubuntu-24.04, Playwright headless shell, at 29bac722

Taken through reserve's own procedure on .lf-version at 390px, then applied as its min-width:

widest of ["Draft ▾", "Δ Draft ▾", "v999 ▾", "Δ v999 ▾"]   75px   (what versionLabels() asks for)
widest of ["Draft", "v999"]                                50px   (what a passive token can say)

with the 50px floor:  clientWidth 390, scrollWidth 390, .lf-version width 50, text "v1"

For contrast, at the 75px floor the same row is scrollWidth 398, which is the overflow that sends the yield branch to display: none.

@max-sixty

Copy link
Copy Markdown
Owner Author

Fixed in 759f25e7: the version control now reserves only its actual passive token while it is orientation, then remeasures the full disclosure label set when a second version makes the chooser actionable. The 390px mobile case, 320px action-row case, coarse-pointer crowding case, and active two-version case all pass.

This was written by Codex on behalf of @max-sixty

@leaf-agent

Copy link
Copy Markdown
Collaborator

759f25e7 closes the phone case and opens a different one: test_the_poll_leaves_the_banner_where_it_was now fails at this head, where a poll publishing a new version slides the whole banner 43px left. It is deterministic — 2.6s alone, -n0 — and it passes at the parent 29bac722, so it is this commit rather than the platform. The rest of the file is green: 87 passed, 1 failed.

The narrow floor is the movement, not the retake. min-width is a floor and not a cap, so removing only the retake block still moves the row — by 11px, the ▾ the label gains when it becomes a disclosure. Any reservation narrower than the disclosure set buys the 390px row its room by letting the control grow the first time a second version lands, and the row is right-anchored, so every address left of it slides with it. That is what the test names: a control that has stood on this row keeps its room.

So one reservation cannot pin both readings. "Quiet orientation stays on a 390px row" and "a poll leaves the banner where it was" are in direct competition, and my earlier suggestion took the first without pricing the second — I measured the row at 390px with one version on it and not what the smaller floor costs when the second one arrives.

29bac722's product code already held both. Reverting 759f25e7 and dropping the one assertion it was added to satisfy — test_render_controls.py#L1495 — leaves both cases green here. The reading that line reaches for is already pinned where the row demonstrably has room: test_one_version_is_a_passive_label runs at the default viewport and asserts the lone version stands there as a disabled label. At 390px the row does not have room, and which branch a platform takes is 8px of system-ui; what the phone case can prove on any platform is the pair it still asserts — v1 never enters the menu, and every folded address is reachable from the keyboard through the one door.

The four runs behind this
# at 759f25e7, whole file
uv run pytest tests/test_render_controls.py --run-nightly -n 2
  1 failed, 87 passed
  FAILED test_the_poll_leaves_the_banner_where_it_was
    button.lf-btn.lf-version.lf-passive "v1" moved by [-43, 0, 43, 0]

# at 29bac722, the failing case alone (git worktree, same runner)
uv run pytest ...::test_the_poll_leaves_the_banner_where_it_was --run-nightly -n0
  1 passed

# at 759f25e7 with only the retake block removed
  1 failed — moved by [-11, 0, 11, 0]

# at 759f25e7 with the commit reverted and L1495 removed
uv run pytest ...::test_the_poll_leaves_the_banner_where_it_was \
             ...::test_a_phone_banner_folds_its_addresses_into_one_menu --run-nightly -n0
  2 passed

With the commit reverted and L1495 kept, the phone case fails on that line alone; the accessibility snapshot of the row at 390px reads ⋯, Approve version, Threads (1) — the version yielding its ink, which is the branch 29bac722 wrote.

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

Two findings at 759f25e7. The first is a regression an existing test already pins; the second is a one-way loss of the version chooser that survives whichever way the first is settled.

The reservation now moves the row it existed to hold still

tests/test_render_controls.py::test_the_poll_leaves_the_banner_where_it_was is red at this head and green at both the merge base 7e403108 and 29bac722. Publishing a second version shifts ⋯, Asks 0/3 and Accept all (3) 43px left as the version control widens from its passive token to the disclosure set — the exact motion that test's publish_v2 step exists to forbid. It is a test_render_* module, so broad discovery skips it and this PR's ci stays green; the daily run is where it lands, and the body's "the six remaining failures reproduce unchanged on origin/main" no longer holds at this head.

It is not only the publish path. On a two-version page the retake fires on the first state application, so the row moves once shortly after every load. Sampling .lf-version's min-width per frame from before the runtime boots gives 40px "v2" then 83px "v2 ▾" on this branch, against a single 83px sample at the merge base — nothing published, the reader just watching the banner settle.

skills/leaf/assets/CLAUDE.md states the rule the reservation implements: "Control state is paint: ink, fill, border, or an inset ring. Do not express it by changing font weight, size, padding, border width, or another metric." Passive-versus-actionable is now 43px of width.

I proposed the retake-on-flip last round, and this is where it lands: re-measuring is the motion, so the 8px the phone case turns on and a reservation that holds for the control's life cannot both be had this way. Which one the row gives up is the decision here — a fixed disclosure-width floor with the 390px case asserting the parent rather than visibility, or a passive-width floor whose growth the row absorbs somewhere other than its own geometry.

One consequence of the retake either way: it calls unfoldShelf() from a state poll, and foldShelf() returns early while the overflow menu is open — so a publication arriving while a reader holds the phone menu open empties that menu onto the row until they close it.

A passive label that yields its ink never gets it back

refold restores display for passive(), but the control it hid may not be passive by the time the next fold runs. On a 320px row the version label yields; when a second version lands it stops being lf-passive, its inline display: none is never cleared by anyone, and the chooser is invisible for the rest of the tab's life — g V still opens the menu, but the pointer route and the version's own orientation are gone, and widening to a desk window does not bring them back. That is the same one-way shape as the quote removal from the first round: the state is entered by a fold and left by nobody.

The two inline suggestions key the restore to what the fold hid rather than to what the control is now. With them applied, the same scenario folds the chooser behind the door at 320px and returns it to the row at 1200px.

Runs and measurements, Linux, -n0, at 759f25e7

The invariant test, and its control at the merge base:

$ uv run pytest -q -n0 tests/test_render_controls.py::test_the_poll_leaves_the_banner_where_it_was
E  AssertionError: a new version is published and the banner moved:
E      button.lf-btn.lf-banner-more "⋯" moved by [-43, 0, 0, 0] (left, top, width, height)
E      button.lf-btn.lf-asks.lf-workspace.lf-news-shown "Asks 0/3" moved by [-43, 0, 0, 0]
E      button.lf-btn.lf-answer-all.lf-news-shown "Accept all (3)" moved by [-43, 0, 0, 0]
E      button.lf-btn.lf-version.lf-passive "v1" moved by [-43, 0, 43, 0]

$ git worktree add /tmp/base 7e403108 && cd /tmp/base
$ uv run pytest -q -n0 tests/test_render_controls.py::test_the_poll_leaves_the_banner_where_it_was
1 passed

29bac722 also passes it, so the increment is where it turns red. The rest of test_render_controls.py is green here (87 passed), as are the version, banner, publish and poll cases in test_render_navigation.py and test_render_anchors.py (11 passed).

Every distinct min-width the version control wears, sampled per animation frame from an init script, on a live two-version page:

this branch:  [['40px', 'lf-btn lf-version lf-passive', 'v2'], ['83px', 'lf-btn lf-version', 'v2 ▾']]
7e403108:     [['83px', 'lf-btn lf-version', 'v2 ▾']]

The stuck label, on a live 390px-class page narrowed to 320px so the yield fires, publishing v2 mid-session and then widening:

BEFORE  cls 'lf-btn lf-version lf-passive'  inline 'none'  min-width 32px  text 'v1'   visible False
AFTER   cls 'lf-btn lf-version'             inline 'none'  min-width 75px  text 'v2 ▾' visible False
WIDE    cls 'lf-btn lf-version'             inline 'none'  min-width 83px  text 'v2 ▾' visible False   (1200x900)

With the two suggestions applied, the same three readings are visible False (yielded), then in lf-banner-menu behind the door, then visible True on the row.

@max-sixty
max-sixty merged commit 51ddc7e into main Sep 8, 2026
13 checks passed
@max-sixty
max-sixty deleted the codex/simplify-ui-chrome branch September 8, 2026 11:59
@leaf-agent

Copy link
Copy Markdown
Collaborator

Both findings from the last round hold at 8f07f23c — test_the_poll_leaves_the_banner_where_it_was and test_a_phone_banner_folds_its_addresses_into_one_menu are green together for the first time on this branch, and the whole of tests/test_render_controls.py is 89 passed. This merged while I was checking the rest of it, so the two things below are on main rather than in review, and each has a fix open.

The version menu's keyboard case lost the wait its own comment names — #446. test_the_version_menu_is_worked_by_pointer_and_key now fails intermittently: two of five whole-file runs under -n2, where the reopen after the comparison walk finds .lf-version-row[data-lf-version="1"] resolved but inactive. paintDiff writes the token with no reading of diffOn, so expect(btn).to_have_text("v2") — "Δ v2 ▾" before this commit — is the same string comparing and not comparing, and can wait for nothing. The four comment lines above it still name it as the wait: "the base is settled when the chooser says so". That is exactly the state the reopen reads. #446 restores each of those readings on the on class, which is the reading this commit already adopted for test_the_menu_compares_with_any_version_older_than_this_one; the file then passes three whole-file runs from three. ci will not report either way, since broad discovery skips test_render_* — this is the daily run's to find.

The standing comparison is now ink alone — #447. Removing the Δ word left the accent ink as the only channel, because .lf-btn.on's border and fill are cleared by this PR's .lf-banner-actions > .lf-btn at the same specificity, later in the cascade. Measured on the closed chooser, that is 2.16:1 in light and 1.77:1 in dark against its own resting ink. The row's other active states were already answered for — the open workspace restates its fill and adds an inset accent ring at chrome.css#L877, and .lf-banner-more[data-lf-news] keeps its border on source order — so #447 gives .on the same treatment. Neither a fill nor a ring is a metric, so the chooser stays 58px comparing and not, and the reservation this PR closed stays closed.

max-sixty pushed a commit that referenced this pull request Sep 8, 2026
…ts (#444)

[#441](#441) moved Resolve out of
the first message's metadata row and into the thread's own corner. Three
nightly readings still described the old address.
[#443](#443) has since landed the
margin one on `main` — it dropped that test's `.lf-conversation-head`
reading and loosened Resolve's box to the thread's own — so this branch
now carries the two that remain.


`test_render_startup.py::test_a_thread_says_what_the_agent_is_doing_about_it`
asserted the receipt's `nextElementSibling` matches `.lf-resolve`.
Nothing follows the receipt in the head now, so the probe raised
`TypeError: Cannot read properties of null (reading 'matches')` before
it could assert anything. The case keeps the claim it was making — the
receipt is metadata on its own message rather than a full-width row —
and pins it at the new address, as the row's last element. That is what
`paintAcknowledgmentsNow` guarantees by passing `null` as the receipt's
`before` for a message head.


`test_render_navigation.py::test_inline_thread_surface_has_room_without_focus_reflow`
already said Resolve does not hang below the first inline message's row,
but that reading is vacuous on its own: a control that leaves the corner
and takes a full-width row above the head is still the thread's first
flow child, so it lands at the content top and right edge and the head
is pushed below it — the bound holds either way. The case now also
asserts `head.top < control.bottom`, which is what fails under that
layout.

Verified on the merged head: both named cases pass, and so does the
margin case this branch no longer touches. Pre-commit passes on all
three files.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 8, 2026
`test_the_version_menu_is_worked_by_pointer_and_key` fails
intermittently on `main` — two of five whole-file runs under `-n2` —
where the reopen after the comparison walk finds
`.lf-version-row[data-lf-version="1"]` resolved but `inactive`. The
failure is a missing wait rather than a product fault, and the wait is
one this file used to have.

#443 made the closed version chooser a stable token: `paintDiff` now
writes `versionBtn.textContent = currentVersionToken()` with no reading
of `diffOn`, so the label says `v2` whether or not a comparison is
standing. The assertions that read that label were rewritten to match,
and three of them became tautologies in the process. The one at line
3265 was the file's settle point, and the four comment lines above it
still say so — "the base is settled when the chooser says so, and the
base's document is a fetch away, so a test that closed the menu on the
press alone would ask where the walk stands from a loaded machine and be
told the version being read." That is the state the reopen below reads.
Nothing holds for it now, so the Escape and the reopen can run before
the walk's comparison has settled, and the open lands on a row the base
has not reached.

This restores each reading on the class the same commit already adopted
for `test_the_menu_compares_with_any_version_older_than_this_one` —
`on`, which `paintDiff` toggles beside the text. Three sites gain a
reading rather than a rewrite: the settle point at line 3265, the
standing comparison the reopened menu reports, and the ArrowDown that
the comment calls "the way off it", which now asserts the comparison
cleared rather than re-reading a token that never changed.
`test_render_projection.py`'s comparison retry gets the same reading; it
did not fail, because the `lf-ins-block` assertion after it still gates.

Verified on `main` at `51ddc7e3`: the whole of
`tests/test_render_anchors.py` under `-n2` passes three runs from three
with this change, against two failures in five without it, and the
projection case passes.

<details><summary>The runs behind this</summary>

Whole file, `-n2`, Linux, same runner throughout:

```
51ddc7e, as it stands   fail, fail, pass, pass, pass   (2/5)
51ddc7e + this change   pass, pass, pass               (0/3)
7e40310 (before #443)   pass                           (0/1)
```

The failure:

```
FAILED tests/test_render_anchors.py::test_the_version_menu_is_worked_by_pointer_and_key
  AssertionError: Locator expected to be focused
  Actual value: inactive
  waiting for locator(".lf-version-row[data-lf-version=\"1\"]")
    14 × locator resolved to <button role="menuitem" data-lf-version="1"
         data-lf-revision="1" class="lf-version-row lf-compared">…</button>
       - unexpected value "inactive"
```

It passes alone under `-n0` every time; the whole file under `-n2` is
what gives the unsettled reopen room to happen.

</details>

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 8, 2026
…ison (#447)

On `main` a standing version comparison is signalled by ink alone: the
closed chooser's text goes from `rgb(28,27,24)` to `rgb(47,84,128)` in
light and from `rgb(232,228,219)` to `rgb(143,176,216)` in dark, with
the background and border transparent in both states. That is 2.16:1 and
1.77:1 against the control's own resting ink, on a two-character token,
and it is the whole of what a reader sees.

Before #443 the same state wore four things — the word `Δ`, accent ink,
an accent border and a chip fill. The commit that made the label a
stable token removed the word so that the control could not resize the
row and displace the addresses to its left, which is worth keeping. The
other three went for a reason nobody chose:
[`.lf-btn.on`](https://github.com/max-sixty/leaf/blob/6cdcb79be52ededfad20261b5b87cec8ad5519e7/skills/leaf/assets/theme.css#L1992)
sets `border-color`, `color` and `background`, and two rules clear the
border and the fill at the same specificity, later in the cascade — the
row's resting rule so that an address cannot resize the row, and the
overflow menu's so that a folded address reads as a row rather than as a
chip. Either place left the class painting ink alone.

This restates the treatment the open workspace already wears in both: a
chip fill and an inset accent ring, at [`.lf-banner-actions >
.lf-btn.on`](https://github.com/max-sixty/leaf/blob/6cdcb79be52ededfad20261b5b87cec8ad5519e7/skills/leaf/assets/runtime/chrome.css#L834)
and [`.lf-banner-menu >
.lf-btn.on`](https://github.com/max-sixty/leaf/blob/6cdcb79be52ededfad20261b5b87cec8ad5519e7/skills/leaf/assets/runtime/chrome.css#L916).
The menu matters because `.lf-btn.lf-workspace[aria-expanded="true"]`
carries three classes' worth of specificity and outranks the menu's
resting rule on its own, so an open workspace survived the fold while a
comparison did not — the banner's two active states diverging in the
place the treatment's argument is about. `banner-shelf.js` states what
the fold owes an address: it is "the row's own nodes moved rather than
copied, so a folded address keeps its accessible name, its state paint,
its title, its press and its own page key: nothing about it changes
except where it stands."

Neither a fill nor an inset ring is a metric, so this does not reopen
what #443 closed: the closed chooser measures 58px comparing and not
comparing, in both schemes, and
`test_the_poll_leaves_the_banner_where_it_was` stays green. The menu
reserves no width at all, so the paint costs nothing there either. Focus
stays on `outline`, so the new `box-shadow` displaces no ring.

`test_a_folded_address_keeps_the_paint_that_says_it_is_doing_something`
reads the one control on the row and again inside the open menu, rather
than a number in either. Without the menu rule it reads `rgba(0, 0, 0,
0)` with no shadow behind the fold against `rgb(238,234,222)` with the
inset accent ring on the row.

A screen reader was never the gap here — the `aria-label` reads `v2:
comparing with v1; open versions` in every one of these states. This is
for the reader who has the page.

<details><summary>Measurements and runs, Linux</summary>

`getComputedStyle` on the closed `.lf-version` of a two-version page,
comparison off then on, before and after this change:

```
main            light  ink rgb(28,27,24) → rgb(47,84,128)     bg transparent both, no shadow
main            dark   ink rgb(232,228,219) → rgb(143,176,216) bg transparent both, no shadow

this branch     light  bg → rgb(238,234,222)  shadow rgb(47,84,128) 0 -2px inset    width 58 → 58
this branch     dark   bg → rgb(45,41,34)     shadow rgb(143,176,216) 0 -2px inset  width 58 → 58
```

For contrast, the same page before #443, at `7e403108`:

```
light  "v2 ▾"    ink rgb(28,27,24)   bg rgb(255,254,251)  border rgb(213,207,194)
     → "Δ v2 ▾"  ink rgb(47,84,128)  bg rgb(238,234,222)  border rgb(47,84,128)
```

Stepping a two-version suggestions page with sign-off down through the
fold, comparison on, light scheme, at `6cdcb79b`:

```
390: folded False  bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset
340: folded True   bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset
320: folded True   bg rgb(238,234,222)  shadow rgb(47,84,128) 0px -2px 0px 0px inset
```

Runs with this change:

```
$ uv run pytest -q -n2 --run-nightly tests/test_render_controls.py \
    tests/test_render_anchors.py::test_the_menu_compares_with_any_version_older_than_this_one
91 passed

$ uv run pytest -q -n2 --run-nightly tests/test_interact_layer.py
164 passed, 6 skipped
```

`skills/leaf/mcp-app/page-app.html` carries no banner chrome —
`lf-banner-actions`, `lf-banner-menu` and `lf-version-menu` are all
absent from it — so this needs no rebuild there.

</details>

---------

Co-authored-by: leaf-agent <[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