Repository navigation
Paint the Threads unread marker over the button instead of beside its label - #974
Merged
Merged
Conversation
… label The marker reserved an inline box at every count, which spent eleven pixels of a banner row measured to seat its primary controls on a 320px phone with nothing to spare. Threads ended up with its right edge at 321px and the row overflowed its own clip, so a phone reader lost the door into Threads whether or not anything was unread. State on this row is paint rather than width everywhere else — the news border on the overflow door, the inset shadow on an open auxiliary toggle — so the dot moves inside the box the button already reserves.
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]>
This was referenced Sep 23, 2026
max-sixty
pushed a commit
that referenced
this pull request
Sep 23, 2026
…eyboard (#996) The nightly suite on [453e957](453e957) ([run 35819929850](https://github.com/max-sixty/leaf/actions/runs/35819929850)) ended with three failures. Two of them were the banner's 320px row and are already fixed on `main`; the third is a race in `test_a_stamped_live_draft_and_its_unstamped_view_keep_distinct_menu_rows` that still reproduces, and this PR repairs it. The case kept the page on revision 2 by filling the Threads panel's general box and leaving the caret in it. That is `midComposition`'s focused-textarea reading, and it ends the moment focus leaves the box — which is exactly what the next line did: every secondary banner control stands behind More, so `banner_control(page, ".lf-version")` presses that door to reach the chooser. Whether the page still showed revision 2 when the menu opened then came down to whether the next state read landed inside that window. When the read won, the page followed to revision 3, and the menu — which deliberately freezes its rows while its popover stands — held three rows against the expected four. `skills/leaf/assets/CLAUDE.md` already settles which hold outlasts a press: a hold defers a revision for a gesture that is not a value — an open composer, a drag, an unresolved delivery, an open menu — and the draft store, not a hold, is what carries a reader's words across an install. Getting there takes both halves of this diff. The case now holds the page with the selection composer, which does not end when focus moves; and it opens More and the chooser from the keyboard, because [`standDown`](https://github.com/max-sixty/leaf/blob/6f73144c3b381082e1f4353f23f61445c78dc637/skills/leaf/assets/runtime/composing/surface.js#L1234) runs on every document `mousedown` and stands the composer down for any target outside `.lf-fab-bar, .lf-react-surface, .lf-composer` — so a mouse press on More would have ended the hold on the very gesture that opens the menu. It also waits on the news the third revision lights (`data-lf-news` on `.lf-version`) rather than on `to_have_title("Live second")`, which the page already carried before the write and so stated no ordering at all. <details><summary>How the three failures were separated</summary> All three were reproduced on this runner against the exact SHAs, with `-n0` and explicit node ids. **The two banner failures were real and are already fixed.** On 453e957 they reproduce with CI's exact numbers: ``` tests/test_render_controls.py::test_the_responsive_action_row_keeps_primary_actions_in_reach AssertionError: .lf-threads-toggle is outside the first 320px view: {'left': 197, 'right': 321, 'width': 124, ...} tests/test_render_controls.py::test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel AssertionError: assert 331 <= (320 + 1) ``` Both pass on [afb2133](afb2133) (#974), which took the unread marker off the Threads button's label and gave the 320px row its 1px back. That landed at 06:14, after this nightly started at 05:57, so the run could not see it. Both also fail on the preceding nightly's commit 54fc744 and pass on every commit from afb2133 onward, including current `main`. **The third failure is this PR's.** It is not deterministic on a quiet machine — 1 failure in 13 local runs of the unmodified case — which is why it appeared in this run and not the one before. Forcing the condition makes it deterministic: inserting `page.evaluate("() => document.activeElement.blur()")` before the `LIVE_V3` write fails the unmodified case on every run, on the merge base [878780e](878780e), reporting the same 3 rows CI reported. The rows it holds name the third revision (`Current · Draft after v2` at `data-lf-revision="3"`), confirming the page had followed rather than held. The repaired case is green at this branch's head, and `uv run pytest tests/test_render_projection.py --run-nightly` was green (152 passed) on the first commit's arrangement. </details> > _This was written by Codex on behalf of max-sixty_ --------- Co-authored-by: leaf-agent <[email protected]> Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a 320px phone the Threads button sat past the window's right edge, at every unread count.
.lf-threads-toggle::afterreserved an inline 6px dot with a 5px inline-start margin whether or not anything was unread, which made the button 124px wide instead of 113px. The banner's primary row is sized to seat its controls on that phone with nothing to spare, so those eleven pixels put the button's right edge at 321px and overflowed the row past its own clip. This paints the marker as an absolutely positioned dot inside the box the button already reserves, so it costs no width at any count — the treatment the rest of that row already uses for state, where.lf-banner-more[data-lf-news]recolours the control's border and an open auxiliary toggle wears an inset shadow, neither of them taking width. Nothing else on the page reads the marker's box, and the reserved-width intent behind the old rule is better served by a dot that is out of flow than by one that is in it.The regression arrived with 642c553, whose nightly
cirun (35803415808) failed 31 browser cases. Twenty-nine of those were readings of contracts that had moved, which #969 and #972 have since repaired. These two are the product regression, and they are the ones still red onmain:test_the_responsive_action_row_keeps_primary_actions_in_reach—.lf-threads-toggle is outside the first 320px view: {'left': 197, 'right': 321, 'width': 124, ...}test_the_banner_uses_the_page_mark_and_puts_each_edge_by_its_panel—{'shown': 320, 'needed': 331, 'pageShown': 320, 'pageNeeded': 320, ...}Both reproduce on
mainatee7f973eand pass with this change.tests/test_render_controls.pyandtests/test_render_navigation.pypass whole (271), andtests/test_render_read_state.pypasses whole (13) — including its assertion that filling and emptying the marker leaves the button's measured width unchanged, which now holds because the marker never enters that measurement. The everyday suite passes 1,332 with five failures this sandbox owns rather than the change: three needAF_UNIX, which it blocks, one reads a umask it does not apply, and one shells out to anesbuildbundle. All five fail identically on unmodifiedmainhere, and CI'stestjob runs them green.Why an overlay rather than making room on the row
The row already carries
max-width: calc(100% - var(--lf-status-floor) - var(--lf-mark-w) - 2 * var(--lf-banner-gap))andoverflow: hidden, withflex: noneon each primary control so a control keeps its words at every width. That arrangement has no slack to give back: widening the cap trades the status sentence's floor for the marker, and narrowing the controls' padding trades the aim floor for it. The marker is not content the reader reads, it is state — so the row's own rule for state, paint on the box the control already holds, is the one that applies.Visual check at 1200px and 320px: the dot reads as a badge over the button's inline-end corner in both, and the button no longer moves when the count fills.