Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.so
*.dylib
diffty
difftypp

# Test binary, built with `go test -c`
*.test
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ diffty++ is a fork of [diffty](https://github.com/darccio/diffty).
diffty++ extends the original diffty with the following additions:

- **Multi-mode diff comparison**: Compare branches, arbitrary commits, staged changes, or unstaged working tree modifications via a tabbed UI.
- **Syntax highlighting**: VSCode-quality highlighting via Shiki with Catppuccin Latte theme — supports C/C++, CMake, Python, Go, TypeScript, Rust, Java, YAML, JSON, and 13 more languages.
- **Inline review comments**: GitHub PR-style inline comments with line selection, comment resolution, markdown export, and review submission flow.
- **Past reviews sidebar**: Right-side panel showing previous review sessions for the same branch pair, with inline faded rendering of past comments on the current diff, "View original" links back to the original commit pair, and per-review or bulk deletion.
- **File explorer**: Browse the filesystem to select repositories through a modal dialog with breadcrumb navigation, git repository detection, and directory filtering.

## Features

- **Enhanced Diff Visualization**: Side-by-side and unified diff views with syntax highlighting
- **Syntax Highlighting**: VSCode-quality syntax highlighting powered by [Shiki](https://shiki.style/) (TextMate grammars) with the Catppuccin Latte theme. Supports 22 languages including Go, C/C++, CMake, Python, TypeScript, Rust, Java, YAML, JSON, and more. Highlights diff lines with full multi-line context (block comments, namespaces, templates).
- **Multi-Repository Support**: Select and switch between multiple repositories through the UI
- **File Explorer**: Browse the filesystem visually to find and select repositories instead of typing paths
- **Sidebar Navigation**: Persistent file list sidebar with status indicators (approved/rejected/skipped/unreviewed), click-to-navigate, and auto-redirect to the first changed file
Expand Down
5 changes: 5 additions & 0 deletions internal/git/diffparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ func DetectLanguage(filePath string) string {
return "sql"
case ".toml":
return "toml"
case ".cmake":
return "cmake"
case ".dockerfile":
return "dockerfile"
default:
Expand All @@ -255,6 +257,9 @@ func DetectLanguage(filePath string) string {
if base == "makefile" {
return "makefile"
}
if base == "cmakelists.txt" {
return "cmake"
}
return ""
}
}
5 changes: 5 additions & 0 deletions internal/git/diffparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ func TestDetectLanguageComplete(t *testing.T) {
// Dockerfile extension
{"build.dockerfile", "dockerfile"},

// CMake
{"CMakeLists.txt", "cmake"},
{"path/to/CMakeLists.txt", "cmake"},
{"toolchain.cmake", "cmake"},

// Special filenames (no extension, handled by basename check)
{"Dockerfile", "dockerfile"},
{"path/to/Dockerfile", "dockerfile"},
Expand Down
154 changes: 153 additions & 1 deletion internal/server/static/js/diff.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion internal/server/templates/diff.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h2 class="text-xl font-bold">{{.RepoName}}</h2>
{{else}}
{{if .SelectedFile}}
{{/* ===== SINGLE FILE DIFF VIEW (structured table) ===== */}}
<div id="diff-content" class="bg-white shadow rounded-lg overflow-hidden" tabindex="0" data-testid="diff-content">
<div id="diff-content" class="bg-white shadow rounded-lg overflow-hidden" tabindex="0" data-testid="diff-content" data-language="{{.SelectedFileLanguage}}">
<div class="flex justify-between items-center p-4 border-b">
<h3 class="font-mono text-lg font-medium">{{.SelectedFile}}</h3>
<div class="flex space-x-2">
Expand Down Expand Up @@ -639,6 +639,10 @@ <h3 style="margin:0">Keyboard Shortcuts</h3>
50% { background-color: #fecaca; }
}

/* Syntax highlighting — shiki uses inline color styles, ensure they render on diff backgrounds */
.diff-line-content span[style] { font-style: inherit; }
.diff-line-content .italic { font-style: italic; }

/* Help overlay */
.shortcuts-overlay {
position: fixed;
Expand Down
1 change: 1 addition & 0 deletions internal/server/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>diffty++ - Git Diff Tool</title>
<link rel="stylesheet" href="/static/css/main.css">
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>

</head>
<body class="bg-gray-100 min-h-screen overflow-x-hidden">
<header class="bg-gray-800 text-white py-4">
Expand Down
Loading
Loading