Skip to content

fix: return to Orca landing screen after closing last terminal - #677

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/close-terminal-cmd-d-blank-screen
Apr 15, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/close-terminal-cmd-d-blank-screen

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closing the last terminal in the active worktree could leave Orca with the worktree still selected but no renderable surface. In the Cmd+D exit path, that state produced a blank workspace instead of returning to the Orca landing background.

Solution

When closeUnifiedTab removes the final renderable surface for the active worktree, clear the active worktree and active surface fields so the renderer falls back to the landing state instead of trying to render an empty split-group workspace. Added a regression test that closes the last terminal tab in the active worktree and verifies the store returns to the landing-state selection.

- Fix blank screen after closing last terminal\n\n- fix: return to landing screen after closing last terminal tab
@brennanb2025
brennanb2025 force-pushed the brennanb2025/close-terminal-cmd-d-blank-screen branch from 2d50c8f to 8f30f13 Compare April 15, 2026 22:38
@brennanb2025 brennanb2025 changed the title Fix blank screen after closing the last terminal fix: return to Orca landing screen after closing last terminal Apr 15, 2026
@brennanb2025
brennanb2025 merged commit e73f831 into main Apr 15, 2026
1 check passed
@brennanb2025
brennanb2025 deleted the brennanb2025/close-terminal-cmd-d-blank-screen branch April 15, 2026 23:08
brennanb2025 added a commit that referenced this pull request Apr 19, 2026
Adds Playwright coverage for two high-regression areas identified from the
last 200 PRs:

- worktree-lifecycle.spec.ts: guards removeWorktree cleanup (#532),
  worktree switch with right sidebar open (#598/#628/#726), and
  cross-worktree tab isolation (#542/#554).
- tab-close-navigation.spec.ts: guards visual-neighbor activation on
  editor/diff close (#693) and Landing fallback when the last visible
  surface closes (#677).
AnddyAgudelo added a commit to AnddyAgudelo/orca that referenced this pull request Aug 3, 2026
Closing every terminal/agent/browser/editor tab deselected the workspace,
which emptied the file explorer ("Select a workspace to browse files") and
the Git panel until the user re-opened the workspace and spawned a terminal.

Seven last-tab-close paths now leave `activeWorktreeId` intact: the unified
tab slice, editor.ts's two `shouldDeactivateWorktree` branches (closeFile and
closeAllFiles), the legacy terminal and browser close handlers, and the two
`leaveWorktreeIfEmpty` split-group hooks (now removed outright).

The zero-tab pane body previously rendered nothing, so tab groups gain a
quiet empty state with a direct "New terminal" action and its platform
shortcut. Its visibility is derived from observable state, never a clock and
never mount-local state: `ensureWorktreeRootGroup` creates the root group
before its first tab, and a runtime-owned worktree then waits on the host
session-tab mirror, so the empty state is suppressed for exactly that wait.
That wait ends on a publication epoch held in module-local maps, which move
no store slice when the snapshot carries zero tabs, so `web-session-tabs-sync`
publishes an explicit subscription consumed via useSyncExternalStore.

This supersedes PR stablyai#677 ("return to Orca landing screen after closing last
terminal"). stablyai#677 deselected precisely because a selected workspace with no
surfaces rendered blank; the empty state removes that failure mode, so the
landing fallback is no longer needed. Its E2E guard in
tab-close-navigation.spec.ts now asserts the new contract, and sleeping a
workspace is the route back to Landing.

Fixes stablyai#11699

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

1 participant