mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 16:03:45 +00:00
A terminal publishes one row per pane, and `getRuntimeLeafIdsForTerminal` returns none when there is no live pane and no persisted layout — which is exactly what `createTerminalTab` seeds (`emptyLayoutSnapshot()`) until TerminalPane mounts. The group still named it, so the snapshot published `tabGroups`, a `tabGroupLayout` leaf and an `activeGroupId` for a tab the client is sent no row for. Off the active worktree, where nothing mounts, that state lasts until the user goes there. Hold such a terminal out of the group projection. The existing machinery does the rest: an emptied group leaves `tabGroups`, its layout leaf is pruned with it, and `resolvePublishedActiveGroupId` moves the pointer. Old clients are unaffected in outcome: `buildHostToLocalTabIdMap` never had a key for the tab, so `buildMirroredHostGroups` already dropped it from the group's order and skipped a group left empty. The host now sends what the client was already computing.