feat(desktop): add Git Diff Viewer to context panel#2269
Open
HUQIANTAO wants to merge 1 commit into
Open
Conversation
- Add 'Diffs' tab to the right-side context panel - Add Rust git_diffs Tauri command (runs git diff/ls-files, returns structured FileDiff[]) - Reuse existing DiffCard component for inline patch rendering - Show staged, unstaged, and untracked files in 3 sections - Expandable file entries with +/- stats and status badges - Refresh button to re-fetch changes - Graceful empty states for no changes, no workspace, non-git repos - Add i18n keys (en, zh-CN; de/ja/ru auto-fallback via ...en spread)
esengine
approved these changes
May 29, 2026
Owner
esengine
left a comment
There was a problem hiding this comment.
Nice — clean reuse of the existing DiffCard, Tauri command follows git_status conventions, and the i18n fallback story is correct. Letting CI run.
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
Add a "Diffs" tab to the right-side context panel that shows workspace git changes (staged, unstaged, untracked) with expandable inline diffs.
Changes
Rust backend (
desktop/src-tauri/src/main.rs)git_diffsTauri command — runsgit diff --unified=3 HEAD(unstaged),git diff --cached(staged),git ls-files --others(untracked)GitDiffsResult { staged, unstaged, untracked }withFileDiff { file, additions, deletions, patch, status }git_statuspattern (silent on non-git repos, WindowsCREATE_NO_WINDOW)Frontend (
desktop/src/ui/context-panel.tsx)"diffs"tab inContextPanelTabunionCtxDiffscomponent: fetches viainvoke("git_diffs", { root }), renders 3 sections (Staged / Unstaged / Untracked)DiffCard(reusing existing component fromcards.tsx)parsePatch()helper converts git unified diff patches toDiffLine[]formatCSS (
desktop/src/styles.css).diff-file-*styles for the file list (compact rows, chevron expand, stats badges, status pills).ctx-actionstyle for the refresh buttoni18n
en.tsandzh-CN.tsde.ts/ja.ts/ru.tsauto-inherit via...enspread fallback