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 @@ -110,7 +110,7 @@ struct WorkspaceSidebarRow: View {
private var statusRow: some View {
HStack(spacing: 10) {
if pendingCount > 0 {
WorkspacePendingIndicator()
WorkspacePendingIndicator(count: pendingCount)
}

Spacer(minLength: 0)
Expand Down Expand Up @@ -220,19 +220,26 @@ private struct WorkspaceWorkingIndicator: View {

/// Animated bell shown while a workspace owns queued completions.
private struct WorkspacePendingIndicator: View {
let count: Int

@ViewBuilder
var body: some View {
if #available(macOS 15.0, *) {
Image(systemName: "bell.fill")
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(AppTheme.highlight)
.symbolEffect(.bounce.up.byLayer, options: .repeat(.continuous))
.accessibilityLabel("Workspace has pending completions")
} else {
Image(systemName: "bell.fill")
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(AppTheme.highlight)
.accessibilityLabel("Workspace has pending completions")
HStack(spacing: 4) {
if #available(macOS 15.0, *) {
Image(systemName: "bell.fill")
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(AppTheme.highlight)
.symbolEffect(.bounce.up.byLayer, options: .repeat(.continuous))
} else {
Image(systemName: "bell.fill")
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(AppTheme.highlight)
}

Text("\(count)")
.font(.system(size: 11, weight: .semibold, design: .rounded))
.foregroundStyle(AppTheme.textPrimary)
}
.accessibilityLabel("Workspace has \(count) pending completion\(count == 1 ? "" : "s")")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ extension WorkspaceManager {
"enqueue workspace=\(workspaceId.uuidString) surface=\(surfaceId.uuidString) sequence=\(sequence)"
)

if isSurfaceCurrentlyFocused(surfaceId) {
CompletionDebugLogger.log(
"auto-handle focused completion surface=\(surfaceId.uuidString)"
)
let didHandleCompletion = surfaceManager.clearPendingCompletion(
workspaceId: workspaceId,
surfaceId: surfaceId,
workspaces: &workspaces,
persistence: persistence
)
if didHandleCompletion {
markRecentlyHandled(surfaceId: surfaceId)
}
completionNotifications.removeNotifications(for: surfaceId)
return
}

if let target = pendingCompletionTarget(surfaceId: surfaceId),
let workspace = workspace(id: workspaceId),
shouldScheduleCompletionNotification(for: surfaceId) {
Expand Down Expand Up @@ -134,6 +117,13 @@ extension WorkspaceManager {

switch event.phase {
case .started:
surfaceManager.clearPendingCompletion(
workspaceId: target.workspaceId,
surfaceId: event.surfaceId,
workspaces: &workspaces,
persistence: persistence
)
completionNotifications.removeNotifications(for: event.surfaceId)
guard event.agentType != .codex else { return }
markSurfaceBusy(event.surfaceId)
case .completed:
Expand Down
Loading