Skip to content

fix: inject the margin's commit into reply continuity - #4483

Merged
max-sixty merged 1 commit into
mainfrom
fix-margin-commit
Oct 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix-margin-commit

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

#3864 made reply continuity wait for the margin's own DOM commit
(regionCommitted("annotations")) and said that a widget holding its
commit, as through a drag, no longer kept a displaced reply editor
waiting. That holds only when the margin owes no repaint. A region's own
commit (presenter.committed in framework/presentation.js) resolves in
its paint, and collect runs the paint only after the DOM its after
names, which for the margin is obligations, thread, projection and the
widgets. When an editor is displaced the margin usually repaints, so a
held widget still delays continuity. A scratch runtime test confirmed it:
a margin claimed while a widget holds its commit doesn't commit until the
widget does.

What changed

  • applicationPresenter returns committed, its region's own DOM
    commit, and its header says when that settles: at once when the region
    owes no paint, otherwise after everything upstream.
  • application.js passes the margin presenter's committed into
    createThreadPresentation as marginCommitted, which continuity
    awaits. This replaces the string-keyed regionCommitted and its
    ownCommits map, which had this one caller.
  • PRESENTATION_DOM.annotations, added by Draw the margin once per thread pass #3864, is deleted: nothing in
    production read it, only the test.
  • The comment in thread/presentation.js now says a repainting margin
    still waits for its upstream, so a held widget delays continuity then.
  • The runtime test is renamed to the case it covers, a region owing no
    paint, and reads the region's committed and the margin's after
    chain directly.

Whether continuity should skip held widgets when the margin repaints is
left open; this change only makes the code and its comments agree.
#3864's tick() helper and its eslint rule stay.

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

#3864 made reply continuity wait for the margin's own DOM commit
(`regionCommitted("annotations")`) and said that a widget holding its
commit, as through a drag, no longer kept a displaced reply editor
waiting. That holds only when the margin owes no repaint. A region's own
commit (`presenter.committed` in `framework/presentation.js`) resolves in
its paint, and `collect` runs the paint only after the DOM its `after`
names, which for the margin is obligations, thread, projection and the
widgets. When an editor is displaced the margin usually repaints, so a
held widget still delays continuity. A scratch runtime test confirmed it:
a margin claimed while a widget holds its commit doesn't commit until the
widget does.

## What changed

- `applicationPresenter` returns `committed`, its region's own DOM
  commit, and its header says when that settles: at once when the region
  owes no paint, otherwise after everything upstream.
- `application.js` passes the margin presenter's `committed` into
  `createThreadPresentation` as `marginCommitted`, which continuity
  awaits. This replaces the string-keyed `regionCommitted` and its
  `ownCommits` map, which had this one caller.
- `PRESENTATION_DOM.annotations`, added by #3864, is deleted: nothing in
  production read it, only the test.
- The comment in `thread/presentation.js` now says a repainting margin
  still waits for its upstream, so a held widget delays continuity then.
- The runtime test is renamed to the case it covers, a region owing no
  paint, and reads the region's `committed` and the margin's `after`
  chain directly.

Whether continuity should skip held widgets when the margin repaints is
left open; this change only makes the code and its comments agree.
#3864's `tick()` helper and its eslint rule stay.
@max-sixty
max-sixty merged commit a881369 into main Oct 27, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix-margin-commit branch October 27, 2026 18:05
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