Skip to content

A paired desktop keeps the tabs it created in a server workspace drawn from the server's layout (switch-on builds only) - #31853

Merged
Jinwoo-H merged 8 commits into
mainfrom
fd/l273-core-created-here-holds
Oct 22, 2026
Merged

Jinwoo-H merged 8 commits into
mainfrom
fd/l273-core-created-here-holds

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​764 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​763
Prod 22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​564 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​543

ELI5

This only affects test builds where the main process owns the layout (the "layout-owner" switch, still off for users). In those builds, a desktop paired to an Orca server draws the server's workspaces from the server's own layout. A tab that only this desktop knows about, such as a browser page this desktop hosts or a simulator running on this desktop, is not in the server's layout, so the server's next layout update wiped it from the screen. Now the desktop remembers which tabs it created there and keeps them, placed inside the server's own groups.

What Changed

Before (switch-on builds, a paired desktop drawing a server workspace from the server's layout updates):

  • A client-hosted browser tab this desktop created disappeared on the server's next layout update (ledger L274), because the server tracks that page outside its layout.
  • Dragging such a tab sent the server a move for a tab it doesn't know.
  • A new-split drop of it drew a desktop-only group that then snapped back with no message.
  • Splitting off the only server tab of a group shared with such a tab was refused by the server, and nothing happened.

After:

  • A desktop-local record of created-here tabs (lib/desktop-created-server-tabs.ts). It is kept per server and per workspace.
    • It is saved in this desktop's localStorage, so it survives a window reload. It never goes on the wire and is never stored on the server.
    • An id is forgotten when the server's layout starts listing it, when the tab closes, or when the worktree is removed.
    • After a reload, ids with no restored tab are pruned before the first server update.
    • It records nothing in switch-off builds.
  • The hold. The layout-update build keeps recorded tabs, inside the server's groups only, so the group tree stays exactly the server's.
    • A recorded tab drawn in a group the server lacks (opened to the side, or the server closed its group) moves to the nearest server group.
    • It shows there only if the user was on it, and the user's group follows it.
  • Drag. A recorded tab's drag stays on this desktop; no session.tabs.move names it.
  • Splits.
    • A recorded tab offers no new-split drop targets, and "Move to new pane column" is disabled for it, since it can't own a group.
    • Split checks count only the server's tabs, so the desktop no longer sends a split the server refuses.
  • Close hooks. These attach to the main-first close paths from Browser, chat and simulator tabs main-first: the window asks main for each change and draws only main's update (dark, layout-owner build only) #31516; nothing that PR deleted comes back.
  • Generic record. The record covers any tab kind.
  • Simulator tabs (owner decision Q28 (a)):
    • A simulator opened in such a workspace is noted as created here, so the server's updates keep it, including across a reload.
    • "Open to the right" there opens it in the nearest server group instead of splitting, so no desktop-only group appears.
    • The note carries an L290 comment. L290 is the later follow-up that runs the simulator on the server's host and streams it ([Feature]: support browser & mobile emulator etc for ssh workspaces or remote orca server #6701); it deletes this note.

Why

The server's layout is the one every client draws from, so the desktop must not invent groups of its own. It must not drop tabs that genuinely live only on this desktop either. Keeping a small desktop-local record and folding those tabs into the server's groups satisfies both.

Alternatives considered:

  • Publishing these tabs into the server's layout: that needs a new layout field, a capability, and filters for old clients.
  • Saving the record as a session field: that would touch about 10 session field tables, and the orcad migration could copy it onto a server.

The record's writes go through the frame hold's existing layout writes, so the layout-writer ratchet does not grow.

Linked Issue

Ledger L273-core (L274). W3's L282, L284 and L270 stack on this.

Visual Proof

N/A: dark change, switch-on builds only. Covered by unit tests against the real layout-update build, and by the server specs below.

Testing

  • Automated tests added/updated, or explained why not below

Unit tests (server-layout-frames-held-tabs.test.ts and others), with a client-hosted browser tab as the created-here tab:

  • it survives updates and a reconnect, and nothing sent to the server names it;
  • opened to the side;
  • it moves without being shown when the user is in another group;
  • the drag stays local;
  • both split fixes;
  • it is forgotten once the server publishes it;
  • it survives a reload followed by the first update;
  • pruning after a reload;
  • worktree removal clears its storage;
  • switch-off writes nothing;
  • local workspaces are unchanged.

The drag, split and reload/prune tests fail without their fixes.

Gates:

  • pnpm tc, the layout-writer ratchet (no baseline change), oxlint, check:code-quality:changed and the CI static-analysis gate pass.
  • Per-test comparison at base 99d18f7 vs head, over src/renderer/src/runtime, store, lib, components/tab-bar and components/tab-group (15,492 vs 15,512 tests), plus the remaining importer folders components/terminal-pane, hooks/ipc-events, components/right-sidebar and browser-pane/host-guest (8,790 tests). No test that passes at base fails at head, switch-on or switch-off. Switch-on has 25 failures, identical at base and head.

Server specs: switch-on, fresh build.

Spec Base 99d18f7 Head
paired-mobile-desktop-tab-composition pass pass
paired-desktop-server-layout-frames pass pass
headless-serve-focused-terminal-create pass pass
live-background-terminal-mount-authority pass pass
paired-client-hosted-browser fail (2) fail (2), same error (run at 377fdd8)

paired-client-hosted-browser fails at both with "The paired runtime could not create a managed browser tab". That is the L282/L284 create path, which W3's PR, stacked on this one, fixes.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Jinwoo-H and others added 5 commits October 21, 2026 23:38
…drawn workspace survive the server's frames (switch-on)

A tab the server's layout never lists (a client-hosted browser tab today; any kind recorded the
same way) used to vanish on the server's next frame rebuild. This desktop now records such tabs by
server and workspace, in its localStorage only (never a session field nor sent), and the server's
frame builds keep them as drawn, inside the server's own groups:
- A held tab drawn in a group the server lacks moves to the nearest server group; it shows there
  only if the user was on it, and the user's group follows it. The group tree stays the server's.
