mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
fix(workspaces): run setup when a created workspace has only editor tabs
This commit is contained in:
+7
-6
@@ -226,21 +226,22 @@ export function ensureWorktreeHasInitialTerminal(
|
||||
const shouldCreateNewStartupTerminal =
|
||||
opts?.createNewTerminalForStartup === true && sequencedStartup !== undefined
|
||||
if (!shouldAutoCreate && !shouldCreateForExplicitWork && !shouldCreateNewStartupTerminal) {
|
||||
const existingTerminalTabId = store.tabsByWorktree[worktreeId]?.[0]?.id
|
||||
if (existingTerminalTabId && (setup || issueCommand)) {
|
||||
// Main can adopt the startup tab yet fail setup spawn; renderer still runs returned fallback setup.
|
||||
const existingTerminalTabId = store.tabsByWorktree[worktreeId]?.[0]?.id ?? null
|
||||
const queuedOnExisting = existingTerminalTabId !== null && Boolean(setup || issueCommand)
|
||||
// Main can adopt the startup tab yet fail setup spawn; renderer still runs returned fallback
|
||||
// setup. Editor- or browser-only workspaces run it in its own tab.
|
||||
if (queuedOnExisting || setup) {
|
||||
queueSetupAndIssueCommands(
|
||||
store,
|
||||
worktreeId,
|
||||
existingTerminalTabId,
|
||||
setup,
|
||||
issueCommand,
|
||||
existingTerminalTabId ? issueCommand : undefined,
|
||||
wrappedSetupCommandStr,
|
||||
opts
|
||||
)
|
||||
return existingTerminalTabId
|
||||
}
|
||||
return null
|
||||
return queuedOnExisting ? existingTerminalTabId : null
|
||||
}
|
||||
|
||||
const templatedTabId = applyDefaultTerminalTabs(
|
||||
|
||||
@@ -54,7 +54,7 @@ export function prepareCreatedWorktreeActivation({
|
||||
...(primaryTabId
|
||||
? { worktreeCreationId: creationId, providesInitialSurface: true }
|
||||
: {
|
||||
// Seeding above already queued setup on every path; passing it again opens a second Setup tab.
|
||||
// Seeding above owns setup delivery; passing it again opens a second Setup tab.
|
||||
...(result.setup && !instantFolder ? { setup: result.setup } : {}),
|
||||
...(defaultTabs ? { defaultTabs } : {}),
|
||||
...(windowStartup.startup ? { startup: windowStartup.startup } : {}),
|
||||
|
||||
Reference in New Issue
Block a user