Skip to content

Keep banner targets fixed when approval arrives - #1638

Merged
max-sixty merged 5 commits into
mainfrom
codex/remove-layout-shift-waivers
Oct 3, 2026
Merged

max-sixty merged 5 commits into
mainfrom
codex/remove-layout-shift-waivers

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

When a live revision first offers Approval, the banner currently makes room by moving Threads and More; at intermediate widths it adds a row and shifts the reading passage. Reserve the complete toolbar's capacity before first paint, using one CSS allocation for the actual banner and the document's clearance. Approval can then arrive or disappear without moving the status region, existing controls, or page content.

Place More at the trailing edge and open its menus inward. Shorten the visible thread count to Threads: n, retaining the full accessible name and unread details. The row count and height follow viewport width, interface type size, and touch target size. Intermediate windows reserve two rows even when Approval is absent; that extra room buys stationary targets without a detector exception or runtime measurement of toolbar capacity.

Make the shared label reservation a measured preferred width consumed by CSS, rather than an unconditional minimum. Approval can ellipsize inside the remaining toolbar room at 320px with enlarged text or wider platform fonts, keeping its full accessible name and 44px touch target. CSS still stretches reserved bulk-answer controls across their menu rows, and Threads and More keep their reservations.

Native browser regressions cover arrival and removal across eleven desktop, narrow, breakpoint, enlarged-type, and touch configurations, including resting pointer, keyboard focus, menu access, and matching page clearance. Reverting the production fix makes both the desktop and intermediate-width regressions fail; the added 320px/20px case reproduced the font-capacity overflow locally before the repair. All 16 focused browser cases, including full menu hit rows and copy feedback, and all 194 runtime tests pass. Before the shared-reservation repair, the local gate also passed 1,657 everyday tests, 43 edited nightly cases, 74 browser-framework tests, and 66 Worker tests. Catalogue states were compared and the published previews refreshed. Served startup comparisons add no requests.

This was written by Codex on behalf of max-sixty

Allocate toolbar room independently of authored approval capability. The theme derives row count and early page clearance from the same type-aware capacity; actual control heights share that reservation. Put More after the reading loop and hang menus inward from that stable trailing target.

Shorten visible Open threads to Threads, retaining the full accessible open-thread count and unread details. Browser tests now protect approval arrival and removal, resting pointer and focus, menus, enlarged UI type and touch targets, without shift exemptions.

@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 fixed toolbar allocation does not hold its controls at the 320px touch and enlarged-type size that this PR includes. I ran tests/test_chrome_contracts.py::test_approval_capability_changes_keep_banner_targets[320-True-16] twice; both runs reported Threads and More moving 13px when Approval arrived, and More ended at x=330 outside the 320px viewport. The arrival still moves a target under the user's aim and makes part of More unreachable. The second-row layout needs enough room for the complete control run at that type and touch-target size, with its trailing edge inside the viewport, before this stability guarantee holds.

@max-sixty
max-sixty merged commit 506a061 into main Oct 3, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/remove-layout-shift-waivers branch October 3, 2026 03:19
max-sixty added a commit that referenced this pull request Oct 6, 2026
On a phone held upright (window up to 480px wide) the banner is now one
53px row: the status in words, cut short by an ellipsis; Threads as its
comment icon and open count; then More. It was 89px, two rows. Approve
moves into More, where it is the first entry, and More wears its dot
while a press there would approve. A passing notice takes the status
words' place for its four seconds. This builds the decision in
`notes/chrome-and-covers.md` and removes it from `TODO.md` and the note.

The desk banner is unchanged. Probes at 1440, 900, 600 and 481px, with a
mouse and with touch, match `main`: geometry, the Threads words, More's
name and the status press's name. `leaf-dev stills` finds no desk state
changed except sub-pixel text noise outside the banner (triage board
headers, 63 px at 2x; a 1x probe of the same page matches exactly).

## How it works