- The record forgets an id once the server's frame lists it, on close, and on worktree removal,
  and prunes ids the restored session no longer has before the first frame after a reload.
- A held tab's drag moves it here only (no session.tabs.move); it offers no new split, and a
  server tab sharing its group counts only the server's tabs for split no-ops.
- Client-hosted staging records its tab (both ids) in layout-owner builds; restage takes the
  worktree from its caller instead of scanning the store.
…tch off; clearer names

- With the switch off the record is never read, kept or written (a single gate in the record).
- The frame-drawn check is isDesktopCreatedTabInFrameDrawnServerWorkspace in
  frame-drawn-desktop-created-tabs.ts: "held" stays the frame hold's word.
- The held-tab placement drops its unread activeGroupId; the group follow derives it.
…wn workspace survives its frames (switch-on)

The server never has this desktop's emulator tab, so its frame rebuilds dropped it. The simulator
open now records the tab as created here when a server's frames draw the workspace, and opens it
in the server group it would have split beside, since that workspace has no group of this
desktop's own. L290 (the host runs and streams the simulator, #6701) removes the note.
…and can fail; the side-open test starts from another group

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The renderer now records desktop-created browser and simulator tabs associated with frame-drawn server workspaces. Frame reconciliation retains and places qualifying tabs, and removes records when tabs are published, closed, or absent after restore. Local move and split checks account for these tabs and count server-owned tabs separately.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 5ba39

In a host-scoped duplicate-worktree case, a tab can appear in the wrong server workspace or disappear from the correct one.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 48 functions across 28 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: retaining desktop-created tabs in server-drawn workspaces for switch-on builds.
Description check Passed The description is complete and aligned with the template. It explains the user impact, implementation, rationale, scope, testing, known gaps, and checklist status. It also documents the expected N/A …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and aligned with the template. It explains the user impact, implementation, rationale, scope, testing, known gaps, and checklist status. It also documents the expected N/A visual proof and the known server-spec failure.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments: 1
src/renderer/src/runtime/server-layout-frames.ts: 1

154-160: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Limit the published-tab cleanup to workspaces the frame changed.

Every translated frame loops over all translator.keys(). For each key, the code builds the full [tab.id, tab.entityId] list before forgetPublishedServerTabs can return early. Most workspaces have no record, so this is wasted work on every frame. The cost grows with workspace count times tab count.

Skip keys that have no record before building the id list. You can also restrict the loop to the workspaces named in the frame.

♻️ Proposed direction
-      for (const key of translator.keys()) {
-        forgetPublishedServerTabs(
-          key,
-          (translator.serverLayout(key)?.tabs ?? []).flatMap((tab) => [tab.id, tab.entityId])
-        )
-      }
+      for (const key of translator.keys()) {
+        if (!hasDesktopCreatedServerTabs(key)) {
+          continue
+        }
+        forgetPublishedServerTabs(
+          key,
+          (translator.serverLayout(key)?.tabs ?? []).flatMap((tab) => [tab.id, tab.entityId])
+        )
+      }

Add hasDesktopCreatedServerTabs(workspace) to desktop-created-server-tabs.ts. It returns entriesOf(workspace).length > 0.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c60912a2-1281-4abb-ac23-72a947ddd3d8
📥 Commits

