Repository navigation
Preserve unfinished comments across target and revision changes - #2650
Merged
Merged
Conversation
Explicit reveal uses the shared window posture while a subject is hidden, and that posture survives replacement of the subject node. Withheld surfaces retain their observation owner so a visibility-only return restores the native editor. Retain the canonical resolved datum after its quote changes. Persist the anchor capture revision and adopt the complete draft through one owner, including shared-tab changes; sending then preserves the document that gave the anchor its meaning. Mirroring never reopens a dismissed bar. Cover Resume, reload, Comment, visibility-only returns, active and hidden revisions, changed-quote sends, canonical datum fallback, and shared-tab revision and dismissal behavior.
leaf-agent
previously approved these changes
Oct 12, 2026
Keep surfaceGrip and its moved placement capture alongside hidden-target retention. The shared placement owner now holds an adopted initial frame, so composition no longer repeats that hold. Exercise a real drag followed by changed quoted words, revision adoption, and sending with the original captured revision.
leaf-agent
reviewed
Oct 12, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
A saved draft can send against the wrong document revision after the writer visits another passage and returns. The inline suggestion preserves the captured revision when the saved anchor itself is reused.
leaf-agent
previously approved these changes
Oct 12, 2026
leaf-agent
previously approved these changes
Oct 12, 2026
leaf-agent
approved these changes
Oct 13, 2026
This was referenced Oct 13, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 13, 2026
The old-drawing browser fixture now includes the composer record's required `revision`. Without it, startup discarded the entire draft, so the test never reached its intended check that obsolete drawing ink is omitted while the draft's words return. The requirement was added in #2650; this fixes the drawing failure in [main CI run 38333313254](https://github.com/max-sixty/leaf/actions/runs/38333313254). The focused browser test failed before this one-field fixture correction and passes after it. Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 13, 2026
The folded-diff draft test now checks the behavior introduced by #2650: folding a file withholds its seated comment box, and reopening the file returns the same draft with focus and caret intact. The previous test expected the hidden box to stay focused and set the caret while the file was already folded, so both variants timed out in [main CI run 38333313254](https://github.com/max-sixty/leaf/actions/runs/38333313254). Both browser variants, with native retained moves and with the fallback move, fail before this correction and pass after it. The check still verifies that typing after reopening inserts at the pre-fold caret. Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 13, 2026
Native CSS anchors carry a floating comment card with its passage during scroll, but the placement solver was rewriting the card's fallback viewport coordinate on every scroll. Those writes triggered page-wide highlight repaints and failed two no-write browser checks in [main CI run 38333313254](https://github.com/max-sixty/leaf/actions/runs/38333313254). Keep the authored CSS position while the anchor, held edges, and relative offset are unchanged; recompute it when any of those change. The fallback added by #2650 remains available if the anchor disappears between placements. Both failing scroll checks pass after this change. The neighboring response-bar scroll check and retained-draft check pass, and `pnpm run test:runtime` passes all 413 tests. --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
…inations (#3315) When a revision moved an open margin card's passage into a closed tab, or hid it, the thread the user was reading left the page. #3305 left this case: it made `openPageThread` decide where every thread opens (the card beside a drawn passage, else the floating panel), but a card carried across a revision didn't go through it. What happened before: - **A revision installed in place** kept the card. A card Leaf opened (`openPageThread`) stayed open and unseen, waiting for a passage nothing would draw again. One opened from its margin marker was closed by the next margin render, since its entry was no longer drawn. - **A revision that loads a fresh document** reopened the card with `showPreview` (`margin-projection.js`, `restoreStanding`). It never placed, and the next margin render closed it. Both installations now capture the margin's and the panel's standing before the revision and restore it after (`version.js`; until now only the fresh document did). The margin restores an open card by opening its thread through `openPageThread` with `scroll: false`, so a revision the user didn't ask for opens no tab or disclosure over the passage. A user who stood in the card stands in the thread wherever it opens, and one on its Close button returns to Close when it reopens in the card. - A card the in-place revision kept, and that still has somewhere to stand (`card.stands()`), stays as it was, with its reading. - A card that accompanied the target the user stood on, with the user outside the card, comes back only beside that target's marker (`openInlineThread`, `unfold: false`), so it never takes the panel from a thread the user is reading there. - A reply the user is writing in the card is left to its editing continuity, which reopens the thread itself (and, as before, reveals the passage when the reply was in view). - Focus on a margin entry comes back whether or not a card was open too. - The panel's restore and the entry-focus restore change nothing where the in-place revision already kept that view or focus. A card whose passage is hidden by anything else, such as a narrower window, still waits for it (#2650). `test_a_card_open_across_a_revision_opens_where_its_passage_stands` covers both installations with the passage drawn and moved into a closed tab; the closed-tab cases fail without the change. Focused revision tests in `test_revisions.py`, `test_render_anchors.py`, `test_render_aim.py`, `test_round_trip.py` and two `journeys/test_render_drafts.py` cases pass, as does `pnpm run test:runtime`. Two independent Codex reviews found five issues in earlier versions (a stray panel beside a reply's own restore, an accompanying card taking the panel, focus lost to the body, focus in an entered accompanying card, entry focus skipped beside an open card); each is fixed here and confirmed by browser runs or a re-review. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[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.
Unfinished comments could disappear when a widget's words changed or a responsive layout hid their target. Preserve the native editor, words, caret and focus through those changes. Comment, Resume writing and reload can recover a draft whose subject is hidden or gone; an editor already beside a subject waits for it to return.
Resume, reload and shared-tab updates keep the draft's semantic anchor together with its captured document revision. A fresh aim at a passage captures the document currently on screen while retaining any saved words and modes. Placement uses the resolver's canonical datum fallback or containing section without changing what the eventual comment means. One adopter handles reopening and shared-tab updates, and sending uses the stored capture revision. Mirrored updates keep dismissed response bars closed.
The canonical auxiliary-surface reading withholds the passage editor whenever an auxiliary surface covers the page. Questions and Threads use the same rule, preserving the native field, caret and draft for Resume writing.
Floating surfaces observe the shared visible-target-parts reading. For
display: contents, they watch descendants while the subject has no box, so comment and reply editors withhold and return when the actual target parts become hidden or visible without a resize or render trigger. The native editing frame also carries across attachment changes, including a position chosen by dragging the comment box.Validation on the integrated candidate: