Repository navigation
Keep live revisions flowing through retained editing sessions - #2179
Merged
Merged
Conversation
Whole-page composition holds kept Questions at zero until an anchored composer closed. Admit an in-place revision when the authored patch proves that every native editor and complete pending anchor scope survives. Reuse its matching and widget ownership rules, checking both logical and physical owners of moved nodes. Reloads and destructive edits still wait for composition. Source insertions exposed a missed margin geometry dependency: hear child-list changes in measured layout and settle marker coordinates at the script checkpoint before scroll restoration can paint stale placement. Selections, generated shadow controls, and emptied replies now follow unrelated revisions. The old-realm state test explicitly changes executable identity to exercise a real reload. Update the authoring contract. Validated with focused browser journeys, 282 runtime tests, pre-commit, and a served startup comparison with no added code requests.
leaf-agent
approved these changes
Oct 9, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 10, 2026
The retained draft editor follows an unrelated authored change immediately after #2179. Verify its empty value and focus through that revision, then reload and save it as an absolute edit.
leaf-agent
added a commit
that referenced
this pull request
Oct 10, 2026
The retained draft editor follows an unrelated authored change immediately after #2179. Verify its empty value and focus through that revision, then reload and save it as an absolute edit.
leaf-agent
added a commit
that referenced
this pull request
Oct 10, 2026
[#2179](#2179) lets unrelated authored revisions arrive while retained editors hold unsent words. Two browser journeys still expected those revisions to wait: one for a page comment editor in runtime chrome, another for an empty draft editor whose authored node is retained. They now check immediate adoption while each editor keeps its value and focus. The comment journey still checks the live URL and retired attributes; the draft journey still reloads and saves the empty value as an absolute edit. Both original cases failed on `main` before this change. Their revised cases passed: `uv run pytest tests/test_render_drafts.py::test_an_empty_draft_survives_reload_and_a_live_revision tests/test_render_projection.py::test_the_live_page_retains_a_page_comment_while_adopting_revisions -q -n0`. This addresses two failures in [main CI run 38013241865](https://github.com/max-sixty/leaf/actions/runs/38013241865). --------- Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Questions stayed at zero while a comment composer, native selection, or typed reply held the entire authored revision. Live revisions now arrive during editing when the source patch preserves the native editor and the complete anchor scope of a pending comment or selection.
The retention proof uses the DOM patcher's existing matching and widget ownership rules. It covers ordinary authored controls, panel replies, and thread mirrors mounted in unchanged page containers, including authored nodes a module moves elsewhere. Changed anchor scopes and replaced editors still defer activation; executable changes still wait for composition before reloading. Update the authoring contract and the tests that previously required unrelated revisions to wait.
Margin placement now invalidates its geometry when source insertions change a target's containing layout. This keeps its marker synchronized with the existing scroll restoration that preserves the inline editor, reading passage, and resting pointer.
Validation: all 282 runtime tests pass. Focused browser journeys cover Questions changing 0 → 3 → 0, exact editor/focus/caret retention, native selections, replies after Tab, removed source anchors, ambiguous quotes, and reload deferral. Independent browser review also exercised a canonical reply mounted in a plain Element container; desktop and narrow-screen checks preserve reading, editing, pointer, and marker positions. Runtime tests cover shadow owners, generated editors, and authored nodes moved outside main or into another source owner. Startup comparison adds no code requests and about 5 KB of source bytes before presentation; mutation placement must settle before paint to prevent displaced markers.