feat(diff): show relative file change indicators#683
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Render file change indicators as vertical fills and add a muted track so the full scale remains visible. Signed-off-by: Matt Toohey <contact@matttoohey.com>
Render the relative +/- indicator in the file icon slot and reduce the vertical bar width to 4px. Signed-off-by: Matt Toohey <contact@matttoohey.com>
The file header check in line_stats_from_patch matched any line starting with '+++' or '---', causing content lines like '+++flag' (an added line containing '++flag') to be skipped instead of counted. Restrict the check to lines starting with '+++ ' or '--- ' which matches actual unified diff file headers (e.g. '+++ b/path' or '--- /dev/null'). Also convert supports_line_stats to use matches! macro per clippy lint. Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 882ce3b550
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if line.starts_with("+++ ") || line.starts_with("--- ") { | ||
| continue; |
There was a problem hiding this comment.
Exclude only actual diff headers when counting line stats
line_stats_from_patch skips every patch line that starts with "+++ " or "--- ", but that also matches real added/removed content lines whose text begins with "++ " or "-- " (the unified diff prefix makes them look like +++ ... / --- ...). In those cases, added/deleted counts are underreported, so the file-change indicator becomes inaccurate for affected files.
Useful? React with 👍 / 👎.
🤖 Summary
Tests