From d6c0421e07da12c99e99fae69234ecb1ab59dfed Mon Sep 17 00:00:00 2001 From: brennanb2025 Date: Sun, 31 May 2026 21:21:49 -0700 Subject: [PATCH] Count imported worktrees in setup guide Co-authored-by: Orca --- .../feature-wall/feature-wall-setup-progress.test.ts | 12 +++++------- .../feature-wall/feature-wall-setup-progress.ts | 10 +++++----- src/shared/contextual-tours.ts | 2 +- src/shared/feature-wall-setup-steps.ts | 4 ++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/components/feature-wall/feature-wall-setup-progress.test.ts b/src/renderer/src/components/feature-wall/feature-wall-setup-progress.test.ts index 7be511e19f7..153fe1e29da 100644 --- a/src/renderer/src/components/feature-wall/feature-wall-setup-progress.test.ts +++ b/src/renderer/src/components/feature-wall/feature-wall-setup-progress.test.ts @@ -30,10 +30,11 @@ function makeInput( function makeWorktree( id: string, - options: { createdAt?: number; isMainWorktree?: boolean } = {} + options: { createdAt?: number; isMainWorktree?: boolean; path?: string | null } = {} ): Worktree { return { id, + path: options.path === null ? undefined : (options.path ?? `/repo/${id}`), createdAt: options.createdAt, isMainWorktree: options.isMainWorktree ?? false } as unknown as Worktree @@ -197,7 +198,7 @@ describe('getFeatureWallSetupProgress', () => { worktreesByRepo: { 'repo-1': [ makeWorktree('main', { isMainWorktree: true }), - makeWorktree('ssh-restored-placeholder') + makeWorktree('ssh-restored-placeholder', { path: null }) ] } }) @@ -206,14 +207,11 @@ describe('getFeatureWallSetupProgress', () => { expect(progress.stepDone['two-worktrees']).toBe(false) }) - it('marks the step complete once the user creates a worktree beyond the main checkout', () => { + it('marks the step complete once a non-main worktree exists beyond the main checkout', () => { const progress = getFeatureWallSetupProgress( makeInput({ worktreesByRepo: { - 'repo-1': [ - makeWorktree('main', { isMainWorktree: true }), - makeWorktree('worktree-1', { createdAt: 1_700_000_000_000 }) - ] + 'repo-1': [makeWorktree('main', { isMainWorktree: true }), makeWorktree('worktree-1')] } }) ) diff --git a/src/renderer/src/components/feature-wall/feature-wall-setup-progress.ts b/src/renderer/src/components/feature-wall/feature-wall-setup-progress.ts index bacd8716c72..1164231b770 100644 --- a/src/renderer/src/components/feature-wall/feature-wall-setup-progress.ts +++ b/src/renderer/src/components/feature-wall/feature-wall-setup-progress.ts @@ -56,14 +56,14 @@ function hasSplitTerminalInAnyWorktree(input: FeatureWallSetupProgressInput): bo return false } -function countCreatedWorktrees(worktreesByRepo: Record): number { - // Why: only count confirmed Orca-created worktrees. SSH restore can hydrate - // temporary non-main placeholders before the relay sends full worktree data. +function countAvailableNonMainWorktrees(worktreesByRepo: Record): number { + // Why: imported git worktrees count as real parallel-work capacity, but + // partially hydrated placeholders can appear before a worktree path is known. return Object.values(worktreesByRepo).reduce( (sum, worktrees) => sum + worktrees.filter( - (worktree) => !worktree.isMainWorktree && typeof worktree.createdAt === 'number' + (worktree) => !worktree.isMainWorktree && typeof worktree.path === 'string' && worktree.path ).length, 0 ) @@ -85,7 +85,7 @@ export function getFeatureWallSetupProgress( input.settings?.notifications.enabled === true && input.settings.notifications.agentTaskComplete === true, 'split-terminal': hasSplitTerminalInAnyWorktree(input), - 'two-worktrees': countCreatedWorktrees(input.worktreesByRepo) >= 1, + 'two-worktrees': countAvailableNonMainWorktrees(input.worktreesByRepo) >= 1, 'task-sources': input.hasConnectedTaskSource, 'agent-capabilities': agentCapabilitiesDone, 'setup-script': input.hasSetupScript diff --git a/src/shared/contextual-tours.ts b/src/shared/contextual-tours.ts index fa45b086436..67aa34684fa 100644 --- a/src/shared/contextual-tours.ts +++ b/src/shared/contextual-tours.ts @@ -74,7 +74,7 @@ export const CONTEXTUAL_TOURS = [ steps: [ { title: 'Work side by side', - body: 'Run more than one thread of work at once. Open a second pane with {terminal.splitRight}, or right-click the pane for split options.', + body: 'Run more than one thread of work at once. Open a second terminal pane with {terminal.splitRight}, or right-click the pane for split options.', targetSelector: '[data-contextual-tour-target="terminal-pane-split-target"], [data-contextual-tour-target="workspace-agent-terminal-tip"]', requiredForStart: true, diff --git a/src/shared/feature-wall-setup-steps.ts b/src/shared/feature-wall-setup-steps.ts index 9d24b6d058d..b72c4bc9ca7 100644 --- a/src/shared/feature-wall-setup-steps.ts +++ b/src/shared/feature-wall-setup-steps.ts @@ -25,8 +25,8 @@ export type FeatureWallSetupSectionId = 'parallel-work' | 'setup' export const FEATURE_WALL_SETUP_STEPS: readonly FeatureWallSetupStep[] = [ { id: 'split-terminal', - name: 'Open a second terminal', - subtitle: 'Open a second terminal', + name: 'Split a terminal', + subtitle: 'Split a terminal', description: 'Split the terminal to run two things at once — a second agent, a dev server, or a REPL.' },