Reviewing files that changed from the base of the PR and between ad4952e and c64d4b8.

📒 Files selected for processing: 27
  • src/renderer/src/components/tab-bar/tab-move-to-pane-column.ts
  • src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
  • src/renderer/src/components/tab-group/tab-group-layout-owner-commands.ts
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
  • src/renderer/src/lib/desktop-created-server-tabs-switch-off.test.ts
  • src/renderer/src/lib/desktop-created-server-tabs.test.ts
  • src/renderer/src/lib/desktop-created-server-tabs.ts
  • src/renderer/src/lib/ensure-simulator-tab.ts
  • src/renderer/src/lib/frame-drawn-desktop-created-tabs.ts
  • src/renderer/src/lib/simulator-tab-layout-owner.ts
  • src/renderer/src/runtime/held-tab-group-follow.ts
  • src/renderer/src/runtime/layout-frame-stream.ts
  • src/renderer/src/runtime/server-layout-frames-held-tabs.test.ts
  • src/renderer/src/runtime/server-layout-frames.ts
  • src/renderer/src/runtime/web-runtime-browser-creation-context.ts
  • src/renderer/src/runtime/web-runtime-browser-tab-staging-hosting-intent.test.ts
  • src/renderer/src/runtime/web-runtime-browser-tab-staging.ts
  • src/renderer/src/runtime/workspace-layout-frame-apply-check.test-fixture.ts
  • src/renderer/src/runtime/workspace-layout-frame-apply-observer.ts
  • src/renderer/src/runtime/workspace-layout-frame-operations.test.ts
  • src/renderer/src/runtime/workspace-layout-frame-sync.ts
  • src/renderer/src/store/slices/browser/browser-close-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-close-actions.ts
  • src/renderer/src/store/slices/worktrees/teardown/removed-worktree-renderer-teardown.ts
  • src/renderer/src/store/workspace-layout-frame-held-tab-groups.ts
  • src/renderer/src/store/workspace-layout-frame-held-tabs.ts
  • src/renderer/src/store/workspace-layout-frame-store-patch.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment on lines +63 to +75
const tabId = useAppStore
.getState()
.unifiedTabsByWorktree[args.worktreeId]?.find(
(tab) => tab.contentType === 'browser' && tab.entityId === workspace.id
)?.id
const staged = {
workspaceId: workspace.id,
pageId,
clientHosted: args.clientHosted === true,
...(tabId ? { tabId } : {})
}
noteClientHosting(args.environmentId, args.worktreeId, staged)
return staged

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '35,110p' src/renderer/src/runtime/web-runtime-browser-tab-staging.ts
rg -n 'stageWebRuntimeBrowserTab|noteClientHosting|restageWebRuntimeBrowserTabHostingIntent' src/renderer/src/runtime src/renderer/src/store --glob '!**/*.test.ts'

Repository: stablyai/orca

Length of output: 4457


🏁 Script executed:

set -o pipefail
sed -n '1,235p' src/renderer/src/runtime/web-runtime-browser-tab-staging.ts
printf '\n--- creation context ---\n'
sed -n '1,255p' src/renderer/src/runtime/web-runtime-browser-creation-context.ts
printf '\n--- staged/tabId/frame references ---\n'
rg -n -F --glob '*.ts' -e 'staged.tabId' -e '.tabId' -e 'isFrameDrawn' -e 'frameDrawn' -e 'clientHosted' -e 'noteClientHosting' src/renderer/src/runtime src/renderer/src/store src/renderer/src --glob '!**/*.test.ts' | head -n 300

Repository: stablyai/orca

Length of output: 41503


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- exact symbol locations ---'
rg -n -F --glob '*.ts' -e 'createBrowserTab' -e 'noteDesktopCreatedServerTab' -e 'forgetDesktopCreatedServerTab' -e 'desktopCreatedServerTab' -e 'frameDrawnPreviousTabIds' -e 'isFrameDrawnServerWorkspace' src/renderer/src src/shared
printf '%s\n' '--- snapshot application ---'
sed -n '1,240p' src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts
printf '%s\n' '--- frame-created tab handling candidates ---'
rg -l -F --glob '*.ts' -e 'frameDrawnPreviousTabIds' -e 'createdServer' -e 'DesktopCreatedServer' src/renderer/src/runtime/web-session-tabs-sync src/renderer/src/lib src/renderer/src/store | while read -r f; do echo "### $f"; sed -n '1,280p' "$f"; done

Repository: stablyai/orca

