feat: add 0github diff themes#134
Conversation
📝 WalkthroughWalkthroughTwo new GitHub-themed color schemes (0github-dark and 0github-light) are added to the diff viewer theme system, including new enum variants, string parsing support, theme constructors, unit tests, and documentation updates reflecting the new theme options. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/command/diff/theme.rs (1)
367-378: Consider reviewingdeleted_bgandcontext_bgvisual distinction.Both
deleted_bg(line 371) andcontext_bg(line 374) are set to pure whiteColor::Rgb(255, 255, 255), making deleted lines visually indistinguishable from context lines by background color alone. Other light themes use a subtle red/pink tint fordeleted_bg.This may be intentional to match GitHub's styling (which relies more heavily on gutter colors), but could reduce at-a-glance readability compared to other themes. Verify this matches the desired 0github palette behavior.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/command/diff/theme.rs` around lines 367 - 378, The deleted_bg and context_bg in the DiffColors initialization are both pure white (deleted_bg and context_bg), which makes deleted lines visually indistinguishable; update the DiffColors struct initialization to give deleted_bg a subtle red/pink tint (e.g., a very light pink close to the theme palette) while leaving context_bg as white, or explicitly document/confirm the intent if pure white was deliberate; locate the DiffColors block (the DiffColors instance where added_bg/added_gutter_bg/.../deleted_word_bg are set) and change deleted_bg to a slightly tinted RGB value that matches the 0github palette, then run a visual check to ensure contrast with context_bg.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/command/diff/theme.rs`:
- Around line 367-378: The deleted_bg and context_bg in the DiffColors
initialization are both pure white (deleted_bg and context_bg), which makes
deleted lines visually indistinguishable; update the DiffColors struct
initialization to give deleted_bg a subtle red/pink tint (e.g., a very light
pink close to the theme palette) while leaving context_bg as white, or
explicitly document/confirm the intent if pure white was deliberate; locate the
DiffColors block (the DiffColors instance where
added_bg/added_gutter_bg/.../deleted_word_bg are set) and change deleted_bg to a
slightly tinted RGB value that matches the 0github palette, then run a visual
check to ensure contrast with context_bg.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a83f18da-53af-48e3-be49-9811ea836134
📒 Files selected for processing (2)
README.mdsrc/command/diff/theme.rs
Summary
0github-darkand0github-lightdiff theme presets derived from themanaflow0github paletteTest Plan
cargo test 0githubcargo testNotes
cargo testcurrently fails onupstream/maininvcs::git::tests::test_get_merge_base_returns_ancestorupstream/mainworktree; the failing path issrc/vcs/test_utils.rsassumingrefs/heads/mainexists after git2 repo initSummary by CodeRabbit
New Features
Documentation