feat(tauri): update Windows taskbar badge with combined count
The Windows overlay badge now renders a single combined number and includes an additional “changes” component in the total. This makes the badge more informative while keeping the icon compact and legible across small sizes. - Simplify badge rendering to one circle with centered text - Extend the Tauri command and frontend call to pass changes count
This commit is contained in:
+2
-2
@@ -679,7 +679,7 @@
|
||||
repoPath = "";
|
||||
status = null;
|
||||
lastStatusFingerprint = "";
|
||||
void setSyncBadge(0, 0).catch(() => {});
|
||||
void setSyncBadge(0, 0, 0).catch(() => {});
|
||||
}
|
||||
branches = [];
|
||||
commits = [];
|
||||
@@ -713,7 +713,7 @@
|
||||
repoPath = activeRepoPath;
|
||||
lastStatusFingerprint = statusFingerprint(nextStatus);
|
||||
upsertRepoTab(activeRepoPath, nextStatus);
|
||||
void setSyncBadge(nextStatus.ahead, nextStatus.behind).catch(() => {});
|
||||
void setSyncBadge(nextStatus.ahead, nextStatus.behind, nextStatus.files.length).catch(() => {});
|
||||
}
|
||||
|
||||
function errorToMessage(error: unknown): string {
|
||||
|
||||
+3
-3
@@ -37,10 +37,10 @@ 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
|
||||
// Sets the taskbar icon badge to ahead + behind + changed status files (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 setSyncBadge(ahead: number, behind: number, changes: number): Promise<void> {
|
||||
return invoke<void>("set_sync_badge", { ahead, behind, changes });
|
||||
}
|
||||
|
||||
export function listBranches(path: string): Promise<GitBranch[]> {
|
||||
|
||||
Reference in New Issue
Block a user