Length of output: 42441


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- createBrowserTab declarations ---'
rg -n -F --glob '*.ts' -e 'createBrowserTab:' -e 'createBrowserTab (' -e 'createBrowserTab(' src/renderer/src/store src/renderer/src/runtime | head -n 120
printf '%s\n' '--- likely tab slice files ---'
rg -l -F --glob '*.ts' 'createBrowserTab' src/renderer/src/store | head -n 80
printf '%s\n' '--- desktop hold implementation ---'
sed -n '1,220p' src/renderer/src/lib/frame-drawn-desktop-created-tabs.ts
sed -n '1,220p' src/renderer/src/lib/desktop-created-server-tabs.ts
printf '%s\n' '--- frame-drawn layout path ---'
rg -n -F --glob '*.ts' -e 'buildFrameDrawnWorkspaceStatusPatch' -e 'DESKTOP_CREATED_SERVER_TAB_HOLDS' -e 'isTabHeld' -e 'withDrawnBrowserPages' src/renderer/src/runtime src/renderer/src/store src/renderer/src/lib | head -n 200

Repository: stablyai/orca

Length of output: 29442


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- held-tab filtering ---'
sed -n '130,215p' src/renderer/src/store/workspace-layout-frame-held-tabs.ts
printf '%s\n' '--- frame-drawn patch ---'
sed -n '1,260p' src/renderer/src/runtime/web-session-tabs-sync/frame-drawn-workspace-status-patch.ts
printf '%s\n' '--- create action definitions ---'
rg -n -F --glob '*.ts' -e 'function createBrowserTab' -e 'const createBrowserTab' -e 'createBrowserTab:' src/renderer/src/store src/renderer/src/lib | grep -v '\.test\.ts' | head -n 100
printf '%s\n' '--- browser tab action files ---'
sed -n '1,280p' src/renderer/src/store/slices/browser/browser-tab-actions.ts
sed -n '1,260p' src/renderer/src/store/slices/browser/create-browser-slice.ts

Repository: stablyai/orca

Length of output: 22699


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- layout-owner browser open helper ---'
sed -n '1,300p' src/renderer/src/store/slices/browser/browser-tab-open-through-layout-owner.ts
printf '%s\n' '--- all staging tabId references and note calls ---'
rg -n -F --glob '*.ts' -e 'staged.tabId' -e 'tabId: staged' -e 'noteClientHosting(' -e 'StagedWebRuntimeBrowserTab' src/renderer/src/runtime src/renderer/src/store src/renderer/src/lib --glob '!**/*.test.ts'

Repository: stablyai/orca

Length of output: 7167


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- content-tab layout-owner open ---'
sed -n '1,340p' src/renderer/src/runtime/layout-owner-content-tab-open.ts
printf '%s\n' '--- serverTabCount consumers and related layout logic ---'
rg -n -F --glob '*.ts' -e 'serverTabCount(' -e 'serverTabCount' -e 'isDesktopCreatedServerTab(' src/renderer/src/runtime src/renderer/src/store src/renderer/src/lib --glob '!**/*.test.ts'
printf '%s\n' '--- relevant tests ---'
rg -n -F --glob '*.test.ts' -e 'serverTabCount' -e 'tab count' -e 'client-hosted' -e 'split' src/renderer/src/runtime/server-layout-frames-held-tabs.test.ts src/renderer/src/store/workspace-layout-frame-store-patch.test.ts src/renderer/src/runtime/web-runtime-session-browser-create-split-placement.test.ts 2>/dev/null | head -n 160

Repository: stablyai/orca

Length of output: 5827


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- published-record cleanup callers ---'
rg -n -F --glob '*.ts' -e 'forgetPublishedServerTabs' -e 'serverTabCount' -e 'isDesktopCreatedTabInFrameDrawnServerWorkspace' -e 'isDesktopCreatedServerTab' src --glob '!**/*.test.ts'
printf '%s\n' '--- held-tab setup and split tests ---'
sed -n '190,235p' src/renderer/src/runtime/server-layout-frames-held-tabs.test.ts
sed -n '360,455p' src/renderer/src/runtime/server-layout-frames-held-tabs.test.ts
printf '%s\n' '--- publication cleanup implementation context ---'
rg -n -F --glob '*.ts' -e 'publishedTabIds' -e 'forgetPublished' src/renderer/src/runtime src/renderer/src/store | head -n 120

Repository: stablyai/orca

Length of output: 10574


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- tab-bar ID consumers ---'
sed -n '1,125p' src/renderer/src/components/tab-group/tab-group-layout-owner-commands.ts
sed -n '125,215p' src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
sed -n '1,75p' src/renderer/src/components/tab-bar/tab-move-to-pane-column.ts
sed -n '1,65p' src/renderer/src/components/tab-bar/web-runtime-tab-move-mirror.ts
printf '%s\n' '--- frame publication cleanup ---'
sed -n '130,175p' src/renderer/src/runtime/server-layout-frames.ts

