Skip to content

Chrome paints follow what they read - #2830

Merged
max-sixty merged 4 commits into
mainfrom
tracked-region-readings
Oct 14, 2026
Merged

max-sixty merged 4 commits into
mainfrom
tracked-region-readings

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

First step of the full cutover to one reactive norm, where a paint follows the parts of the publication it reads (#2815 and #2822 did the four document regions). This does Leaf's chrome: none of its paints names its inputs by hand or has a reading pushed at it any more.

Chrome paints are watchers. The banner's status, the floating panel, the version picker, the pages drawer, approval and the m key repaint each paint through one watchProjection. The floating panel had two named watchers plus a hand-written selection of the undo list, asks, document, active revision and agent; the status had renderStatus(state) pushed by the state feed plus a hand selection of the queues and agent; the picker and the pages drawer had renderVersions(state) and renderOthers(state) pushed by state application. Their own mechanical inputs (an open menu, a comparison, a press in flight) call the same watcher's refresh(), which now draws the first paint at once when none has run (projection-watch.js).

The server's reach is in the publication. How the server answered the latest read is reach on the root (waiting, reached, unreachable, refused, broken; build/browser/application.ts), set by adoption, the state feed and a failed startup, and it starts no semantic epoch. The status reads it with the reading the page adopted, and pageStatus takes it in place of a null or an Error standing for it.

Derived where read. The status, the versions and approval's words are derived where they are read (statusReading and approvalReading in banner.js, versionsReading in version.js) rather than read back from what the banner and picker last painted, so the floating panel's paint and the banner toolbar's Versions and latest rows follow their own inputs; upgrade and a comparison, which are mechanical, still ask it to paint. The ledger's readings (entry, unpresented, releasable) select their parts instead of reading the whole publication; a handler the pages drawer's paint ran synchronously released pending sends and threw "a collected read took the whole publication".

Evidence. pnpm run check passes; the state feed's Node test now asserts the unreachable and broken reach (and fails with the feed's setReach removed). About 70 focused browser tests pass: banner status (loading, offline, refused, broken, announcements, publication links), floating panel (threads, On, approval, notices, status in the field), version picker and menu, pages drawer, approval, On me counts and the m walk.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 3 commits October 13, 2026 21:33
The banner's status, the floating panel, the version picker, the pages drawer,
approval and the `m` keys each paint through one `watchProjection` now, so a
publication repaints them when a part they read moves, and none of them names
its inputs by hand. Their own mechanical inputs (an open menu, a comparison, a
press in flight) ask the same watcher to paint again through `refresh()`, which
draws the first paint at once when none has run yet.

How the server answered the latest read is in the publication (`reach`:
waiting, reached, unreachable, refused or broken), set by adoption, the state
feed and a failed startup, so the status reads it with the reading it adopted
instead of the state feed and state application pushing each answer at
`renderStatus`, `renderVersions` and `renderOthers`. `pageStatus` takes the
reach in place of a null or an Error standing for it.

Approval's words are derived where they are read (`approvalReading`), rather
than read back from what the banner last painted, so the floating panel's
Versions view follows the approval's own inputs. The ledger's readings
(`entry`, `unpresented`, `releasable`) select their parts instead of reading
the whole publication, which a handler run inside a collected paint would
otherwise refuse.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The panel took the banner's status and the picker's model as each painted
them, so its paint followed those producers rather than the inputs. Both are
derived where read now (`statusReading`, `versionsReading`), and the panel's
watcher follows what they read; upgrade and a comparison, which are mechanical,
still ask it to paint.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/assets/runtime/banner.js
leaf-agent
leaf-agent previously approved these changes Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 3714612 into main Oct 14, 2026
3 checks passed
@max-sixty
max-sixty deleted the tracked-region-readings branch October 14, 2026 05:30
leaf-agent added a commit that referenced this pull request Oct 14, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/38507012987) failed
its preview startup test because the test held the page transaction lock
while waiting for the preview server to stop. Since #2812, stopping
checks the page's claim inside that transaction, so the stop could not
complete and the test never arranged the interrupted fetch it meant to
examine.

The test now aborts its first registry fetch when a runtime edit starts
the preview replacement. It records that the startup notice was visible
even if recovery navigates to a new document, then checks that the
replacement serves the edited theme at the same address. This keeps the
failure and recovery behavior under test without blocking the
claim-guarded stop.

The failing test reproduced on the original `main` tree and passes on
this branch against current `main` (`uv run pytest -q -n0
tests/browser/test_render_export.py::test_a_service_that_goes_away_mid_start_says_only_that_and_comes_back`).
Pre-commit checks pass. The run's other failure, the async projection
wake case, passes on merged #2830 and on current `main`.

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 14, 2026
The floating On panel now titles itself by its active list. Its browser
test still expected the thread view's back link to say “On”; the visible
link says “On me” when the user entered from that list. This PR updates
the assertion to the chosen title and keeps the return navigation check.

The case failed on [main CI run
38512364290](https://github.com/max-sixty/leaf/actions/runs/38512364290)
and passes with this change (`uv run pytest -q -n0
tests/browser/test_render_floating_panel.py::test_on_shows_an_ask_as_its_message_and_reply_comes_back`).
The run's startup and outbox cases pass on current `main`, which
includes #2835 and #2830. Its intermittent margin counter failure
remains tracked in #2793; the focused case passed four times on current
`main`.

Refs #2793

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