diff --git a/mac/VibeTunnel/Core/Models/GitRepository.swift b/mac/VibeTunnel/Core/Models/GitRepository.swift index 62458c95..5bb8845e 100644 --- a/mac/VibeTunnel/Core/Models/GitRepository.swift +++ b/mac/VibeTunnel/Core/Models/GitRepository.swift @@ -46,12 +46,12 @@ public struct GitRepository: Sendable, Equatable, Hashable { /// Whether the repository has uncommitted changes public var hasChanges: Bool { - modifiedCount > 0 || addedCount > 0 || deletedCount > 0 || untrackedCount > 0 + modifiedCount > 0 || deletedCount > 0 || untrackedCount > 0 } /// Total number of files with changes public var totalChangedFiles: Int { - modifiedCount + addedCount + deletedCount + untrackedCount + modifiedCount + deletedCount + untrackedCount } /// Folder name for display @@ -66,18 +66,15 @@ public struct GitRepository: Sendable, Equatable, Hashable { } var parts: [String] = [] + if untrackedCount > 0 { + parts.append("\(untrackedCount)N") + } if modifiedCount > 0 { parts.append("\(modifiedCount)M") } - if addedCount > 0 { - parts.append("\(addedCount)A") - } if deletedCount > 0 { parts.append("\(deletedCount)D") } - if untrackedCount > 0 { - parts.append("\(untrackedCount)U") - } return parts.joined(separator: " ") } diff --git a/mac/VibeTunnel/Presentation/Components/Menu/GitRepositoryRow.swift b/mac/VibeTunnel/Presentation/Components/Menu/GitRepositoryRow.swift index 4424513a..54664b30 100644 --- a/mac/VibeTunnel/Presentation/Components/Menu/GitRepositoryRow.swift +++ b/mac/VibeTunnel/Presentation/Components/Menu/GitRepositoryRow.swift @@ -36,12 +36,12 @@ struct GitRepositoryRow: View { .foregroundColor(AppColors.Fallback.gitModified(for: colorScheme)) } } - if repository.addedCount > 0 { + if repository.untrackedCount > 0 { HStack(spacing: 1) { Image(systemName: "plus") .font(.system(size: 8, weight: .medium)) .foregroundColor(AppColors.Fallback.gitAdded(for: colorScheme)) - Text("\(repository.addedCount)") + Text("\(repository.untrackedCount)") .font(.system(size: 9, weight: .medium)) .foregroundColor(AppColors.Fallback.gitAdded(for: colorScheme)) } @@ -56,16 +56,6 @@ struct GitRepositoryRow: View { .foregroundColor(AppColors.Fallback.gitDeleted(for: colorScheme)) } } - if repository.untrackedCount > 0 { - HStack(spacing: 1) { - Image(systemName: "questionmark") - .font(.system(size: 8)) - .foregroundColor(AppColors.Fallback.gitUntracked(for: colorScheme)) - Text("\(repository.untrackedCount)") - .font(.system(size: 9, weight: .medium)) - .foregroundColor(AppColors.Fallback.gitUntracked(for: colorScheme)) - } - } } } } diff --git a/web/src/client/components/git-status-badge.ts b/web/src/client/components/git-status-badge.ts index ad984336..80535c08 100644 --- a/web/src/client/components/git-status-badge.ts +++ b/web/src/client/components/git-status-badge.ts @@ -2,7 +2,7 @@ * Git Status Badge Component * * Displays git repository status information in a compact badge format. - * Shows counts for modified, untracked, staged files, and ahead/behind commits. + * Shows counts for added, modified, deleted files, and ahead/behind commits. */ import { html, LitElement } from 'lit'; import { customElement, property } from 'lit/decorators.js'; @@ -46,8 +46,8 @@ export class GitStatusBadge extends LitElement { const _hasLocalChanges = (this.session?.gitModifiedCount ?? 0) > 0 || - (this.session?.gitUntrackedCount ?? 0) > 0 || - (this.session?.gitStagedCount ?? 0) > 0; + (this.session?.gitAddedCount ?? 0) > 0 || + (this.session?.gitDeletedCount ?? 0) > 0; const _hasRemoteChanges = (this.session?.gitAheadCount ?? 0) > 0 || (this.session?.gitBehindCount ?? 0) > 0; @@ -79,10 +79,10 @@ export class GitStatusBadge extends LitElement { private renderLocalChanges() { if (!this.session) return null; + const addedCount = this.session?.gitAddedCount ?? 0; const modifiedCount = this.session?.gitModifiedCount ?? 0; - const untrackedCount = this.session?.gitUntrackedCount ?? 0; - const stagedCount = this.session?.gitStagedCount ?? 0; - const totalChanges = modifiedCount + untrackedCount + stagedCount; + const deletedCount = this.session?.gitDeletedCount ?? 0; + const totalChanges = addedCount + modifiedCount + deletedCount; if (totalChanges === 0 && !this.detailed) return null; @@ -91,10 +91,10 @@ export class GitStatusBadge extends LitElement { return html` ${ - stagedCount > 0 + addedCount > 0 ? html` - - +${stagedCount} + + +${addedCount} ` : null @@ -109,10 +109,10 @@ export class GitStatusBadge extends LitElement { : null } ${ - untrackedCount > 0 + deletedCount > 0 ? html` - - ?${untrackedCount} + + -${deletedCount} ` : null @@ -122,7 +122,7 @@ export class GitStatusBadge extends LitElement { } else { // Compact view shows total with an indicator return html` - + ●${totalChanges} `; diff --git a/web/src/server/services/git-watcher.ts b/web/src/server/services/git-watcher.ts index 1781a639..2035ec59 100644 --- a/web/src/server/services/git-watcher.ts +++ b/web/src/server/services/git-watcher.ts @@ -243,8 +243,9 @@ export class GitWatcher { return ( oldStatus.modified !== newStatus.modified || - oldStatus.untracked !== newStatus.untracked || + oldStatus.added !== newStatus.added || oldStatus.staged !== newStatus.staged || + oldStatus.deleted !== newStatus.deleted || oldStatus.ahead !== newStatus.ahead || oldStatus.behind !== newStatus.behind ); @@ -268,8 +269,7 @@ export class GitWatcher { type: 'git-status-update', sessionId, gitModifiedCount: status.modified, - gitUntrackedCount: status.untracked, - gitStagedCount: status.staged, + gitAddedCount: status.added, gitDeletedCount: status.deleted, gitAheadCount: status.ahead, gitBehindCount: status.behind, diff --git a/web/src/server/utils/git-status.ts b/web/src/server/utils/git-status.ts index 03687f97..b1aad036 100644 --- a/web/src/server/utils/git-status.ts +++ b/web/src/server/utils/git-status.ts @@ -12,7 +12,7 @@ const execFileAsync = promisify(execFile); export interface GitStatusCounts { modified: number; - untracked: number; + added: number; staged: number; deleted: number; ahead: number; @@ -42,7 +42,7 @@ export async function getDetailedGitStatus(workingDir: string): Promise