Repository navigation
Keep a rewritten thread's quoted words on its card - #1770
Merged
Merged
Conversation
When a version rewrites the words a comment quoted, the page keeps the thread on their section, and the Threads panel named it by the section's new words, so a returning reader saw a passage they never commented on. The card now marks such a thread with a "changed" link. Pressing it opens the inline comparison on that section, from the revision the comment was written on to now, and a second press, or the card leaving, closes it. "Find in threads" also matches the words the thread was opened on. - thread/model.js: `rewrittenFrom` reads the rewrite from the opening comment's anchor and revision. A reply that moved the thread is not a rewrite. - version.js: `toggleChangeSince` opens the existing inline reading on one element from an exact revision, with no page-wide marks. An inline reading now records which press opened it, so a Change entry and a thread no longer close each other's reading, and a page comparison stopping leaves the thread's reading in place. - passages.js: a reading may break blocks with a newline. The comparison uses that so a heading without a full stop and the paragraph under it stay two sentences; before, their words interleaved. - http.py, live_shell.py: a revision also answers at /revisions/rN.html, as a version does at /versions/vN.html, since a comment records only the revision's number. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Two threads can stand on one rewritten section, from different revisions, so a reading now belongs to the thread that pressed for it rather than to threads in general: one card's press takes the other's place, aria-expanded follows its own reading, and a card that stops offering the link or leaves the panel closes only its own. A press still loading is cancelled only by its own thread or a revision, not by another card. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/scripts/leaf/http.py
A thread whose quoted words a later version rewrote named itself by its section's heading, and "changed" diffed the whole section, so in a long section the card no longer said what was quoted and the diff marked every other edit there. The card now keeps the quoted words, and "changed" shows only their edit: the deletions overlapping them and the insertions beside those, found in the old text by the anchor's quote and context. The inline comparison also weighs each replaced sentence against its own counterpart, so a rewritten heading stays whole beside a lightly edited sentence after it, and a deletion running to a block's end stands on its own line rather than splicing onto the next block. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A quote can stop resolving with its words still in place, as when a second copy makes it ambiguous, and a quote taken from generated words never appears in the authored text. Either way "changed" marked nothing or the whole section; it now says the words are unchanged or not found instead. The card names the opening quote through the same label every thread uses, so a design thread keeps its prefix. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/thread/thread-card.js
The "changed" diff drew struck and inserted words into the page, which the version comparison and later revisions also own, so it needed per-thread ownership, fetch cancellation and card-lifetime closing, and each review round found another lifetime case. It is removed, with the revision-number address it fetched through and the alignment and reading changes made for it; version.js, passages.js, text-alignment.js, http.py and live_shell.py are back to main. What stays: a thread whose quoted words a later version rewrote keeps naming those words on its card, with a quiet "Changed" status in the slot "Earlier data" uses, and "Find in threads" matches them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 4, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The committed browser bundle is stale. The test job fails npm run check:browser on three generated outputs because the browser framework imports the changed thread model. Rebuild and commit those outputs so the shipped bundle matches this source change.
A reply that moves a thread to its section alone leaves the same anchor shape an automatic reanchor does, so the card called an agent's chosen place "Changed" and named the old quote instead. The fold now keeps the anchor a reanchor moved off as `rewritten_from` until a reply places the thread again; the card and "Find in threads" read that, and the browser's public thread record and a locally opened thread carry it. Rebuilds the committed browser bundle, which the thread model is part of. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # build/browser/generated/browser-runtime.js.map # build/browser/generated/browser-runtime.manifest.json # skills/leaf/assets/vendor/browser-runtime.js
leaf-agent
previously approved these changes
Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 4, 2026
max-sixty
pushed a commit
that referenced
this pull request
Oct 5, 2026
The gallery revision case still expected an automatically reanchored thread card to replace its quoted words with the new paragraph text. Since #1770, the card keeps the original quote with a “Changed” label while the active anchor moves to the surviving section. The existing test already checks both durable `reanchor` events; this change checks the retained quote and that the card's anchor remains actionable. The former assertion failed in [the main run](https://github.com/max-sixty/leaf/actions/runs/37260003321). The focused browser case failed before this update and passes afterward. No product behavior changes. --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 10, 2026
The two datum replacement tests now expect the visible `Changed` status when a saved quotation's words differ from the current value. Their checks that the comment, draft, and mark follow the stable datum remain in place. [#1770](#1770) added this status for changed quoted words; these older datum tests still expected no status. This repairs both datum failures in [main CI run 37929061293](https://github.com/max-sixty/leaf/actions/runs/37929061293). Verification: both tests failed before the assertion update and pass after it. The branch now includes current main, including #2171’s bounded sample loader, which repairs the shared `ERR_INSUFFICIENT_RESOURCES` / entry-module presentation failure in these older CI runs. Current-main validation: the exact affected browser cases pass locally; independent source review found no actionable issues. Fresh broad CI runs on this updated head. > _This was written by Codex on behalf of max-sixty_ Co-authored-by: leaf-agent <[email protected]> Co-authored-by: Maximilian Roos <[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.
When a later version rewrites the words a comment quoted, Leaf keeps the thread on their section, and the Threads panel used to name it by the section's new heading, so a returning reader saw a passage they never commented on. The card now keeps naming the quoted words, with a quiet "Changed" status in the slot "Earlier data" uses, and "Find in threads" matches those words.
build_threads(events.py) keeps the anchor an automaticreanchormoved off asrewritten_from, until a reply places the thread again, so an agent's explicit move to a section keeps showing the place it chose. The browser's thread record carries the field, and the card and search read it.