Repository navigation
feat(workspace): keep an emptied workspace open on its own empty-tabs surface - #185
Merged
nplez1 merged 3 commits intoOct 25, 2026
Conversation
… surface Closing the last tab of the active workspace no longer deselects it. The workspace stays selected, its tab strip keeps the "+" create entry, and the pane body shows an empty-tabs surface with the Orca mark, the shortcut that opens each kind of tab, a "New <agent> agent" / "New terminal" pair, and the GitHub star button. - close paths: leaveWorktreeIfEmpty, the legacy last-terminal fallback, landOnEmptiedWorktree and emptiedWorktreeLandingPatch all stop writing the landing patch, so `preserveWorktreeSelection` (now vestigial) goes away. - empty-tabs surface: WorkspaceEmptyState renders in the group body when the worktree has no terminal, browser, editor or unified rows. - sleep: only the close record distinguishes an emptied workspace from one that was never initialized, so the moon glyph, the "Hide sleeping" sweep, the jump palette and the reveal auto-unhide all read it and treat the emptied row as awake. - seeding: activation no longer forces `reseedEmptiedWorkspace`, and the gated re-seed honours the tombstone, so re-opening an emptied workspace lands on the empty-tabs surface instead of seeding the shell the user just closed. Startup hydration, workspace creation and setup/issue work still seed. Refs #96
…ed one Review round 1 found the emptiness signal and the surface's own gate both too coarse. - The predicate now requires the workspace to have nothing renderable at all (`workspace-emptied-on-purpose.ts`), so a workspace that still holds slept chat tabs or an open editor file keeps its sleeping glyph, its place in the "Hide sleeping" filter and its reveal auto-unhide instead of reading awake. - The workspace on screen with nothing to render is awake too, so closing a chat, browser or editor tab as the last one no longer makes the selected row read asleep or drop out of "Hide sleeping". - The empty-tabs surface renders only for a workspace the user emptied, not for one whose first tab is still arriving: a fresh worktree, a host-owned list still mirroring or a chat launch waiting on its host no longer flashes it. - The close-record scan is cached per map identity and status epoch, the same way the live-agent set is, and the hook reads the status clock rather than wall time. - `reseedEmptiedWorkspace` is deleted: nothing passed it any more, so the contract's escape hatch was dead. `landIfEmptied` goes the same way. - The Orca tile and wordmark are one shared `OrcaBrandMark`, so the landing screen and the empty state cannot drift (including the tile colour).
…ices The delta re-check's MINOR findings and one ratchet step, in one place. - `hasFreshClosedTabRecord` carries the record half of the predicate, so the pane can ask for a boolean instead of building a synthetic `tabsByWorktree` row. That row always passed the shared helper's existence check while the seeder read the real store, so a host-mirrored workspace whose row had not arrived could show the surface while the seeder treated it as uninitialized. The pane now requires `Object.hasOwn(state.tabsByWorktree, worktreeId)`. - One selector, so `TabGroupPanel` re-renders when this workspace's verdict changes rather than on every terminal close anywhere and every liveness epoch. The keyed literal it replaced also counted as four renderer layout writes against a baseline of one. - `useWorktreeIdsWithEmptySurface` skips a workspace it already decided, so the per-record scan cannot go quadratic. - `isWorkspaceEmptiedOnPurpose` no longer needs the shared row check: a close record only exists for a workspace that had a tab closed.
nplez1
deleted the
nplez1/feature-empty-tabs-state-closing-all-tabs-should
branch
October 25, 2026 09:59
nplez1
added a commit
that referenced
this pull request
Oct 26, 2026
Repairs the failures the merge introduced rather than allowlisting them: - process-host's sync path missed upstream's captureStderrAsBytes - a fork-only real-git test never got upstream's worker-thread child-processes - a filesystem test's mock path did not follow the file into ipc/filesystem/ - merged hunks put upstream's `orca-dev`/`.orca` back over `orca-np-dev`/`.orca-np` in four suites - markKimiWorkspaceTrusted became async; upstream's callers had no await - the conflict check had slipped behind the merge-queue branch, so a conflicting PR on a merge-queue branch was offered "Merge when ready" - the fork's autoMergeActionWhenDirectMergeAvailable lost both call sites - a Jira user field with a fixed choice list rendered as a text box - the skill bundle manifest arrived built from upstream's skills; regenerated - orca-repository.test.mjs was a pre-merge defect from #185, fixed here Records 9 environment-bound reds with evidence, all on code byte-identical to upstream 0571e45: 7 sqlite-binding (Bun 1.4.4 against Apple's system SQLite), verify-cli-bin (macOS /private/var), and reclaim-worktree-generated-files (macOS Bun reports ENOTEMPTY where Node reports EACCES). Runs the gate with upstream's own lane setting for recordDependencies: its CI sets CI, so upstream never sees the fire-and-forget teardown races this switch exposes here. Evidence in LOCAL-PATCHES.md.
nplez1
added a commit
that referenced
this pull request
Nov 25, 2026
…pty-tabs surface #185 kept an emptied workspace selected for terminal, browser and chat closes, but the two editor close paths still wrote the old landing patch: closing the last file of a workspace with no terminal or browser row (for example after the terminal was closed first) nulled activeWorktreeId and showed Landing. - closeFile and closeAllFiles no longer deselect the workspace; the now-unused unifiedTabsKeepWorktreeSelected goes with them. - The empty-tabs surface also renders when this pane has already shown content, so a last chat, browser or editor close that writes no terminal close record lands on the surface instead of a blank pane. The close record still governs re-activation and restart, where the pane has no history. - Delete tabs-empty-workspace.ts: emptiedWorktreeLandingPatch and landOnEmptiedWorktree had no callers after a sync re-homed them. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]>
nplez1
added a commit
that referenced
this pull request
Nov 26, 2026
…pty-tabs surface #185 kept an emptied workspace selected for terminal, browser and chat closes, but the two editor close paths still wrote the old landing patch: closing the last file of a workspace with no terminal or browser row (for example after the terminal was closed first) nulled activeWorktreeId and showed Landing. - closeFile and closeAllFiles no longer deselect the workspace; the now-unused unifiedTabsKeepWorktreeSelected goes with them. - The empty-tabs surface also renders when this pane has already shown content, so a last chat, browser or editor close that writes no terminal close record lands on the surface instead of a blank pane. The close record still governs re-activation and restart, where the pane has no history. - Delete tabs-empty-workspace.ts: emptiedWorktreeLandingPatch and landOnEmptiedWorktree had no callers after a sync re-homed them. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]>
nplez1
added a commit
that referenced
this pull request
Nov 26, 2026
…pty-tabs surface #185 kept an emptied workspace selected for terminal, browser and chat closes, but the two editor close paths still wrote the old landing patch: closing the last file of a workspace with no terminal or browser row (for example after the terminal was closed first) nulled activeWorktreeId and showed Landing. - closeFile and closeAllFiles no longer deselect the workspace; the now-unused unifiedTabsKeepWorktreeSelected goes with them. - The empty-tabs surface also renders when this pane has already shown content, so a last chat, browser or editor close that writes no terminal close record lands on the surface instead of a blank pane. The close record still governs re-activation and restart, where the pane has no history. - Delete tabs-empty-workspace.ts: emptiedWorktreeLandingPatch and landOnEmptiedWorktree had no callers after a sync re-homed them. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]>
nplez1
added a commit
that referenced
this pull request
Nov 26, 2026
…471) * fix(workspace): closing the last editor keeps the workspace on its empty-tabs surface #185 kept an emptied workspace selected for terminal, browser and chat closes, but the two editor close paths still wrote the old landing patch: closing the last file of a workspace with no terminal or browser row (for example after the terminal was closed first) nulled activeWorktreeId and showed Landing. - closeFile and closeAllFiles no longer deselect the workspace; the now-unused unifiedTabsKeepWorktreeSelected goes with them. - The empty-tabs surface also renders when this pane has already shown content, so a last chat, browser or editor close that writes no terminal close record lands on the surface instead of a blank pane. The close record still governs re-activation and restart, where the pane has no history. - Delete tabs-empty-workspace.ts: emptiedWorktreeLandingPatch and landOnEmptiedWorktree had no callers after a sync re-homed them. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(workspace): scope the unrecorded empty-tabs surface to the current visit Review round 1 of the editor-close fix. - The pane's "has shown content" mark resets whenever its workspace leaves the screen, so a retained pane cannot flash the surface on a later visit: sleep deselects before tearing tabs down, and an unrecorded empty workspace re-seeds on return. A host list that drops every row and re-mirrors while on screen is the remaining case, noted at the mark. - Pin the store invariant: closeFile and closeAllFiles on the only file of the active workspace leave it selected. A sync restored the landing patch once already. - Prune the layout-writer baselines after tabs-empty-workspace.ts went away. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(workspace): narrow the last-editor-close test comment to what it pins Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(workspace): keep the empty-tabs rationale out of upstream-owned files The lint gate's check-upstream-file-comments step counted 9 fork comment lines this branch added to upstream-owned files (4776 against a baseline of 4767). - Drop the two "no deselect" comments in close-file-action.ts and recently-closed-editor-tabs.ts; the rationale is in the fix commit. - Fold the surface gate's two comment blocks in useTabGroupWorkspaceModel.ts into one six-line block, under the file's baseline of seven. - Lower the baseline to 4766 with --prune. Moved out of the code: a host list that drops every row and re-mirrors while its workspace is on screen shows the empty-tabs surface until its rows return. Refs #96 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Closes the three symptoms in #96. Closing the last agent or terminal tab of a workspace
no longer deselects it: the workspace stays selected, its tab strip keeps the "+" create
entry, and the pane body shows an empty-tabs surface modelled on the landing screen — the
Orca mark and wordmark, "This workspace has no open tabs.", a
New <agent> agent/New terminalpair with their shortcuts called out, and the star-the-repo footer.leaveWorktreeIfEmpty, the legacy last-terminal fallback,landOnEmptiedWorktreeandemptiedWorktreeLandingPatchall stop writing the landingpatch, so closing the last tab leaves the workspace selected.
preserveWorktreeSelectionexisted only for that path and is deleted with its four call sites.
never initialized it", so the moon glyph, the "Hide sleeping" sweep, the jump palette and
the reveal auto-unhide all read it. The workspace on screen with nothing to render is
awake whatever emptied it.
reseedEmptiedWorkspace(the optionis gone), so re-opening an emptied workspace lands on its surface instead of seeding the
shell the user just closed. Startup restore, workspace creation and setup/issue work still
seed.
The surface renders only for a workspace the user actually emptied — nothing renderable, a
terminal row that exists, and a fresh close record — so a fresh worktree, a host-owned list
still mirroring, or a chat launch waiting on its host cannot flash it.
Verification
pnpm tcclean (18,087 / 3,231 / 37 / 16,090 files).@bc996216d4: PASS — 33 green, 0 failing.pnpm test src/renderer/src/lib src/renderer/src/components src/renderer/src/store:42,251 passed, 2 expected fail, 76 skipped, 4,706 files.
workspace-emptied-on-purpose.test.ts(10 cases), two sleep cases (a sleptchat with a close record stays asleep; the workspace on screen with nothing to render stays
awake), 5 cases in
WorkspaceEmptyState.test.tsx, 3 inTabGroupPanel.empty-workspace.test.tsx(including that the floating panel's
externalstrip does not render the surface), and thereseed suite rewritten to the new contract.
activeWorktreeIdset withtabs: 0and the surface on screen; no moon glyph and no"Sleeping" label; the row survives "Hide sleeping" on;
⌘T, the "New terminal" button andthe "New Claude agent" button each open the first tab (the agent one lands a
claudeterminal); re-selecting the emptied workspace afterwards does not re-seed a terminal.
Reviewed by Opus 5.5, high (claude/opus): R1 (3 blocking fixed), delta clean on R2. R3 applies
the delta's MINOR findings and one lint-ratchet fix — the surface gate now reads the pane's own
slices in a single boolean selector — and re-ran the same suites and lint gate at bc99621.
Known gaps, stated rather than hidden
close record, so it reads awake only while it is on screen, and shows no empty-tabs surface
or re-seed suppression when it never held a terminal. Terminal closes — the reported case —
are covered end to end. A renderer-side "emptied" mark would close this; it needs persisted
state, so it is a follow-up rather than part of this branch.
emptied workspace, so a workspace sitting empty for a month stays visible under "Hide
sleeping". Before this branch it was hidden as asleep.
still hide an emptied workspace.
landing; the source list lives insrc/shared/gh-star-source.ts, which this branch does not touch.ORCA_LAYOUT_OWNER_IS_MAIN, off in shipped builds),selectAfterClosewith no next tab does not clear the group'sactiveTabId; the landingpatch used to. The pane renders nothing either way, but that switch should be checked before
it is turned on.