Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extension WorkspaceManager {
workspaceName: workspace.name
)
}
updateDockBadge()
} else if !payload.isEmpty {
surfaceManager.setAgentType(
workspaceId: workspaceId,
Expand Down Expand Up @@ -124,6 +125,7 @@ extension WorkspaceManager {
persistence: persistence
)
completionNotifications.removeNotifications(for: event.surfaceId)
updateDockBadge()
guard event.agentType != .codex else { return }
markSurfaceBusy(event.surfaceId)
case .completed:
Expand Down Expand Up @@ -228,6 +230,12 @@ extension WorkspaceManager {
}
}

/// Updates the dock icon badge to reflect the current pending completion count.
func updateDockBadge() {
let count = pendingCompletionTargets().count
NSApp.dockTile.badgeLabel = count > 0 ? "\(count)" : nil
}

/// Rebuilds the next FIFO sequence cursor from persisted surface metadata.
func synchronizePendingCompletionCursor() {
let highestSequence = workspaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extension WorkspaceManager {
persistence: persistence
)
completionNotifications.removeNotifications(for: surfaceId)
updateDockBadge()
GhosttyRuntime.shared.endSearch(surfaceId: surfaceId)
GhosttyRuntime.shared.releaseSurface(surfaceId: surfaceId)
clearBusySurface(surfaceId)
Expand Down Expand Up @@ -75,6 +76,7 @@ extension WorkspaceManager {
markRecentlyHandled(surfaceId: surfaceId)
}
completionNotifications.removeNotifications(for: surfaceId)
updateDockBadge()
GhosttyRuntime.shared.focusSurfaceHost(surfaceId: surfaceId)

if let workspace = workspace(id: workspaceId),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import AppKit
import Foundation

/// Workspace lifecycle and selection flows for the shared manager.
Expand All @@ -17,6 +18,7 @@ extension WorkspaceManager {
persistence: persistence
)
synchronizePendingCompletionCursor()
updateDockBadge()
refreshFocusedWorkspaceGitBranches()
hasLoadedPersistedWorkspaces = true
}
Expand Down Expand Up @@ -69,6 +71,7 @@ extension WorkspaceManager {
GhosttyRuntime.shared.releaseSurface(surfaceId: $0)
clearGitBranch(surfaceId: $0)
}
updateDockBadge()
}

/// Requests deletion for a workspace and asks for confirmation when live terminals exist.
Expand Down
Loading