Skip to content

Render notices through Lit - #731

Merged
max-sixty merged 1 commit into
mainfrom
codex/lit-notification-status
Sep 15, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex/lit-notification-status

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

This completes Lit ownership of the bottom-status surface. The notification scheduler no longer creates or paints a borrowed notice element; it publishes one frozen visual reading through a synchronous invalidation door, and the shortcut-bar owner renders the retained Go-to, walk, and notice spans in one template.

The existing foreground/background queue, four-second notice interval, reader-context precedence, same-turn gesture acknowledgement, and independent live-region behavior are preserved. Tests now prove the notice is visible before its initiating event listener returns and that shared repaints, interruption, restoration, and hiding retain every status and live-region node.

Validation: the complete navigation suite (134 passed), chrome and semantic-selection suites (43 passed), browser-framework checks (36 passed), changed-file pre-commit hooks, and a direct keyboard move/drop journey with no console errors or warnings.

This was written by Codex on behalf of max-sixty

@max-sixty
max-sixty merged commit a65f25e into main Sep 15, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/lit-notification-status branch September 15, 2026 09:06
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