- **Seats per face** (`banner-toolbar.js`). A banner control can name
one seat per face, `{ desk, phone }`. Approval is `{ desk: "row", phone:
"menu" }`. The toolbar reads the same `(width <= 480px)` query theme.css
and chrome.css use, and reseats when the window crosses it. A
reading-loop control a phone moves behind More leads the menu. `paint()`
now hands focus to a control Lit moved, or to More when More is shut,
because a moved node drops focus.
- **More's dot**. `urgent` on a banner control is the words More's name
adds for it (`"new"` for the latest-version chip, `"approval open"` for
Approval). `paintApproval` marks Approval urgent exactly when a press
would approve, so the dot comes up when the last Ask holding approval is
answered and goes when the user approves.
- **Notice seat** (`notifications.js`, `banner-status-view.js`,
`chrome.css`). Notices used to have one presenter, the bottom status.
Now both seats register, and the `--lf-notice-seat` token in chrome.css
shows the notice in one of them: the banner on a phone, the foot
otherwise. Under a covering surface (`html[data-lf-covering-surface]`)
or in a block sample the notice stays at the foot, since there the
banner is under the scrim or draws no status. In the banner the notice
stands over the status words in one grid cell, takes up to two lines of
the row, and is `aria-hidden`, because the live region has already said
it. The status press keeps its name, and nothing moves.
- **Threads** draws `Threads: 3` on a desk as before. On a phone it
draws the icon, and the count comes from `data-lf-count` in three digits
of reserved room. The unread dot marks the icon's corner, so it doesn't
read as More's.
- **Queue counts** stand down on the phone row and are inert. The status
disclosure and the Queue control in More still say what they count.

## Tests

- `tests/test_render_controls.py`, `tests/test_render_startup.py`,
`tests/test_chrome_contracts.py` and
`tests/test_render_semantic_news.py` pass: 371 passed. The one failure,
`test_each_sampled_focus_ring_is_shown_whole_in_its_surface`, fails the
same way on `main` at 7bd43bc.
- `npm run test:runtime` passes.
- New tests:
- `test_more_wears_a_dot_while_a_press_would_approve`: the dot goes up
and down with approval and undo, and focus crosses 480px with Approval.
  - `test_a_phone_shows_a_notice_in_the_banner_s_status_words`.
-
`test_a_phone_s_one_row_seats_a_finger_s_steps_and_leaves_the_counts_out`.
- The phone tests that expected two rows, or Approval on the row, now
expect one row and Approval at the head of More. The second-row counts
test now runs at 490px, where the banner still has two rows.
- `leaf-dev stills` gains `plan-touch` and `plan-more-touch`. Its
composer driver now waits for Comment under a coarse pointer instead of
racing it.

## Is there a more underlying fix?

No. I ran these candidates:

- A walk standing in the bottom status while a notice shows in the
banner. `standingStatusBoxes` keeps the walk's box at 390 and 1200px.
- The 480/481px boundary. The rows, Approval's seat, the icon and the
counts agree between CSS and JS.
- A covering Queue drawer. The notice stays at the foot.
- A covering thread panel. The notice stays at the foot (test).
- A refused Approval crossing 480px, with More shut and with More open.
This one did fail at first, sending focus to More. It is fixed here at
its cause: `paint()` now asks where the control stands
(`bannerControlDoor`), not whether it takes a press.

History read: the notice's single presenter dates from #731 (the Lit
move), and the toolbar's seat partition from #979 and #1638. Neither
line had been patched for this condition before.

One copy remains: the phone width is written in theme.css, chrome.css
and now `banner-toolbar.js`. Nothing disagrees today.

## Decisions

- **Dot meaning (decided by Max).** More's dot shows only while a press
on Approve would approve. While an Ask refuses approval there is no dot;
it comes up when the last Ask is answered.
- **Long notices (decided by Max).** A notice takes up to two lines
inside the one 53px row, then an ellipsis; the row's height never
changes. At 320px both refusal reasons clamp, and so does "Approved.
Press z to take it back…" at 390px.

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

---------

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