feat(tauri): add Windows taskbar overlay badge for git sync status

This change introduces a Windows-only taskbar badge that displays the
ahead+behind count as a rendered overlay icon. The UI now updates
the badge whenever the repository sync status changes, and the git
diff commands are adjusted to avoid external diff/text conversion noise.

- Add badge rendering and Tauri command for setting overlay icon
- Wire badge updates into the Svelte app based on git status
- Update git diff invocations to disable ext-diff/textconv
This commit is contained in:
Christoph Brandau
2026-07-03 13:49:43 +02:00
parent 883cf3ebd1
commit 276dfbab07
6 changed files with 153 additions and 3 deletions
+3
View File
@@ -63,6 +63,7 @@
restoreFiles,
restoreToCommit,
searchCodeIntroductions,
setSyncBadge,
stageFiles,
unstageFiles,
} from "./lib/git";
@@ -656,6 +657,7 @@
repoPath = "";
status = null;
lastStatusFingerprint = "";
void setSyncBadge(0, 0).catch(() => {});
}
branches = [];
commits = [];
@@ -689,6 +691,7 @@
repoPath = activeRepoPath;
lastStatusFingerprint = statusFingerprint(nextStatus);
upsertRepoTab(activeRepoPath, nextStatus);
void setSyncBadge(nextStatus.ahead, nextStatus.behind).catch(() => {});
}
function errorToMessage(error: unknown): string {
+6
View File
@@ -37,6 +37,12 @@ export function getStatus(path: string): Promise<GitStatus> {
return invoke<GitStatus>("get_status", { path });
}
// Sets the taskbar icon badge to ahead + behind (0 clears it). Windows only — a no-op on
// other platforms, since Windows has no native numeric badge to fall back to.
export function setSyncBadge(ahead: number, behind: number): Promise<void> {
return invoke<void>("set_sync_badge", { ahead, behind });
}
export function listBranches(path: string): Promise<GitBranch[]> {
return invoke<GitBranch[]>("list_branches", { path });
}