viewer: show a revision pair as real diffs, field by field, split or unified - #66
Draft
joelburget wants to merge 5 commits into
Draft
viewer: show a revision pair as real diffs, field by field, split or unified#66joelburget wants to merge 5 commits into
joelburget wants to merge 5 commits into
Conversation
Two full bodies side by side left the reader to find the edit by eye. The card now aligns the two revisions line by line with the shortest edit script (Myers), tints what one side has and the other lacks, marks the words that moved inside an edited line, pads the short side of an uneven edit so the rows stay level, and folds long runs of unchanged lines to their ends. Both sides keep their syntax painting and links. No dependency: the painter already owns every token and reference, so a diff library would have rendered the text without either. The painter learned two things for this — an innermost emphasis layer, and never letting a newline fall inside a tag, so painted text splits cleanly into one well-formed fragment per line. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
"changed — previously" over a card whose body had not moved told a reviewer that something changed and left them to find it. Every field a review reads is now a diff against the other revision: the signature, effect row and docstring by the same line-and-word engine the body uses; the kind badge, visibility, claims and deprecation as tags that left and tags that arrived; and each relation row — callers, calls, tests, uses, members — as the set it was against the set it is, with a chip that left struck through and one that arrived marked, never hidden behind the row's cap. The status line names the fields that moved. A page-wide control lays every pair out split (old beside new) or unified (old above new), remembered across visits; any card can choose its own layout for the visit. The relation rows need the old dependency graph, which the diff artifact did not carry. `prism index --diff` now records the edge delta — the edges one revision has and the other does not — as an `edges` field, always present so "nothing moved" reads differently from an artifact written before the field existed. The viewer rebuilds the old graph as new − added + removed and asks it the same questions it asks the new one; with an older artifact the relation rows simply do not pretend. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A doc diff kept the docstring's measure, the body spanned the card, and a relation row split after its label column, so three dividers on one card sat at three different places. Every split field now bleeds to the card's edges and divides at its midpoint; the relation rows' chip halves are sized to meet the same line past the label. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The split relation row inherits the row's 8px gap twice before its new half, which the midpoint calculation left out, so its divider sat 16px right of the body's. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joelburget
force-pushed
the
improve-code-and-field-diffs
branch
from
August 25, 2026 16:11
82d6cd2 to
8d3513b
Compare
Owner
|
Hi Joel, very nice as always! And its great it works with the v20 version already. I'll probably get through to reading through this weekend and can fold this into v21. 👍 |
Contributor
Author
|
Hey Stephen, take your time. I left it as a draft because I haven't had the time to review everything myself yet. I'll hopefully get to it in the next few days, and will mark it ready for review at that point. |
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.
The code viewer's revision pair showed two full bodies side by side and a bare "changed — previously" for anything else, leaving the reviewer to find the edit by eye. Bodies are now aligned line by line with a Myers diff and word-level marks inside edited lines (no dependency: the viewer's own painter keeps every token class and navigable reference on both sides), with long unchanged runs folded. Every other field reads as a diff too — signature, effect row, docstring, kind/visibility/claims/deprecation tags, and each relation row (callers, calls, tests, uses, members) as the set it was against the set it is, with the status line naming what moved. A page-wide split/unified control (remembered) lays pairs out old-beside-new or old-above-new, and any card can choose its own. To diff relation rows,
prism index --diffnow records the edge delta (edges: {added, removed}) in the artifact; the viewer rebuilds the old dependency graph as new − added + removed, and an older artifact without the field simply leaves relation rows undiffed.🤖 Generated with Claude Code