Files
orca/src/shared/initial-folder-workspace-state.ts
T
Brennan Benson 46575a257f Open fresh desktop profiles in a ~ folder workspace (#37898)
Fresh desktop profiles start in an ordinary folder workspace at the OS home directory, with the initial repo group named ~. Onboarding Continue saves the selected default agent and launches it in that workspace through the normal activation path. Existing profiles and user-renamed groups remain unchanged.

Independent reviews and prior real Claude/Codex QA are complete. Refreshed-head CI is green, including all unit shards, changed E2E, static/typecheck, packages, persistence and WSL. All 54 focused regression tests passed; three bounded local check timeouts are documented in the PR.
2026-11-06 16:29:36 -08:00

30 lines
1009 B
TypeScript

import { LOCAL_EXECUTION_HOST_ID } from './execution-host'
import type { PersistedState } from './persisted-state-types'
import { projectHostSetupProjectionFromRepos } from './project-host-setup-projection'
import type { Repo } from './repo-types'
import { getRepoMainWorktreeId } from './worktree/id'
import { worktreeWorkspaceKey } from './workspace-scope'
export function createInitialFolderWorkspaceState(
state: PersistedState,
repo: Repo
): PersistedState {
const repos = [repo]
const projection = projectHostSetupProjectionFromRepos(repos)
const worktreeId = getRepoMainWorktreeId(repo)
return {
...state,
repos,
projects: [...projection.projects],
projectHostSetups: [...projection.setups],
workspaceSession: {
...state.workspaceSession,
activeRepoId: repo.id,
activeWorktreeId: worktreeId,
activeWorkspaceKey: worktreeWorkspaceKey(worktreeId),
activeWorkspaceExecutionHostId: LOCAL_EXECUTION_HOST_ID,
activeTabId: null
}
}
}