Repository: stablyai/orca

Length of output: 13301


Record the unified tab ID after layout-owner drawing.

When ORCA_LAYOUT_OWNER_IS_MAIN routes creation through openContentTabThroughLayoutOwner, stageWebRuntimeBrowserTab can run before the frame creates the unified tab. The staged record then contains workspaceId but no tabId, and no later path updates it.

The workspace ID keeps the tab during frame reconciliation, but tab-bar-ID checks do not resolve the entity ID. isDesktopCreatedTabInFrameDrawnServerWorkspace and serverTabCount can therefore treat the client-hosted tab as a server tab. A move can be mirrored to the server, and a split can be offered or applied, although the tab must remain local.

Update the desktop-created record when the layout-owner callback provides the drawn unified tab ID. Keep the existing workspace/entity ID record for frame retention.

Jinwoo-H and others added 2 commits October 22, 2026 02:09
…age census

It is keyed by a paired server's environment; a local or WSL project never has one, so a move has nothing to carry.
…core-created-here-holds

# Conflicts:
#	src/renderer/src/components/tab-group/tab-group-layout-owner-commands.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Scope held-tab retention and publication cleanup by… · server-layout-frames.ts:151-159

src/renderer/src/runtime/server-layout-frames.ts:151-159
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Scope held-tab retention and publication cleanup by environmentId.

A tab recorded for environment A can be retained in environment B's frame because the shared hold object filters only by worktreeId. When environment A publishes a tab, the unscoped cleanup can also remove the matching record for environment B. This can show A's tab in B's workspace or make B's recorded tab disappear from B's frame.

Pass the current environmentId to both hold evaluation and publication cleanup. This is the single correction for this cross-server scope defect.

Suggested fix
diff --git a/src/renderer/src/lib/desktop-created-server-tabs.ts b/src/renderer/src/lib/desktop-created-server-tabs.ts
@@
-const entriesOf = (workspace: string): Entry[] =>
-  [...recordMap().values()].filter((entry) => entry.worktreeId === workspace)
+const entriesOf = (workspace: string, environmentId?: string): Entry[] =>
+  [...recordMap().values()].filter(
+    (entry) =>
+      entry.worktreeId === workspace &&
+      (environmentId === undefined || entry.environmentId === environmentId)
+  )
@@
-export function forgetPublishedServerTabs(workspace: string, ids: Iterable<string>): void {
-  const entries = entriesOf(workspace)
+export function forgetPublishedServerTabs(
+  workspace: string,
+  ids: Iterable<string>,
+  environmentId?: string
+): void {
+  const entries = entriesOf(workspace, environmentId)
@@
-const isCreated = (workspace: string, id: string): boolean =>
-  entriesOf(workspace).some((entry) => entry.ids.has(id))
+const isCreated = (workspace: string, id: string, environmentId?: string): boolean =>
+  entriesOf(workspace, environmentId).some((entry) => entry.ids.has(id))
+
+export function desktopCreatedServerTabHolds(environmentId: string): HeldDrawnTabs {
+  const isHeld = (workspace: string, id: string): boolean =>
+    isCreated(workspace, id, environmentId)
+  return {
+    isTabHeld: isHeld,
+    isGroupLayoutHeld: () => false,
+    keepsInMainGroups: isHeld
+  }
+}
diff --git a/src/renderer/src/runtime/server-layout-frames.ts b/src/renderer/src/runtime/server-layout-frames.ts
@@
-  DESKTOP_CREATED_SERVER_TAB_HOLDS,
+  desktopCreatedServerTabHolds,
@@
-    heldTabs: DESKTOP_CREATED_SERVER_TAB_HOLDS,
+    heldTabs: desktopCreatedServerTabHolds(environmentId),
@@
         forgetPublishedServerTabs(
           key,
-          (translator.serverLayout(key)?.tabs ?? []).flatMap((tab) => [tab.id, tab.entityId])
+          (translator.serverLayout(key)?.tabs ?? []).flatMap((tab) => [tab.id, tab.entityId]),
+          environmentId
         )

ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d04d30c9-73c9-4ba6-bd3e-35651bb014af
📥 Commits

Reviewing files that changed from the base of the PR and between c3035c2 and 5ba3994.

📒 Files selected for processing: 2
  • src/renderer/src/components/tab-group/tab-group-layout-owner-commands.ts
  • src/shared/wsl-move/wsl-move-storage-dispositions.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

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