Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/renderer/src/runtime/close-mirrored-editor-tab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ describe('notifyHostOfMirroredEditorClose', () => {
// host snapshot in the dynamic-import gap can't flash the old-path tab back.
notifyHostOfMirroredEditorClose(buildState(), 'wt-1', 'file-1')

expect(isWebSessionCloseIntentPending('wt-1', toHostSessionTabId('host-tab-1'), now)).toBe(true)
expect(
isWebSessionCloseIntentPending('env-1', 'wt-1', toHostSessionTabId('host-tab-1'), now)
).toBe(true)
})

it('closes the mirrored editor tab on the host using the host tab id', async () => {
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/src/runtime/close-mirrored-editor-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export function notifyHostOfMirroredEditorClose(
}
// Record the close intent SYNCHRONOUSLY so a host snapshot landing before the dynamic import below resolves can't
// flash the old-path tab back. closeWebRuntimeSessionTab re-records it idempotently.
recordWebSessionCloseIntent(worktreeId, toHostSessionTabId(unifiedTab.id), Date.now())
recordWebSessionCloseIntent(
runtimeEnvironmentId,
worktreeId,
toHostSessionTabId(unifiedTab.id),
Date.now()
)
// Dynamic import: this helper is imported by the editor slice during store creation, so importing
// web-runtime-session eagerly imports the store back and trips cyclic init in full-suite import order.
void import('./web-runtime-session').then(({ closeWebRuntimeSessionTab }) =>
Expand Down
Loading