Skip to content

Give undo, the root's server view, and state watching one owner each - #1219

Merged
max-sixty merged 3 commits into
mainfrom
agent-aaf8452f2c13d7517
Sep 26, 2026
Merged

max-sixty merged 3 commits into
mainfrom
agent-aaf8452f2c13d7517

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Undo. The server's view of each revision now emits the final list of
gestures that document can take back, and the browser applies no rule of
its own: z takes the head, a widget's Undo filters it to its own entries.
The view drops an approval of another stamp, an action whose widget and
verb the document (or frozen thread markup) does not hold, and a page
action a later revision restated. z no longer requires an action to have
been made on the shown revision, the rule #450 stated for both paths and
#666 dropped from the widget path so carried decisions stay undoable; a
later revision's markup placing the unit is refused at the door
(absorbed), and the restated case is now the view's. z, the widget
undo branch, and reactions withdraw through one withdraw(event) door,
and the controller no longer restates the candidate lookup.

Behaviour that moved:

  • z takes back a decision carried into a later revision, as the
    widget's own Undo already could.
  • z takes back a thread widget's action even while its element is not
    rendered, instead of skipping to an older gesture.
  • A reaction chip withdraws a standing reaction while an unrelated gesture
    is sending or a reading is being applied; like a widget's Undo, it waits
    (with the same notice) only while another accepted action awaits
    presentation or the reaction itself is unsent. The z walk alone needs
    the page settled, since its target is whatever is newest.
  • A widget undo the page refuses now says why.

Server view. The publisher resolves the shown revision's view once, as
effective.view less its transport basis, replacing effective.updates,
publishedAt, and lifecycle. runtime.view, updates.js, the undo walk,
and projection coverage read it. Semantic news now reads page obligations
from the shown revision rather than the active one, so an Ask a waiting
activation adds becomes news when a revision holding it is presented.
state-application's stale() is the publisher's overtaken(state),
which adoptable() also uses.

Watchers. watchAsks is now watchProjection with its own reading, as
watchUpdates and watchHistory already were: first call on the next
microtask, coalesced per microtask, nothing while the owner is
disconnected. It no longer calls synchronously, and it may repeat an
unchanged set. packages.md, projection-watch.js, and updates.js state
that.

COLLAPSE lives in runtime/collapse.js, which passages.js, the composing
modules, and projection/model.js import; the Python parity test reads it
there. passages.py's comment still names leaf.js as its home; that file
is held by another change.

Checks run locally: npm run check:browser, npm run test:browser, npm run test:runtime, pre-commit, tests/test_interact_server.py, tests/test_interact_contract.py, the everyday browser files this touches (test_render_semantic_news.py, test_render_application_boundary.py), and the nightly undo, watcher, and version selections (test_render_outbox.py, test_render_reactions.py, and -k selections of projection, widgets, margin, options, navigation).

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

🤖 Generated with Claude Code

Undo. The server's view of each revision now emits the final list of
gestures that document can take back, and the browser applies no rule of
its own: `z` takes the head, a widget's Undo filters it to its own entries.
The view drops an approval of another stamp, an action whose widget and
verb the document (or frozen thread markup) does not hold, and a page
action a later revision restated. `z` no longer requires an action to have
been made on the shown revision, the rule #450 stated for both paths and
#666 dropped from the widget path so carried decisions stay undoable; a
later revision's markup placing the unit is refused at the door
(`absorbed`), and the restated case is now the view's. `z`, the widget
undo branch, and reactions withdraw through one `withdraw(event)` door,
and the controller no longer restates the candidate lookup.

Behaviour that moved:
- `z` takes back a decision carried into a later revision, as the
  widget's own Undo already could.
- `z` takes back a thread widget's action even while its element is not
  rendered, instead of skipping to an older gesture.
- A reaction chip withdraws a standing reaction while an unrelated gesture
  is sending or a reading is being applied; like a widget's Undo, it waits
  (with the same notice) only while another accepted action awaits
  presentation or the reaction itself is unsent. The `z` walk alone needs
  the page settled, since its target is whatever is newest.
- A widget undo the page refuses now says why.

Server view. The publisher resolves the shown revision's view once, as
`effective.view` less its transport basis, replacing `effective.updates`,
`publishedAt`, and `lifecycle`. `runtime.view`, updates.js, the undo walk,
and projection coverage read it. Semantic news now reads page obligations
from the shown revision rather than the active one, so an Ask a waiting
activation adds becomes news when a revision holding it is presented.
state-application's `stale()` is the publisher's `overtaken(state)`,
which `adoptable()` also uses.

Watchers. `watchAsks` is now `watchProjection` with its own reading, as
`watchUpdates` and `watchHistory` already were: first call on the next
microtask, coalesced per microtask, nothing while the owner is
disconnected. It no longer calls synchronously, and it may repeat an
unchanged set. packages.md, projection-watch.js, and updates.js state
that.

`COLLAPSE` lives in runtime/collapse.js, which passages.js, the composing
modules, and projection/model.js import; the Python parity test reads it
there. passages.py's comment still names leaf.js as its home; that file
is held by another change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Sep 26, 2026
# Conflicts:
#	scripts/browser/generated/browser-runtime.js.map
#	scripts/browser/generated/browser-runtime.manifest.json
#	skills/leaf/assets/vendor/browser-runtime.js
leaf-agent
leaf-agent previously approved these changes Sep 26, 2026
# Conflicts:
#	skills/leaf/scripts/leaf/served_state/browser.py
@max-sixty
max-sixty merged commit 6e93541 into main Sep 26, 2026
5 checks passed
@max-sixty
max-sixty deleted the agent-aaf8452f2c13d7517 branch September 26, 2026 17:32
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