Add diff-style red/green highlighting to replay --corrupt - #7
Merged
Conversation
Before sending a corrupted payload, replay now prints a git-diff-style line-by-line comparison of the original vs. corrupted body: unchanged lines dimmed, removed lines on a red background, added/changed lines on a green background. Makes it immediately visible exactly what --corrupt did to the payload instead of just a one-line "payload corrupted" note. Verified locally against a real stored callback: truncation splits cleanly into an unchanged prefix, a changed line (old red / new green), and the fully-dropped trailing lines (red), matching the intended diff semantics.
There was a problem hiding this comment.
Pull request overview
Adds a clearer, diff-like visualization of how replay --corrupt modifies a stored callback payload by printing a line-by-line comparison (dimmed unchanged lines, red removed lines, green added/changed lines) before the request is sent. This improves the CLI UX by making the corruption behavior immediately observable rather than only reporting that corruption happened.
Changes:
- Update
replayto print a colored, git-diff-style comparison of original vs corrupted payload when--corruptis used. - Add
print_diff(original, corrupted)helper to render the line-by-line diff with terminal colors. - Document the new
--corruptoutput format and provide an example inRUNNING.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/commands/replay.rs | Prints a colored, line-by-line original vs corrupted payload diff when replay --corrupt is used. |
| RUNNING.md | Documents the new diff-style output for replay --corrupt with an illustrative example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DENNIS-CODES
added a commit
that referenced
this pull request
Aug 11, 2026
…enz0d Add diff-style red/green highlighting to replay --corrupt
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.
Summary
Adds the red/green diff highlighting requested — modeled after the removed/added-line highlighting style from editor diff views, applied where it's actually useful in this tool:
replay --corrupt.Before sending a corrupted payload,
replaynow prints a git-diff-style, line-by-line comparison of the original vs. corrupted body:This makes it obvious at a glance exactly what
--corruptdid to the payload, instead of a single "payload corrupted" line with no detail.Test plan
cargo build --all-targets,cargo clippy --all-targets -- -D warnings,cargo fmt --all -- --check,cargo testall passhttps://claude.ai/code/session_01BE4uE4wMaDgqN43zXvbqHH
Generated by Claude Code