Skip to content

feat(layout): move panes and save divider sizes through main behind ORCA_LAYOUT_OWNER - #29192

Merged
Jinwoo-H merged 22 commits into
mainfrom
layout/c1b2-pane-gestures
Oct 16, 2026
Merged

Jinwoo-H merged 22 commits into
mainfrom
layout/c1b2-pane-gestures

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​298 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​294
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​120 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115

ELI5

This continues moving the job of deciding the tab and pane layout from the app window to the background process, in a build nobody ships yet. After split (#29185) and close, rename and equalize (#29187), the two drag gestures inside a tab now go through the background process too: dragging a pane to a new spot, and dragging the divider between panes. Builds made the normal way are unchanged.

What Changed

Stacked on #29187. In a build made with ORCA_LAYOUT_OWNER=main:

  • Dragging a pane inside a tab. On drop, the window asks the background process to move the pane, waits for the answer, then moves it. A drop that changes nothing (onto itself, or onto the side it already sits on) is still skipped by the window and never reaches the background process; without that check the shared move would rebuild the split and reset its sizes.
  • Dragging a divider. The window still redraws live while dragging, as today. When the drag ends (or a double-click resets the divider), the window sends the finished sizes and the background process saves them. Sizes are not sent while a restore is still placing the layout, because those sizes are not the user's.
  • Writes. Only the records each command touches are written (Add the dark layout.apply channel and route pane splits through main (build switch, off by default) #29185).
  • Hooks in the pane manager. Two optional hooks: one that can take a drop and run the move later, and one called after a divider drag is finished. With the switch off, neither is set, and the drop moves immediately as today.
  • Switch point added (1): terminal-pane-manager-options.ts adds both hooks when ORCA_LAYOUT_OWNER_IS_MAIN. It is deleted when the old path goes.

User-visible before and after: no change in any build that ships. In a main build, both gestures look the same and are now saved by the background process.

Why

The background process now decides the layout and the window shows the result: the same pattern as split, close, rename and equalize.

Alternatives considered:

  • Have the background process compute divider sizes. The window must draw the divider under the mouse at every frame, so asking first would make dragging lag. The window draws, and the background process saves the final sizes once.
  • Send every drop. The window already knows when a drop changes nothing. Sending those would cost a round trip and, worse, reset the split's sizes.

Moving a pane out to a new tab and closing a tab are tab actions; they come with the later tab work.

Linked Issue

Internal layout refactor, phase C1 (no public issue).

Visual Proof

N/A for every shipped build: no behaviour change. For the main build, I checked it in a hidden dev app on a tab with 3 panes:

  • A divider drag and a pane drop each went through layout.apply with an ok reply.
  • After each, the window's pane tree exactly matched the background process's saved copy (the divider at a 0.713 ratio, the moved pane in its new spot).

Testing

  • I manually tested these changes locally (macOS, hidden dev app with the switch on; built bundles with it off)

  • Automated tests added/updated

  • Pane manager: a taken drop moves only when its callback runs, and does nothing if a pane closed meanwhile; a drop that changes nothing is never offered; the ratio hook fires when a drag ends, not on a cancelled drag.

  • Window gestures: a drop waits for the answer; a drop the background process cannot take moves at once; divider sizes are skipped during a restore.

  • Same tree on both sides: on a nested, resized split, the window's move draws exactly the tree the background process saves.

  • Background process: move and size commands are saved exactly as the window saves them; the write-only-what-changed check is extended with both, with no new round-trip gaps.

  • Request checks: the side must be one of the four drop sides; sizes must be a valid pane tree.

  • Switch off, built bundles: the window bundle has no layout-owner gesture code.

Checks run: pnpm tc, oxlint, check:code-quality:changed, the RPC catalog check, the layout-writer ratchets, and 1,293 test files.

Review

A fresh review found no bugs (MERGE AS IS) and asked for more tests, now added:

  • the window's pane move draws exactly the tree the background process saves, on a nested, resized split;
  • a drop the background process cannot take is moved by the window at once;
  • a move that arrives after the pane manager is gone does nothing.

A delta review of those tests: MERGE AS IS.

Two follow-ups for before the switch is turned on:

  • a refused or failed move currently does nothing visible;
  • a divider drag finished while a move is still waiting is refused, so those sizes are not saved by the background process.

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

  • SSH and folder workspaces: the same partition lookup as the other commands.
  • Paired remote servers: they keep today's path; the window checks the host first.
  • Mobile: unchanged.
  • Performance: with the switch off, no new IPC; with it on, one request per drop and one per finished divider drag.

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)

… through main behind ORCA_LAYOUT_OWNER

A build made with ORCA_LAYOUT_OWNER=main registers layout.apply: main applies the
window's layout command to the stored partition through the shared applyLayoutCommand,
minting new ids. A user split then waits for main's answer and mounts the pane id main
minted. Every other build substitutes 'window', so neither branch is compiled in.
A load-then-save rewrite also normalizes records the command never touched. The command's
effect is now the diff between the save before and after it, written onto the stored
partition record by record. A split whose main reply says a paired server holds the tab
splits as today.
…CA_LAYOUT_OWNER

In a layout-owner build the window's pane close, title change and equalize go through
layout.apply and the window shows main's answer. A window pane close keeps the legacy
close's rules: the tab's last pane is refused, a pane restarted since main read the close is
left alone, every partition holding the tab closes it, and the tab's remote session id follows
the remaining pane. The rules sit behind a command field only layout.apply sets.
…ORCA_LAYOUT_OWNER

Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…e drops main cannot take

Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…oday

Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…de-up profile state

Claude-Session: 10569c9a-a0a1-4fc9-8469-0edfb7aed125
…row names a paired server

The split switch point asked which host to route to with a helper that falls back to the focused
server, so a focused server could claim a workspace whose row names no owner. Use the same owner
test the tab mirror uses.
…yout/c1b-pane-ops

# Conflicts:
#	src/renderer/src/components/terminal-pane/terminal-pane-split-through-layout-owner.test.ts
#	src/renderer/src/components/terminal-pane/terminal-pane-split-through-layout-owner.ts
# Conflicts:
#	src/main/persistence/loading-store/pty-binding-persistence.ts
#	src/main/persistence/terminal-topology/terminal-layout-apply.test.ts
#	src/main/persistence/terminal-topology/terminal-pane-admission.ts
#	src/main/runtime/orca-runtime.ts
#	src/main/runtime/rpc/methods/workspace-layout-apply.test.ts
#	src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts
#	src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
#	src/shared/rpc-contract/workspace-layout-params.ts
#	src/shared/workspace-layout/workspace-layout-record-patch.test.ts
#	src/shared/workspace-layout/workspace-layout-record-patch.ts
…ures

# Conflicts:
#	src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts
#	src/main/runtime/rpc/methods/workspace-layout-apply.test.ts
#	src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts
#	src/shared/rpc-contract/workspace-layout-params.ts
@Jinwoo-H
Jinwoo-H changed the base branch from layout/c1b-pane-ops to main October 16, 2026 00:42
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The change adds movePane and setPaneRatios commands to the layout command contracts. Pane-manager callbacks support deferred pane moves and divider-ratio commits. When the main layout owner is active, renderer gestures send the corresponding commands. Tests cover command validation, drop behavior, divider commits, and pane-layout updates.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 6328d

The default behavior remains unchanged, but builds enabling main layout ownership can leave a pane drop unmoved or fail to save divider sizes. Address both gaps before enabling the switch broadly.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 15 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 summarizes the primary changes: pane movement and divider-size persistence through the main process behind ORCA_LAYOUT_OWNER.
Description check Passed The description is detailed and covers the required change summary, rationale, testing, visual-proof status, compatibility considerations, checklist, and known follow-ups. The linked-issue section ide…
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.
  • Fix all pre-merge checks with AI
✨ 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: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93c80738-c3a7-4f3a-aca7-6e38dcca7146
📥 Commits

Reviewing files that changed from the base of the PR and between dad46d5 and 6328d8b.

📒 Files selected for processing: 15
  • src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts
  • src/main/runtime/rpc/methods/workspace-layout-apply.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/lib/pane-manager/pane-divider-drag.ts
  • src/renderer/src/lib/pane-manager/pane-divider.test.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.ts
  • src/renderer/src/lib/pane-manager/pane-drop-no-op.test.ts
  • src/renderer/src/lib/pane-manager/pane-manager-drag-wiring.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-tree-ops.ts
  • src/shared/rpc-contract/workspace-layout-params.ts
  • src/shared/workspace-layout/workspace-layout-record-patch.test.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.

Comment on lines +25 to +29
return sendPaneCommandToLayoutOwner(
worktreeId,
{ type: 'movePane', tabId, leafId, targetLeafId, side: zone },
{ apply: move, asToday: move }
)

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:

rg -n 'sendPaneCommandToLayoutOwner|movePane|refused' src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.ts src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts src/main/runtime/rpc/methods/workspace-layout-apply.ts

Repository: stablyai/orca

Length of output: 1845


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- gestures ---'
nl -ba src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.ts
printf '%s\n' '--- command sender ---'
nl -ba src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts
printf '%s\n' '--- references and likely consumers ---'
rg -n -F --glob '*.{ts,tsx}' -e 'takePaneDrop' -e 'sendPaneCommandToLayoutOwner' -e "type: 'movePane'" -e 'movePane' src/renderer/src src/main/src src/main 2>/dev/null || true
printf '%s\n' '--- movePane files ---'
rg --files | rg 'layout|pane|workspace' | head -200

Repository: stablyai/orca

Length of output: 41749


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- drag entrypoint ---'
nl -ba src/renderer/src/lib/pane-manager/pane-drag-reorder.ts | sed -n '100,155p'
printf '%s\n' '--- layout apply symbols ---'
rg -n -F --glob '*.{ts,tsx}' -e "'layout.apply'" -e 'layout.apply' -e 'LayoutApplyReply' -e 'LayoutRefusalCode' -e 'movePane' src/main src/shared src/renderer/src/runtime src/renderer/src/components/terminal-pane | head -240
printf '%s\n' '--- main layout apply test ---'
nl -ba src/main/runtime/rpc/methods/workspace-layout-apply.test.ts | sed -n '1,220p'
printf '%s\n' '--- command contract ---'
rg -n -F --glob '*.{ts,tsx}' -e 'export type LayoutApplyReply' -e 'type LayoutApplyReply' -e 'LayoutCommandResult' -e 'host_not_owned' -e 'layout.apply' src/shared src/main | head -240

Repository: stablyai/orca

Length of output: 32204


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- move command implementation ---'
nl -ba src/shared/workspace-layout/workspace-layout-pane-commands.ts | sed -n '1,180p'
printf '%s\n' '--- command result and refusal types ---'
nl -ba src/shared/workspace-layout/workspace-layout-command-types.ts | sed -n '130,205p'
printf '%s\n' '--- runtime routing ---'
nl -ba src/main/runtime/runtime-layout-apply.ts
nl -ba src/main/runtime/orca-runtime.ts | sed -n '155,190p'
printf '%s\n' '--- layout owner gesture tests ---'
nl -ba src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.test.ts

Repository: stablyai/orca

Length of output: 17126


Handle refused and failed pane moves before enabling this path.

For a valid, non-no-op drop, takePaneDrop returns true before main replies. The local move callback runs only on success or host_not_owned. Other refusals and RPC failures leave the pane visibly unmoved. Add an explicit failure/refusal recovery or resynchronization path. Do not call move after a refusal unless main confirms that the command was applied.

This is a user-visible functional issue, not a trivial nitpick.

Comment on lines +31 to +42
onDividerRatiosCommitted: () => {
// Why the store: the gesture's own persist has just written the window's tree there.
const root = useAppStore.getState().terminalLayoutsByTabId[tabId]?.root
if (root && pane.shouldPersistLayout()) {
const keep = (): void => {}
sendPaneCommandToLayoutOwner(
worktreeId,
{ type: 'setPaneRatios', tabId, root },
{ apply: keep, asToday: keep }
)
}
}

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'setPaneRatios|movePane|sendPaneCommandToLayoutOwner' src/main src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts | head -110

Repository: stablyai/orca

Length of output: 2098


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- candidate files ---'
rg --files src/main src/renderer/src/components/terminal-pane | rg 'layout|pane|command'
printf '%s\n' '--- exact references ---'
rg -n -F --glob '*.{ts,tsx}' -e 'sendPaneCommandToLayoutOwner' -e 'setPaneRatios' -e 'movePane' -e 'pane_structure_changed' src/main src/renderer | head -240
printf '%s\n' '--- sender implementation ---'
sed -n '1,180p' src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-commands.ts

Repository: stablyai/orca

Length of output: 41438


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- layout.apply references and owning files ---'
rg -n -F --glob '*.ts' -e "kind: 'local'" -e "'layout.apply'" -e 'workspace-layout-apply' -e 'applyWorkspaceLayout' -e 'pane_structure_changed' src/main src/shared src/renderer | head -220
printf '%s\n' '--- RPC method test ---'
sed -n '1,300p' src/main/runtime/rpc/methods/workspace-layout-apply.test.ts
printf '%s\n' '--- topology operation test ---'
sed -n '1,290p' src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts

Repository: stablyai/orca

Length of output: 39845


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- exact applyLayoutCommand declarations and calls ---'
rg -n -F --glob '*.ts' -- 'applyLayoutCommand' src/main src/shared src/renderer
printf '%s\n' '--- layout RPC registration ---'
rg -n -F --glob '*.ts' -- 'layout.apply' src/main/runtime/rpc
printf '%s\n' '--- command operation implementation ---'
sed -n '1,280p' src/shared/workspace-layout/workspace-layout-pane-commands.ts
sed -n '1,260p' src/main/persistence/terminal-topology/terminal-pane-admission.ts

Repository: stablyai/orca

Length of output: 23927


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- OrcaRuntimeService and runtime dispatch ---'
sed -n '130,205p' src/main/runtime/orca-runtime.ts
sed -n '1,100p' src/main/runtime/runtime-layout-apply.ts
printf '%s\n' '--- layout persistence contract and implementation references ---'
sed -n '1,240p' src/main/persistence/terminal-topology/layout-command-persistence.ts
rg -n -F --glob '*.ts' -e 'layoutCommand' -e 'applyCommandToSession' -e 'applyLayoutCommand(' src/main/persistence/terminal-topology src/main | head -180
printf '%s\n' '--- store layout apply implementation candidates ---'
rg -n -F --glob '*.ts' -e 'class' -e 'implements' src/main/persistence/terminal-topology | rg 'Store|Topology|Session|Layout' | head -120

Repository: stablyai/orca

Length of output: 15040


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- terminal topology commit ---'
sed -n '220,315p' src/main/persistence/terminal-topology/terminal-topology-commit.ts
printf '%s\n' '--- runDurableMutation declarations and implementation ---'
rg -n -F --glob '*.ts' -e 'runDurableMutation' -e 'DurableMutation' src/main/persistence src/main | head -180
printf '%s\n' '--- store runtime state and mutation queue context ---'
sed -n '1,260p' src/main/persistence/loading-store/store-runtime-state.ts
printf '%s\n' '--- concurrency-related layout tests ---'
rg -n -i --glob '*.ts' -e 'concurr' -e 'parallel' -e 'pending' -e 'queue' src/main/persistence/terminal-topology src/main/persistence/loading-store | head -180

Repository: stablyai/orca

Length of output: 41350


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- durable mutation implementation ---'
sed -n '1,145p' src/main/persistence/loading-store/primary-state-writes.ts
printf '%s\n' '--- layout commit wrapper ---'
sed -n '1,95p' src/main/persistence/terminal-topology/terminal-topology-commit.ts
printf '%s\n' '--- relevant mutation ordering tests ---'
sed -n '280,345p' src/main/persistence/loading-store/profile-state-worker-coordination.spec.ts
sed -n '140,220p' src/main/persistence/loading-store/terminal-close-async-durability.test.ts

Repository: stablyai/orca

Length of output: 14392


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- mutation queue implementation ---'
sed -n '195,240p' src/main/persistence/loading-store/primary-state-writes.ts
printf '%s\n' '--- applyLayout definition and call ---'
rg -n -F --glob '*.ts' -e 'function applyLayout' -e 'applyLayout(' src/main/persistence/terminal-topology/terminal-topology-commit.ts
sed -n '315,390p' src/main/persistence/terminal-topology/terminal-topology-commit.ts

Repository: stablyai/orca

Length of output: 1795


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- complete gesture implementation ---'
sed -n '1,130p' src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.ts
printf '%s\n' '--- gesture tests covering callbacks and ratio commit ---'
sed -n '1,150p' src/renderer/src/components/terminal-pane/terminal-pane-layout-owner-gestures.test.ts
printf '%s\n' '--- applyLayout implementation ---'
sed -n '100,155p' src/main/persistence/terminal-topology/terminal-topology-commit.ts

Repository: stablyai/orca

Length of output: 6745


Retry divider ratios after a pending pane move.

Main serializes the commands. The move persists first, then the stale pre-move root can make setPaneRatios return pane_structure_changed. The divider handler ignores that refusal, so the divider size is not persisted. Re-read the current root and retry once after this refusal.

Suggested fix
-        const keep = (): void => {}
-        sendPaneCommandToLayoutOwner(
-          worktreeId,
-          { type: 'setPaneRatios', tabId, root },
-          { apply: keep, asToday: keep }
-        )
+        const keep = (): void => {}
+        const saveRatios = (retry: boolean): void => {
+          const currentRoot = useAppStore.getState().terminalLayoutsByTabId[tabId]?.root
+          if (!currentRoot || !pane.shouldPersistLayout()) return
+          sendPaneCommandToLayoutOwner(
+            worktreeId,
+            { type: 'setPaneRatios', tabId, root: currentRoot },
+            {
+              apply: keep,
+              asToday: keep,
+              refused: (code) => {
+                if (retry && code === 'pane_structure_changed') {
+                  saveRatios(false)
+                }
+              }
+            }
+          )
+        }
+        saveRatios(true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
onDividerRatiosCommitted: () => {
// Why the store: the gesture's own persist has just written the window's tree there.
const root = useAppStore.getState().terminalLayoutsByTabId[tabId]?.root
if (root && pane.shouldPersistLayout()) {
const keep = (): void => {}
sendPaneCommandToLayoutOwner(
worktreeId,
{ type: 'setPaneRatios', tabId, root },
{ apply: keep, asToday: keep }
)
}
}
onDividerRatiosCommitted: () => {
// Why the store: the gesture's own persist has just written the window's tree there.
const root = useAppStore.getState().terminalLayoutsByTabId[tabId]?.root
if (root && pane.shouldPersistLayout()) {
const keep = (): void => {}
const saveRatios = (retry: boolean): void => {
const currentRoot = useAppStore.getState().terminalLayoutsByTabId[tabId]?.root
if (!currentRoot || !pane.shouldPersistLayout()) return
sendPaneCommandToLayoutOwner(
worktreeId,
{ type: 'setPaneRatios', tabId, root: currentRoot },
{
apply: keep,
asToday: keep,
refused: (code) => {
if (retry && code === 'pane_structure_changed') {
saveRatios(false)
}
}
}
)
}
saveRatios(true)
}
}

@Jinwoo-H
Jinwoo-H merged commit 118cbd0 into main Oct 16, 2026
45 checks passed
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