Fix new workspace shortcut terminal focus (#4565)

This commit is contained in:
Neil
2026-06-03 12:25:54 -07:00
committed by GitHub
parent 9190a3391f
commit 7bf33ea224
12 changed files with 869 additions and 251 deletions
+21
View File
@@ -22,6 +22,7 @@ import type {
RepoSourceControlAiOverrides,
SourceControlAiSettings
} from './source-control-ai-types'
import type { AgentKind, LaunchSource, RequestKind } from './telemetry-events'
// Re-exported for backward compat with renderer call sites that import
// `WorkspaceCreateTelemetrySource` from '../../../shared/types'.
@@ -1538,6 +1539,7 @@ export type WorktreeSetupLaunch = {
export type WorktreeStartupLaunch = {
command: string
env?: Record<string, string>
telemetry?: { agent_kind: AgentKind; launch_source: LaunchSource; request_kind: RequestKind }
}
export type WorktreeDefaultTabsLaunch = {
@@ -1545,6 +1547,17 @@ export type WorktreeDefaultTabsLaunch = {
runCommands: boolean
}
export type WorktreeCreateTimingPhase = {
phase: string
startedAtMs: number
durationMs: number
}
export type WorktreeCreateTiming = {
totalDurationMs: number
phases: WorktreeCreateTimingPhase[]
}
export type CreateSparseCheckoutRequest = {
directories: string[]
/** Set when the directories came from a saved preset and the user did not
@@ -1601,6 +1614,9 @@ export type CreateWorktreeArgs = {
* pre-date this prop default to `unknown` at the IPC boundary instead
* of failing typecheck. */
telemetrySource?: WorkspaceSource
/** Optional startup command for callers that want the backend to spawn the
* first terminal as soon as the worktree is registered. */
startup?: WorktreeStartupLaunch
}
export type CreateWorktreeResult = {
@@ -1617,6 +1633,11 @@ export type CreateWorktreeResult = {
warning?: string
initialBaseStatus?: WorktreeBaseStatusEvent
localBaseRefRefresh?: LocalBaseRefRefreshResult
startupTerminal?: {
spawned: boolean
surface?: 'visible' | 'background'
}
timing?: WorktreeCreateTiming
}
export type PreservedWorktreeBranch = {