Repository navigation
SVG diffs graphically by default (issue #108) - #128
Merged
Merged
Conversation
A pair whose bytes sniff as SVG and whose trees usvg opens is now a picture pair, compared by what it draws; an SVG usvg refuses falls back to text. New diff/content/svg.rs renders with resvg, hardened against SVG bombs: no filesystem hrefs, data: URLs only image/svg+xml and one nesting level, capped at 1024. Headless and --mode json now carry SVG pairs as picture content. In the TUI the picture viewer's `t` cycle gains a "text" view for an SVG pair: its markup, diffed as text. Four handmade picture fixtures pin the verdicts (attribute churn -> invisible, circle added -> edited, recolor -> redrawn, SVG->PNG -> invisible), the first cross-format pair in the corpus. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- An SVG with text, a foreignObject, or an image other than one nested SVG drawn in full is no longer a picture: resvg is built without fonts or raster images, so such edits came out "invisible". It stays text. - Headless and JSON keep the markup diff: a text pair that is content too gets the picture notice above its text diff, or `content` beside its hunks in JSON. - Each SVG side is parsed once, cached by its bytes, and inside content::contained, so a parser panic during sniffing is an error. - A small pair of SVGs is drawn up to 256 pixels by one factor, so a sub-pixel edit to an icon still shows. - TUI: the markup view is diffed only when first shown, is named by the side that is present (an added SVG gets XML), and swallows picture keys; the member grid includes SVG members. - picture.rs module doc rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XUyLJ2enKeRdFnvjUTNwT1
The markup view test drew into 80x10, too short once its headers wrap macOS's long temporary paths: the second change fell out of view. The added-SVG tests read /dev/null, which Windows does not have; they use an empty file, as git's absent side is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XUyLJ2enKeRdFnvjUTNwT1
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.
Render SVGs