Repository navigation
Carry an open margin card's thread across a revision through the destinations - #3315
Merged
Merged
Conversation
…inations When a revision moved an open card's passage into a closed tab, or hid it, the thread the user was reading left the page. - A revision installed in place kept the card. A card opened by Leaf (`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`, where #3305 put the decision for every opening: the card beside the passage where the passage is drawn, else the floating panel. It passes `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, through the margin's accompaniment route (`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, so the card's standing doesn't also open it in the panel. - Focus on a margin entry comes back whether or not a card was open too; before, an open card's restore returned before it. - The panel's restore, and the margin's restore of focus on an entry, 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: no panel opens and the card is closed or unseen. The drawn cases pass before and after. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
leaf-agent
approved these changes
Oct 20, 2026
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.
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
openPageThreaddecide 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:
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.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 throughopenPageThreadwithscroll: 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.card.stands()), stays as it was, with its reading.openInlineThread,unfold: false), so it never takes the panel from a thread the user is reading there.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_standscovers both installations with the passage drawn and moved into a closed tab; the closed-tab cases fail without the change. Focused revision tests intest_revisions.py,test_render_anchors.py,test_render_aim.py,test_round_trip.pyand twojourneys/test_render_drafts.pycases pass, as doespnpm 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.