Skip to content

Add 'Move to Active' button on completed sessions#188

Merged
dhilgaertner merged 2 commits intomainfrom
feature/crow-186-move-to-active-button
Apr 22, 2026
Merged

Add 'Move to Active' button on completed sessions#188
dhilgaertner merged 2 commits intomainfrom
feature/crow-186-move-to-active-button

Conversation

@dhilgaertner
Copy link
Copy Markdown
Contributor

@dhilgaertner dhilgaertner commented Apr 22, 2026

Closes #186

Summary

  • Adds a Move to Active button to the session detail view, gated on session.status == .completed, that flips the session back to active.
  • Sits alongside the existing Open in VS Code / Mark as Completed buttons and is mutually exclusive with the latter (which only shows for .active/.inReview).
  • Follows the existing pattern exactly: new onSetSessionActive closure on AppState, setSessionActive(id:) helper on SessionService reusing the private updateSessionStatus(_:to:), wired in AppDelegate. No new RPC — the set-status handler and CLI already support arbitrary statuses.

Test plan

  • Build with make build (passes locally)
  • On an active session, click Mark as Completed → confirm it disappears and Move to Active appears in its place
  • Click Move to Active → status returns to active, button disappears, Mark as Completed reappears
  • Confirm the change persists across app restart
  • Confirm the button is hidden on the Manager session (covered by the existing session.id != AppState.managerSessionID guard wrapping the action-button group)

🤖 Generated with Claude Code

Closes #186. When a session is `completed`, the session detail view
now shows a Move to Active button next to Open in VS Code that flips
the status back to `active`. Mirrors the existing Mark as Completed
pattern (closure on AppState, helper on SessionService, wired in
AppDelegate, button gated on session.status).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner requested a review from dgershman as a code owner April 22, 2026 19:38
Copy link
Copy Markdown
Collaborator

@dgershman dgershman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code & Security Review

Critical Issues

None.

Security Review

Strengths:

  • No new RPC surface or external input handling — reuses the existing set-status pathway
  • The [weak service] capture in AppDelegate.swift:157 correctly avoids retain cycles, matching the pattern used by all adjacent closures
  • No user input is taken by the button; it passes a known session.id UUID through an already-validated code path

Concerns:

  • None identified

Code Quality

  • Clean, minimal change that follows the existing patterns exactly (completeSession / setSessionInReviewsetSessionActive)
  • The SessionDetailView button visibility is correctly gated: Mark as Completed shows for .active/.inReview, Move to Active shows for .completed — mutually exclusive as described
  • The Manager session guard (session.id != AppState.managerSessionID) already wraps the entire action-button group, so no additional guard is needed
  • Good SF Symbol choice (arrow.uturn.backward.circle) — communicates "undo/revert" intent clearly

Summary Table

Priority Issue
No blocking issues found

Recommendation: Approve — this is a straightforward, well-scoped addition that reuses existing infrastructure (updateSessionStatus) without introducing new API surface, state, or complexity. The 22 lines added are consistent with established patterns across all four files.

@dhilgaertner dhilgaertner merged commit 2362d22 into main Apr 22, 2026
2 checks passed
@dhilgaertner dhilgaertner deleted the feature/crow-186-move-to-active-button branch April 22, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'Move to Active' button on completed sessions

2 participants