Render pi-computed edit diffs in chat UIs#4076
Open
youknowriad wants to merge 2 commits into
Open
Conversation
…fied diff Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing bfd33d8 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
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.
Related issues
How AI was used in this PR
Fully authored with Claude Code: it audited every diff-rendering site in the repo, traced how pi's edit tool result details flow through IPC to each renderer, implemented the change, and ran lint/typecheck/tests. Visual appearance still needs human review (see below).
Proposed Changes
details.diff). This is exactly what was applied to disk — including fuzzy-match and line-ending resolution — so what the user reviews always matches what happened, and the sandboxed renderers import nothing new.--color-frame-diff-*tokens for the legacy renderer.validate_blockstool now reports its auto-fix diff as a standard unified patch with 4 context lines via pi'sgenerateUnifiedPatch, instead of a hand-rolled whole-file diff that included every unchanged line — smaller prompts for the model on large files. The ~100-line custom LCS implementation is deleted.Testing Instructions
node apps/cli/dist/cli/main.mjs) and ask it to edit a theme file; expand the Edit tool row....between distant hunks. In the TUI the diff is in the expandable preview (ctrl+o).npm run typecheckandnpm testpass (one unrelated CLI e2e test is flaky under full-suite parallelism; passes in isolation).Pre-merge Checklist
🤖 Generated with Claude Code