Skip to content

Add navbar terminate action for active cloud sessions#322

Merged
zortos293 merged 1 commit intodevfrom
capy/navbar-terminate-session
Apr 16, 2026
Merged

Add navbar terminate action for active cloud sessions#322
zortos293 merged 1 commit intodevfrom
capy/navbar-terminate-session

Conversation

@zortos293
Copy link
Copy Markdown
Collaborator

@zortos293 zortos293 commented Apr 16, 2026

Description

This PR implements issue #316, allowing users to forcibly terminate an active cloud session from the navbar while the app is idle. Previously, users could only resume sessions but had no way to close a stuck session without connecting to it.

Main changes:

  • Shared stop helper (src/renderer/src/App.tsx): Extracted stopSessionByTarget to centralize session stop request assembly and auth token handling; reused by both the existing in-stream stop flow and the new navbar terminate flow.

  • Navbar terminate handler (src/renderer/src/App.tsx): Added handleTerminateNavbarSession with user confirmation via window.confirm, guarded against concurrent resume/terminate/play actions, loading state (isTerminatingNavbarSession), error handling, and automatic refresh of the active session list after completion.

  • Race prevention (src/renderer/src/App.tsx): Introduced navbarSessionActionInFlightRef to track "resume" or "terminate" operations in-flight; guards in handleResumeFromNavbar, handleTerminateNavbarSession, and handlePlayGame prevent overlapping actions.

  • ActiveSessionInfo extension (src/shared/gfn.ts, src/main/gfn/cloudmatch.ts): Added streamingBaseUrl field to the active session payload so terminate requests can include the correct base URL without requiring new backend plumbing.

  • Navbar UI (src/renderer/src/components/Navbar.tsx): Replaced the standalone resume button with a flex navbar-session-actions container containing paired Resume (green) and Terminate (red) buttons; both show loading spinners during their respective operations and are disabled during conflicting actions.

  • Styling (src/renderer/src/styles.css): Added .navbar-session-terminate and .navbar-session-actions variants with error-tone gradients on hover/focus; responsive rules hide the Terminate label on narrower screens; controller-mode size adjustments applied.

Open OPE-066 OPE-066

@zortos293 zortos293 added the capy Generated by capy.ai label Apr 16, 2026 — with Capy AI
@zortos293 zortos293 merged commit 2479c90 into dev Apr 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant