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
3 changes: 3 additions & 0 deletions Packages/CrowCore/Sources/CrowCore/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ public final class AppState {
/// Called to update session status to .inReview (persists to store).
public var onSetSessionInReview: ((UUID) -> Void)?

/// Called to update session status back to .active (persists to store).
public var onSetSessionActive: ((UUID) -> Void)?

/// Whether a given session is currently being marked as "In Review" (loading state).
/// Must be cleaned up when a session is deleted (see `SessionService.deleteSession`).
public var isMarkingInReview: [UUID: Bool] = [:]
Expand Down
12 changes: 12 additions & 0 deletions Packages/CrowUI/Sources/CrowUI/SessionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ public struct SessionDetailView: View {
.tint(CorveilTheme.gold)
}

if session.status == .completed {
Button {
appState.onSetSessionActive?(session.id)
} label: {
Label("Move to Active", systemImage: "arrow.uturn.backward.circle")
.font(.caption)
}
.buttonStyle(.bordered)
.controlSize(.small)
.tint(CorveilTheme.gold)
}

Button(role: .destructive) {
sessionToDelete = session
} label: {
Expand Down
3 changes: 3 additions & 0 deletions Sources/Crow/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
appState.onSetSessionInReview = { [weak service] id in
service?.setSessionInReview(id: id)
}
appState.onSetSessionActive = { [weak service] id in
service?.setSessionActive(id: id)
}

appState.onLaunchClaude = { [weak service] terminalID in
service?.launchClaude(terminalID: terminalID)
Expand Down
4 changes: 4 additions & 0 deletions Sources/Crow/App/SessionService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ final class SessionService {
updateSessionStatus(id, to: .inReview)
}

func setSessionActive(id: UUID) {
updateSessionStatus(id, to: .active)
}

// MARK: - Persist Current State

/// Sync all in-memory state back to the JSON store on disk.
Expand Down
Loading