native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #57 from onevcat/feature/repo-tab-count-badge

feat: show tab count badge on repo header in sidebar

authored by

Wei Wang and committed by
GitHub
218c0909 1a7c2e77

+14 -1
+10
supacode/Features/Repositories/Views/RepoHeaderRow.swift
··· 4 4 private static let debugHeaderLayers = false 5 5 let name: String 6 6 let isRemoving: Bool 7 + let tabCount: Int 7 8 var body: some View { 8 9 HStack { 9 10 Text(name) ··· 12 13 Text("Removing...") 13 14 .font(.caption) 14 15 .foregroundStyle(.tertiary) 16 + } 17 + if tabCount > 0 { 18 + Text("\(tabCount)") 19 + .font(.caption2) 20 + .monospacedDigit() 21 + .foregroundStyle(.secondary) 22 + .padding(.horizontal, 5) 23 + .padding(.vertical, 1) 24 + .background(.quaternary, in: .capsule) 15 25 } 16 26 } 17 27 .background {
+4 -1
supacode/Features/Repositories/Views/RepositorySectionView.swift
··· 39 39 let header = HStack { 40 40 RepoHeaderRow( 41 41 name: repository.name, 42 - isRemoving: isRemovingRepository 42 + isRemoving: isRemovingRepository, 43 + tabCount: repository.worktrees.reduce(0) { count, worktree in 44 + count + (terminalManager.stateIfExists(for: worktree.id)?.tabManager.tabs.count ?? 0) 45 + } 43 46 ) 44 47 .frame(maxWidth: .infinity, alignment: .leading) 45 48 .background {