diff --git a/docs/reference/new-user-parallel-work-telemetry.md b/docs/reference/new-user-parallel-work-telemetry.md index 03d77fbdb..abe64e6f8 100644 --- a/docs/reference/new-user-parallel-work-telemetry.md +++ b/docs/reference/new-user-parallel-work-telemetry.md @@ -112,7 +112,7 @@ Emit once per setup step when that step first transitions from incomplete to com Payload: -- `step_id`: one of `split-terminal`, `two-worktrees`, `notifications`, `default-agent`, `task-sources`, `setup-script`, `add-two-repos`, `agent-capabilities` +- `step_id`: one of `two-worktrees`, `browser`, `notifications`, `default-agent`, `task-sources`, `setup-script`, `add-two-repos`, `agent-capabilities` - `section_id`: `parallel-work` or `setup` - `completed_count`: integer `1..8` - `total_steps`: integer `8` diff --git a/src/main/github/work-item-details.test.ts b/src/main/github/work-item-details.test.ts index a36ac97e0..69504b92f 100644 --- a/src/main/github/work-item-details.test.ts +++ b/src/main/github/work-item-details.test.ts @@ -284,10 +284,10 @@ describe('getWorkItemDetails', () => { ) ).toBe(false) const timelineItems = details?.timelineItems - expect(timelineItems).toHaveLength(300) if (!timelineItems) { throw new Error('Expected timeline items to be present') } + expect(timelineItems).toHaveLength(300) expect(timelineItems.at(0)).toMatchObject({ assignee: 'assignee-3-0' }) expect(timelineItems.at(-1)).toMatchObject({ assignee: 'assignee-6-89' }) }) diff --git a/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx b/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx index ead0f7427..dadf8f113 100644 --- a/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx +++ b/src/renderer/src/components/feature-wall/FeatureWallSetupChecklist.tsx @@ -11,8 +11,6 @@ import { AgentCapabilitiesSetupAction } from './AgentCapabilitiesSetupAction' import { AddReposAction, SetupScriptAction, - SplitTerminalShortcutHint, - TwoAgentsAction, WorkspacesAction } from './FeatureWallSetupWorkflowActions' import { ConnectIntegrationsList } from './ConnectIntegrationsList' @@ -20,7 +18,6 @@ import { BrowserAction } from './FeatureWallBrowserAction' import { SetupBrowserVisual, SetupMultipleReposVisual, - SetupTwoAgentsVisual, SetupWorkspacesVisual } from './FeatureWallSetupStepVisuals' import { AgentStep } from '../onboarding/AgentStep' @@ -147,9 +144,6 @@ function SelectedStepAction(props: FeatureWallSetupChecklistProps): React.JSX.El if (activeStep.id === 'notifications') { return } - if (activeStep.id === 'split-terminal') { - return - } if (activeStep.id === 'two-worktrees') { return } @@ -174,9 +168,6 @@ function SelectedStepAction(props: FeatureWallSetupChecklistProps): React.JSX.El } function SelectedStepVisual(props: { stepId: FeatureWallSetupStepId }): React.JSX.Element | null { - if (props.stepId === 'split-terminal') { - return - } if (props.stepId === 'two-worktrees') { return } @@ -267,7 +258,6 @@ export function FeatureWallSetupChecklist( // Only steps with a visual constrain the caption to a narrow column so the // illustration can sit beside it; captionless steps let the copy run full width. const hasStepVisual = - activeStep?.id === 'split-terminal' || activeStep?.id === 'two-worktrees' || activeStep?.id === 'browser' || activeStep?.id === 'add-two-repos' @@ -373,11 +363,6 @@ export function FeatureWallSetupChecklist( > {activeStep.description}

- {activeStep.id === 'split-terminal' ? ( -
- -
- ) : null} {/* Action lives under the caption, not after the grid, so it sits just below the copy instead of being pushed down by the taller visual. */}
diff --git a/src/renderer/src/components/feature-wall/FeatureWallSetupStepVisuals.tsx b/src/renderer/src/components/feature-wall/FeatureWallSetupStepVisuals.tsx index beaf9f479..e3a2391be 100644 --- a/src/renderer/src/components/feature-wall/FeatureWallSetupStepVisuals.tsx +++ b/src/renderer/src/components/feature-wall/FeatureWallSetupStepVisuals.tsx @@ -1,21 +1,11 @@ import type { JSX } from 'react' -import { Check, FolderGit2, MousePointer2 } from 'lucide-react' +import { FolderGit2, MousePointer2 } from 'lucide-react' import { cn } from '@/lib/utils' // Why: these static marks replace storyboarded animations for setup steps whose // meaning reads instantly as a single mark — quieter than a looping demo. // Each compresses its step to one recognizable idea drawn from the old animation. -// A green ✓ + skeleton line: the agent-action checklist beat shared by terminal marks. -function CheckLine(props: { className?: string }): JSX.Element { - return ( - - - - - ) -} - // Mac-style terminal traffic-light dots — the signature of an Orca terminal pane. function TerminalDots(): JSX.Element { return ( @@ -27,35 +17,6 @@ function TerminalDots(): JSX.Element { ) } -// Split a terminal: one terminal split into two panes, each running an agent. -export function SetupTwoAgentsVisual(): JSX.Element { - return ( -
-
-
- -
-
- - -
-
-
- ) -} - -function SplitTerminalPane(props: { className?: string }): JSX.Element { - return ( -
- - {'>'} - - - -
- ) -} - // Why: a small, static mark of two parallel worktrees — quieter than an animated // storyboard, which read as cluttered for a step whose meaning is just "two isolated spaces." export function SetupWorkspacesVisual(): JSX.Element { diff --git a/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx b/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx index d11dfc98f..b7b648771 100644 --- a/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx +++ b/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx @@ -1,17 +1,18 @@ +// @vitest-environment happy-dom + +import { act } from 'react' +import { createRoot, type Root } from 'react-dom/client' import { afterEach, describe, expect, it, vi } from 'vitest' import { SETUP_GUIDE_PROJECT_PROMPT, - activateWorktreeTerminalForSetupTour, + WorkspacesAction, cancelPendingSetupGuideTourRequest, getSetupGuideGitRepo, isSetupGuideWorkspaceComposerRequestCurrent, promptForSetupGuideProject, - requestSetupGuideTourAfterFrame, requestSetupGuideTourWhenReady } from './FeatureWallSetupWorkflowActions' import { useAppStore } from '@/store' -import * as worktreeActivation from '@/lib/worktree-activation' -import * as webRuntimeSession from '@/runtime/web-runtime-session' import { toast } from 'sonner' import type { Repo } from '../../../../shared/types' @@ -23,23 +24,7 @@ vi.mock('sonner', () => ({ } })) -vi.mock('@/lib/worktree-activation', () => ({ - activateAndRevealWorktree: vi.fn() -})) - -vi.mock('@/lib/focus-terminal-tab-surface', () => ({ - focusTerminalTabSurface: vi.fn() -})) - -vi.mock('@/runtime/web-runtime-session', () => ({ - isWebRuntimeSessionActive: vi.fn(() => false) -})) - -vi.mock('./FeatureWallSetupStepVisuals', () => ({ - SetupTwoAgentsVisual: () =>
, - SetupWorkspacesVisual: () =>
, - SetupMultipleReposVisual: () =>
-})) +const mountedRoots: Root[] = [] function makeRepo(id: string, overrides: Partial = {}): Repo { return { @@ -53,17 +38,30 @@ function makeRepo(id: string, overrides: Partial = {}): Repo { } } -describe('TwoAgentsAction', () => { - afterEach(() => { +describe('setup guide workflow actions', () => { + afterEach(async () => { + await act(async () => { + for (const root of mountedRoots.splice(0)) { + root.unmount() + } + }) + document.body.innerHTML = '' + cancelPendingSetupGuideTourRequest() vi.restoreAllMocks() vi.unstubAllGlobals() + vi.useRealTimers() useAppStore.setState({ + activeModal: 'none', + modalData: {}, activeWorktreeId: null, worktreesByRepo: {}, tabsByWorktree: {}, activeTabId: null, activeGroupIdByWorktree: {}, - terminalLayoutsByTabId: {} + terminalLayoutsByTabId: {}, + repos: [], + activeRepoId: null, + activeContextualTourId: null }) }) @@ -94,77 +92,49 @@ describe('TwoAgentsAction', () => { expect(getSetupGuideGitRepo([makeRepo('folder', { kind: 'folder' })], 'folder')).toBeNull() }) - it('creates a terminal tab before requesting the split tour when a worktree has only editor/browser tabs', () => { - const createTab = vi.fn(() => ({ id: 'terminal-tab-1' })) - const setActiveTab = vi.fn() - const setActiveTabType = vi.fn() - vi.mocked(worktreeActivation.activateAndRevealWorktree).mockReturnValue({ primaryTabId: null }) + it('opens the workspace composer with setup-guide tour context from Multi-task', async () => { + vi.useFakeTimers() + const requestContextualTour = vi.fn() useAppStore.setState({ - activeWorktreeId: 'worktree-1', - worktreesByRepo: { - 'repo-1': [{ id: 'worktree-1', repoId: 'repo-1' }] - } as never, - tabsByWorktree: { 'worktree-1': [] }, - activeTabId: 'editor-tab-1', - activeGroupIdByWorktree: { 'worktree-1': 'group-1' }, - terminalLayoutsByTabId: {}, - closeModal: vi.fn(), - createTab: createTab as never, - setActiveTabType: setActiveTabType as never, - setActiveTab: setActiveTab as never + activeModal: 'none', + modalData: {}, + repos: [makeRepo('repo-1')], + activeRepoId: 'repo-1', + activeContextualTourId: null, + requestContextualTour: requestContextualTour as never + }) + const container = document.createElement('div') + document.body.appendChild(container) + const root = createRoot(container) + mountedRoots.push(root) + + await act(async () => { + root.render() + }) + const button = container.querySelector('button') + expect(button?.textContent).toContain('Try it out') + + await act(async () => { + button?.click() }) - const tabId = activateWorktreeTerminalForSetupTour('worktree-1') - - expect(tabId).toBe('terminal-tab-1') - expect(createTab).toHaveBeenCalledWith('worktree-1', 'group-1') - expect(setActiveTabType).toHaveBeenCalledWith('terminal') - expect(setActiveTab).toHaveBeenCalledWith('terminal-tab-1') - }) - - it('does not create a local fallback terminal for paired web runtime sessions', () => { - const createTab = vi.fn(() => ({ id: 'terminal-tab-1' })) - const setActiveTab = vi.fn() - vi.mocked(webRuntimeSession.isWebRuntimeSessionActive).mockReturnValue(true) - vi.mocked(worktreeActivation.activateAndRevealWorktree).mockReturnValue({ primaryTabId: null }) - useAppStore.setState({ - settings: { activeRuntimeEnvironmentId: 'runtime-1' } as never, - activeWorktreeId: 'worktree-1', - worktreesByRepo: { - 'repo-1': [{ id: 'worktree-1', repoId: 'repo-1' }] - } as never, - tabsByWorktree: { 'worktree-1': [] }, - activeTabId: 'editor-tab-1', - activeGroupIdByWorktree: { 'worktree-1': 'group-1' }, - terminalLayoutsByTabId: {}, - createTab: createTab as never, - setActiveTab: setActiveTab as never + expect(useAppStore.getState().activeModal).toBe('new-workspace-composer') + expect(useAppStore.getState().modalData).toMatchObject({ + initialRepoId: 'repo-1', + telemetrySource: 'unknown', + contextualTourSource: 'setup_guide_parallel_work' }) - const tabId = activateWorktreeTerminalForSetupTour('worktree-1') - - expect(tabId).toBeNull() - expect(createTab).not.toHaveBeenCalled() - expect(setActiveTab).not.toHaveBeenCalled() - }) - - it('keeps setup-guide tour work alive across the modal transition that unmounts the action', () => { - const callbacks: FrameRequestCallback[] = [] - const callback = vi.fn() - vi.stubGlobal('window', { - requestAnimationFrame: vi.fn((frameCallback: FrameRequestCallback) => { - callbacks.push(frameCallback) - return callbacks.length - }), - cancelAnimationFrame: vi.fn() + await act(async () => { + vi.runOnlyPendingTimers() }) - requestSetupGuideTourAfterFrame(callback) - callbacks[0]?.(1) - - expect(callback).toHaveBeenCalledTimes(1) - - cancelPendingSetupGuideTourRequest() + expect(requestContextualTour).toHaveBeenCalledWith( + 'workspace-creation', + 'setup_guide_parallel_work', + false, + { force: true } + ) }) it('gates setup-guide tour retries on the expected destination surface', () => { diff --git a/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.tsx b/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.tsx index eeb7568ae..e92264899 100644 --- a/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.tsx +++ b/src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.tsx @@ -3,25 +3,16 @@ import { ArrowUpRight, Plus, Save, Settings } from 'lucide-react' import { toast } from 'sonner' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { activateAndRevealWorktree } from '@/lib/worktree-activation' -import { focusTerminalTabSurface } from '@/lib/focus-terminal-tab-surface' -import { useShortcutLabel } from '@/hooks/useShortcutLabel' import { useAppStore } from '@/store' import { useAllWorktrees } from '@/store/selectors' import { getDefaultRepoHookSettings } from '../../../../shared/constants' import { isGitRepoKind } from '../../../../shared/repo-kind' -import type { - Repo, - RepoHookSettings, - TerminalPaneLayoutNode, - Worktree -} from '../../../../shared/types' +import type { Repo, RepoHookSettings, Worktree } from '../../../../shared/types' import { getRepositoryLocalCommandsSectionId } from '../settings/repository-settings-targets' import { requestContextualTourWhenReady, type RequestContextualTourWhenReadyArgs } from '../contextual-tours/request-contextual-tour-when-ready' -import { isWebRuntimeSessionActive } from '@/runtime/web-runtime-session' import { translate } from '@/i18n/i18n' export const SETUP_GUIDE_PROJECT_PROMPT = "First add a project you'd like to work on." @@ -54,76 +45,6 @@ export function AddReposAction(): React.JSX.Element { ) } -export function TwoAgentsAction(props: { done: boolean }): React.JSX.Element | null { - const targetWorktree = useSetupTargetWorktree() - const openModal = useAppStore((s) => s.openModal) - const closeModal = useAppStore((s) => s.closeModal) - const paneTarget = useSecondPaneTarget(targetWorktree?.id ?? null) - const handlePrimaryAction = useCallback(() => { - cancelPendingSetupGuideTourRequest() - if (!targetWorktree) { - promptForSetupGuideProject(openModal) - return - } - closeModal() - requestSetupGuideTourAfterFrame(() => { - activateWorktreeTerminalForSetupTour(targetWorktree.id) - requestSetupGuideTourWhenReady({ - id: 'workspace-agent-sessions', - source: 'setup_guide_parallel_work', - wasFeaturePreviouslyInteracted: false, - shouldContinue: () => isWorktreeTerminalStillCurrent(targetWorktree.id) - }) - }) - }, [closeModal, openModal, targetWorktree]) - - if (props.done || paneTarget) { - return null - } - - return ( - - ) -} - -const SETUP_HINT_KBD_CLASS = - 'rounded border border-border bg-card px-1.5 py-0.5 font-mono text-[11.5px] text-foreground' - -// Platform-aware split/close shortcuts for the active terminal pane. The -// labels resolve to ⌘D / Ctrl+Shift+D etc. based on the user's OS and overrides. -export function SplitTerminalShortcutHint(): React.JSX.Element { - const splitRight = useShortcutLabel('terminal.splitRight') - const splitDown = useShortcutLabel('terminal.splitDown') - const closePane = useShortcutLabel('terminal.closePane') - return ( -
-

- {translate( - 'auto.components.feature.wall.FeatureWallSetupWorkflowActions.971775f639', - 'Split right with' - )} - {splitRight}{' '} - {translate( - 'auto.components.feature.wall.FeatureWallSetupWorkflowActions.29e64f111d', - 'or down with' - )}{' '} - {splitDown} - {translate( - 'auto.components.feature.wall.FeatureWallSetupWorkflowActions.364430eb3d', - ', or right-click a pane and choose a split. Close the active pane with' - )} - {closePane}. -

-
- ) -} - export function WorkspacesAction(props: { done: boolean }): React.JSX.Element | null { const openModal = useAppStore((s) => s.openModal) const activeRepoId = useAppStore((s) => s.activeRepoId) @@ -305,71 +226,7 @@ export function useSetupTargetWorktree(): Worktree | null { ) } -export function activateWorktreeTerminalForSetupTour(worktreeId: string): string | null { - const activation = activateAndRevealWorktree(worktreeId) - if (!activation) { - return null - } - const state = useAppStore.getState() - const activeRuntimeEnvironmentId = state.settings?.activeRuntimeEnvironmentId ?? null - const webRuntimeActive = isWebRuntimeSessionActive(activeRuntimeEnvironmentId) - const activeGroupId = state.activeGroupIdByWorktree[worktreeId] - const tabs = state.tabsByWorktree[worktreeId] ?? [] - const activeTerminalTabId = - state.activeTabId && tabs.some((tab) => tab.id === state.activeTabId) ? state.activeTabId : null - const tabId = - activeTerminalTabId ?? - activation.primaryTabId ?? - tabs[0]?.id ?? - (webRuntimeActive ? null : state.createTab(worktreeId, activeGroupId).id) - if (!tabId) { - return null - } - // Why: the forced tour's split action targets the visible terminal tab. - // Worktree activation can restore an editor/browser as the active surface. - state.setActiveTabType('terminal') - state.setActiveTab(tabId) - focusTerminalTabSurface(tabId) - return tabId -} - -function useSecondPaneTarget(worktreeId: string | null): { tabId: string; leafId: string } | null { - const activeTabId = useAppStore((s) => s.activeTabId) - const tabsByWorktree = useAppStore((s) => s.tabsByWorktree) - const terminalLayoutsByTabId = useAppStore((s) => s.terminalLayoutsByTabId) - return useMemo(() => { - if (!worktreeId) { - return null - } - const tabIds = (tabsByWorktree[worktreeId] ?? []).map((tab) => tab.id) - const orderedTabIds = - activeTabId && tabIds.includes(activeTabId) - ? [activeTabId, ...tabIds.filter((tabId) => tabId !== activeTabId)] - : tabIds - for (const tabId of orderedTabIds) { - const root = terminalLayoutsByTabId[tabId]?.root - const secondLeafId = getSecondSplitLeafId(root) - if (secondLeafId) { - return { tabId, leafId: secondLeafId } - } - } - return null - }, [activeTabId, tabsByWorktree, terminalLayoutsByTabId, worktreeId]) -} - -function getSecondSplitLeafId(node: TerminalPaneLayoutNode | null | undefined): string | null { - if (!node || node.type === 'leaf') { - return null - } - return getLeftmostLeafId(node.second) -} - -function getLeftmostLeafId(node: TerminalPaneLayoutNode): string { - return node.type === 'leaf' ? node.leafId : getLeftmostLeafId(node.first) -} - let pendingSetupGuideTourCancel: (() => void) | null = null -let pendingSetupGuideFrame: number | null = null let setupGuideTourRequestSequence = 0 function createSetupGuideTourRequestId(): string { @@ -380,10 +237,6 @@ function createSetupGuideTourRequestId(): string { export function cancelPendingSetupGuideTourRequest(): void { pendingSetupGuideTourCancel?.() pendingSetupGuideTourCancel = null - if (pendingSetupGuideFrame !== null) { - window.cancelAnimationFrame(pendingSetupGuideFrame) - pendingSetupGuideFrame = null - } } export function requestSetupGuideTourWhenReady(args: RequestContextualTourWhenReadyArgs): void { @@ -391,14 +244,6 @@ export function requestSetupGuideTourWhenReady(args: RequestContextualTourWhenRe pendingSetupGuideTourCancel = requestContextualTourWhenReady(args) } -export function requestSetupGuideTourAfterFrame(callback: () => void): void { - cancelPendingSetupGuideTourRequest() - pendingSetupGuideFrame = window.requestAnimationFrame(() => { - pendingSetupGuideFrame = null - callback() - }) -} - export function isSetupGuideWorkspaceComposerRequestCurrent(requestId: string): boolean { const state = useAppStore.getState() const modalData = state.modalData as { setupGuideTourRequestId?: unknown } @@ -407,13 +252,3 @@ export function isSetupGuideWorkspaceComposerRequestCurrent(requestId: string): modalData.setupGuideTourRequestId === requestId ) } - -function isWorktreeTerminalStillCurrent(worktreeId: string): boolean { - const state = useAppStore.getState() - return ( - state.activeModal === 'none' && - state.activeWorktreeId === worktreeId && - state.activeView === 'terminal' && - state.activeTabType === 'terminal' - ) -} 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 66b6fc3d8..ae23c2876 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 @@ -23,8 +23,6 @@ function makeInput( orchestrationSkillInstalled: false, gitRepoCount: 0, worktreesByRepo: {}, - tabsByWorktree: {}, - terminalLayoutsByTabId: {}, hasSetupScript: false, ...overrides } @@ -42,21 +40,6 @@ function makeWorktree( } as unknown as Worktree } -function makeSplitLayout(): FeatureWallSetupProgressInput['terminalLayoutsByTabId'][string] { - return { - root: { - type: 'split', - direction: 'horizontal', - first: { type: 'leaf', leafId: 'leaf-1' }, - second: { type: 'leaf', leafId: 'leaf-2' } - } - } as never -} - -function makeLeafLayout(): FeatureWallSetupProgressInput['terminalLayoutsByTabId'][string] { - return { root: { type: 'leaf', leafId: 'leaf-1' } } as never -} - describe('getFeatureWallSetupProgress', () => { it('tracks Add 2 projects from durable git repo count', () => { expect(getFeatureWallSetupProgress(makeInput({ gitRepoCount: 1 })).stepDone).toMatchObject({ @@ -66,12 +49,11 @@ describe('getFeatureWallSetupProgress', () => { const progress = getFeatureWallSetupProgress(makeInput({ gitRepoCount: 2 })) expect(progress.stepDone['add-two-repos']).toBe(true) - expect(progress.coreTotal).toBe(9) + expect(progress.coreTotal).toBe(8) }) it('preserves the durable setup step definition order', () => { expect(getFeatureWallSetupSteps().map((step) => step.id)).toEqual([ - 'split-terminal', 'two-worktrees', 'browser', 'notifications', @@ -85,7 +67,6 @@ describe('getFeatureWallSetupProgress', () => { it('groups setup guide steps into Parallel work and Setup sections', () => { expect(getFeatureWallSetupStepsForSection('parallel-work').map((step) => step.id)).toEqual([ - 'split-terminal', 'two-worktrees', 'browser' ]) @@ -129,10 +110,10 @@ describe('getFeatureWallSetupProgress', () => { }) ) - expect(getFirstIncompleteFeatureWallSetupStepId(progress.stepDone)).toBe('split-terminal') + expect(getFirstIncompleteFeatureWallSetupStepId(progress.stepDone)).toBe('two-worktrees') }) - it('marks the step complete from durable terminal-pane split interaction state', () => { + it('does not include the removed split-terminal step in active progress', () => { const progress = getFeatureWallSetupProgress( makeInput({ featureInteractions: { @@ -141,103 +122,35 @@ describe('getFeatureWallSetupProgress', () => { }) ) - expect(progress.stepDone['split-terminal']).toBe(true) + expect(Object.hasOwn(progress.stepDone, 'split-terminal')).toBe(false) + expect(progress.coreTotal).toBe(8) }) - it('does not mark the step complete from malformed durable terminal-pane split state', () => { + it('marks all active steps complete without historical terminal split interaction', () => { const progress = getFeatureWallSetupProgress( makeInput({ + settings: { + defaultTuiAgent: 'claude', + notifications: { enabled: true, agentTaskComplete: true } + } as never, featureInteractions: { - 'terminal-pane-split': { firstInteractedAt: Number.NaN, interactionCount: 1 } - } - }) - ) - - expect(progress.stepDone['split-terminal']).toBe(false) - }) - - it('does not mark the step complete from generic pane interaction state', () => { - const progress = getFeatureWallSetupProgress( - makeInput({ - featureInteractions: { - 'terminal-panes': { firstInteractedAt: 1_700_000_000_000, interactionCount: 1 } - } - }) - ) - - expect(progress.stepDone['split-terminal']).toBe(false) - }) - - it('does not mark the step complete when a worktree tab has only a single pane', () => { - const progress = getFeatureWallSetupProgress( - makeInput({ - worktreesByRepo: { 'repo-1': [makeWorktree('worktree-1')] }, - tabsByWorktree: { - 'worktree-1': [{ id: 'tab-1', title: 'Terminal' }] as never + browser: { firstInteractedAt: 1_700_000_000_000, interactionCount: 1 } }, - terminalLayoutsByTabId: { 'tab-1': makeLeafLayout() } + worktreesByRepo: { + 'repo-1': [makeWorktree('main', { isMainWorktree: true }), makeWorktree('worktree-1')] + }, + hasConnectedTaskSource: true, + hasSetupScript: true, + gitRepoCount: 2, + browserUseSkillInstalled: true, + computerUseSkillInstalled: true, + computerUsePermissionsReady: true, + orchestrationSkillInstalled: true }) ) - expect(progress.stepDone['split-terminal']).toBe(false) - }) - - it('does not mark the step complete from a live split layout without durable state', () => { - const progress = getFeatureWallSetupProgress( - makeInput({ - worktreesByRepo: { 'repo-1': [makeWorktree('worktree-1')] }, - tabsByWorktree: { - 'worktree-1': [{ id: 'tab-1', title: 'Terminal' }] as never - }, - terminalLayoutsByTabId: { 'tab-1': makeSplitLayout() } - }) - ) - - expect(progress.stepDone['split-terminal']).toBe(false) - }) - - it('keeps the step complete after the split tab closes from durable state', () => { - const withSplit = getFeatureWallSetupProgress( - makeInput({ - featureInteractions: { - 'terminal-pane-split': { firstInteractedAt: 1_700_000_000_000, interactionCount: 1 } - }, - worktreesByRepo: { 'repo-1': [makeWorktree('worktree-1')] }, - tabsByWorktree: { - 'worktree-1': [{ id: 'tab-1', title: 'Terminal' }] as never - }, - terminalLayoutsByTabId: { 'tab-1': makeSplitLayout() } - }) - ) - - expect(withSplit.stepDone['split-terminal']).toBe(true) - - const afterClosingSplitTab = getFeatureWallSetupProgress( - makeInput({ - featureInteractions: { - 'terminal-pane-split': { firstInteractedAt: 1_700_000_000_000, interactionCount: 1 } - }, - worktreesByRepo: { 'repo-1': [makeWorktree('worktree-1')] }, - tabsByWorktree: { 'worktree-1': [] }, - terminalLayoutsByTabId: {} - }) - ) - - expect(afterClosingSplitTab.stepDone['split-terminal']).toBe(true) - }) - - it('ignores split layouts for tabs that do not belong to a known worktree', () => { - const progress = getFeatureWallSetupProgress( - makeInput({ - worktreesByRepo: { 'repo-1': [makeWorktree('worktree-1')] }, - tabsByWorktree: { - 'worktree-1': [{ id: 'tab-1', title: 'Terminal' }] as never - }, - terminalLayoutsByTabId: { 'orphan-tab': makeSplitLayout() } - }) - ) - - expect(progress.stepDone['split-terminal']).toBe(false) + expect(progress.coreDoneCount).toBe(8) + expect(Object.values(progress.stepDone).every(Boolean)).toBe(true) }) it('does not mark the step complete from the main checkout alone', () => { 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 2d0866d84..35196cb4f 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 @@ -4,12 +4,7 @@ import { FEATURE_WALL_SETUP_STEPS, type FeatureWallSetupStepId } from '../../../../shared/feature-wall-setup-steps' -import type { - GlobalSettings, - TerminalLayoutSnapshot, - TerminalTab, - Worktree -} from '../../../../shared/types' +import type { GlobalSettings, Worktree } from '../../../../shared/types' export type FeatureWallSetupProgressInput = { ready?: boolean @@ -23,8 +18,6 @@ export type FeatureWallSetupProgressInput = { orchestrationSkillInstalled: boolean gitRepoCount: number worktreesByRepo: Record - tabsByWorktree: Record - terminalLayoutsByTabId: Record hasSetupScript: boolean } @@ -63,7 +56,6 @@ export function getFeatureWallSetupProgress( notifications: input.settings?.notifications.enabled === true && input.settings.notifications.agentTaskComplete === true, - 'split-terminal': hasFeatureInteraction(input.featureInteractions, 'terminal-pane-split'), 'two-worktrees': countAvailableNonMainWorktrees(input.worktreesByRepo) >= 1, // Why: the 'browser' interaction fires when a non-blank page is viewed, so // opening any real page in Orca's browser durably completes this milestone. diff --git a/src/renderer/src/components/settings/settings-setup-guide-progress-hook.test.tsx b/src/renderer/src/components/settings/settings-setup-guide-progress-hook.test.tsx index d8bd108f0..12060d19b 100644 --- a/src/renderer/src/components/settings/settings-setup-guide-progress-hook.test.tsx +++ b/src/renderer/src/components/settings/settings-setup-guide-progress-hook.test.tsx @@ -18,15 +18,14 @@ function makeProgress(): FeatureWallSetupProgress { 'default-agent': true, 'add-two-repos': false, notifications: true, - 'split-terminal': true, 'two-worktrees': true, browser: false, 'task-sources': true, 'agent-capabilities': false, 'setup-script': false }, - coreDoneCount: 5, - coreTotal: 9 + coreDoneCount: 4, + coreTotal: 8 } } @@ -43,7 +42,7 @@ describe('useSettingsSetupGuideProgress', () => { it('uses the same setup progress path as the main sidebar', () => { mocks.useSetupGuideProgress.mockReturnValue(makeProgress()) - expect(renderToStaticMarkup()).toContain('5/9') + expect(renderToStaticMarkup()).toContain('4/8') expect(mocks.useSetupGuideProgress).toHaveBeenCalledWith(true, false, false) }) @@ -54,17 +53,16 @@ describe('useSettingsSetupGuideProgress', () => { 'default-agent': true, 'add-two-repos': true, notifications: true, - 'split-terminal': true, 'two-worktrees': true, browser: true, 'task-sources': true, 'agent-capabilities': true, 'setup-script': true }, - coreDoneCount: 9 + coreDoneCount: 8 }) - expect(renderToStaticMarkup()).toContain('9/9') + expect(renderToStaticMarkup()).toContain('8/8') }) it('shows browser incomplete after the browser migration has already run for fresh users', () => { @@ -74,16 +72,15 @@ describe('useSettingsSetupGuideProgress', () => { 'default-agent': true, 'add-two-repos': true, notifications: true, - 'split-terminal': true, 'two-worktrees': true, browser: false, 'task-sources': true, 'agent-capabilities': true, 'setup-script': true }, - coreDoneCount: 8 + coreDoneCount: 7 }) - expect(renderToStaticMarkup()).toContain('8/9') + expect(renderToStaticMarkup()).toContain('7/8') }) }) diff --git a/src/renderer/src/components/settings/settings-setup-guide-progress.test.ts b/src/renderer/src/components/settings/settings-setup-guide-progress.test.ts index 39188a1f4..18ebe0e07 100644 --- a/src/renderer/src/components/settings/settings-setup-guide-progress.test.ts +++ b/src/renderer/src/components/settings/settings-setup-guide-progress.test.ts @@ -26,9 +26,8 @@ describe('settings setup guide progress', () => { }) }) - it('does not mark Settings complete when only the old five-step subset is done', () => { + it('does not mark Settings complete when only the old setup subset is done', () => { const stepDone = { - 'split-terminal': true, 'two-worktrees': true, notifications: true, 'default-agent': true, @@ -37,7 +36,7 @@ describe('settings setup guide progress', () => { expect(getSettingsSetupGuideProgress({ ready: true, stepDone })).toEqual({ ready: true, - doneCount: 5, + doneCount: 4, total: FEATURE_WALL_SETUP_STEPS.length, firstIncompleteStepId: 'agent-capabilities' }) @@ -74,7 +73,7 @@ describe('settings setup guide progress', () => { const progress = getSettingsSetupGuideProgress({ ready: false, stepDone: { - 'split-terminal': true + 'two-worktrees': true } }) diff --git a/src/renderer/src/components/setup-guide/setup-guide-browser-milestone-progress.ts b/src/renderer/src/components/setup-guide/setup-guide-browser-milestone-progress.ts index d6162f3e0..230b70f2d 100644 --- a/src/renderer/src/components/setup-guide/setup-guide-browser-milestone-progress.ts +++ b/src/renderer/src/components/setup-guide/setup-guide-browser-milestone-progress.ts @@ -7,7 +7,8 @@ import { import type { FeatureWallSetupProgress } from '../feature-wall/feature-wall-setup-progress' export function useSetupGuideBrowserMilestoneProgress( - rawProgress: FeatureWallSetupProgress + rawProgress: FeatureWallSetupProgress, + historicalSplitTerminalDone: boolean ): FeatureWallSetupProgress { const setupGuideSidebarDismissed = useAppStore((s) => s.setupGuideSidebarDismissed) const browserMilestoneMigrated = useAppStore((s) => s.setupGuideBrowserMilestoneMigrated) @@ -19,6 +20,7 @@ export function useSetupGuideBrowserMilestoneProgress( !browserMilestoneMigrated && rawProgress.ready ? shouldMarkBrowserMilestoneLegacyComplete({ stepDone: rawProgress.stepDone, + historicalSplitTerminalDone, setupGuideSidebarDismissed }) : false @@ -44,12 +46,18 @@ export function useSetupGuideBrowserMilestoneProgress( export function shouldMarkBrowserMilestoneLegacyComplete(input: { stepDone: Partial> + historicalSplitTerminalDone: boolean setupGuideSidebarDismissed: boolean }): boolean { if (input.setupGuideSidebarDismissed) { return true } - return FEATURE_WALL_SETUP_STEPS.every((step) => step.id === 'browser' || input.stepDone[step.id]) + // Why: browser migration preserves the old pre-browser checklist, which + // included the now-removed split-terminal milestone. + return ( + input.historicalSplitTerminalDone && + FEATURE_WALL_SETUP_STEPS.every((step) => step.id === 'browser' || input.stepDone[step.id]) + ) } export function getSetupGuideBrowserMilestoneAwareProgress( diff --git a/src/renderer/src/components/setup-guide/use-setup-guide-progress.test.ts b/src/renderer/src/components/setup-guide/use-setup-guide-progress.test.ts index 7062696e7..7baab33fa 100644 --- a/src/renderer/src/components/setup-guide/use-setup-guide-progress.test.ts +++ b/src/renderer/src/components/setup-guide/use-setup-guide-progress.test.ts @@ -30,7 +30,6 @@ function makeProgress(overrides: Partial = {}): Featur 'default-agent': false, 'add-two-repos': false, notifications: false, - 'split-terminal': false, 'two-worktrees': false, browser: false, 'task-sources': false, @@ -48,15 +47,27 @@ describe('browser milestone legacy setup guide progress', () => { expect( shouldMarkBrowserMilestoneLegacyComplete({ stepDone: makePreBrowserDoneStepState(), + historicalSplitTerminalDone: true, setupGuideSidebarDismissed: false }) ).toBe(true) }) + it('does not waive browser for old profiles missing historical split completion', () => { + expect( + shouldMarkBrowserMilestoneLegacyComplete({ + stepDone: makePreBrowserDoneStepState(), + historicalSplitTerminalDone: false, + setupGuideSidebarDismissed: false + }) + ).toBe(false) + }) + it('marks old profiles as legacy-complete when the sidebar checklist was dismissed', () => { expect( shouldMarkBrowserMilestoneLegacyComplete({ stepDone: {}, + historicalSplitTerminalDone: false, setupGuideSidebarDismissed: true }) ).toBe(true) @@ -66,8 +77,9 @@ describe('browser milestone legacy setup guide progress', () => { expect( shouldMarkBrowserMilestoneLegacyComplete({ stepDone: { - 'split-terminal': true + 'two-worktrees': true }, + historicalSplitTerminalDone: true, setupGuideSidebarDismissed: false }) ).toBe(false) diff --git a/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts b/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts index fe54be5d7..89842c2a8 100644 --- a/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts +++ b/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts @@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react' import { useAppStore } from '@/store' import { isGitRepoKind } from '../../../../shared/repo-kind' +import { hasFeatureInteraction } from '../../../../shared/feature-interactions' import { checkRuntimeHooks } from '@/runtime/runtime-hooks-client' import { getLocalPreflightContext, localPreflightContextKey } from '@/lib/local-preflight-context' import { hasEffectiveSetupCommand } from '@/lib/setup-script-status' @@ -44,8 +45,6 @@ export function useSetupGuideProgress( const settings = useAppStore((s) => s.settings) const featureInteractions = useAppStore((s) => s.featureInteractions) const worktreesByRepo = useAppStore((s) => s.worktreesByRepo) - const tabsByWorktree = useAppStore((s) => s.tabsByWorktree) - const terminalLayoutsByTabId = useAppStore((s) => s.terminalLayoutsByTabId) const preflightStatus = useAppStore((s) => s.preflightStatus) const preflightStatusChecked = useAppStore((s) => s.preflightStatusChecked) const preflightStatusContextKey = useAppStore((s) => s.preflightStatusContextKey) @@ -294,8 +293,6 @@ export function useSetupGuideProgress( orchestrationSkillInstalled || detectedOrchestrationSkillInstalled, gitRepoCount, worktreesByRepo, - tabsByWorktree, - terminalLayoutsByTabId, hasSetupScript: currentSetupScriptProbe.hasSetupScript }), [ @@ -307,15 +304,17 @@ export function useSetupGuideProgress( detectedBrowserUseSkillInstalled, detectedOrchestrationSkillInstalled, featureInteractions, - terminalLayoutsByTabId, gitRepoCount, hasConnectedTaskSource, currentSetupScriptProbe.hasSetupScript, orchestrationSkillInstalled, settings, - tabsByWorktree, worktreesByRepo ] ) - return useSetupGuideBrowserMilestoneProgress(rawProgress) + const historicalSplitTerminalDone = hasFeatureInteraction( + featureInteractions, + 'terminal-pane-split' + ) + return useSetupGuideBrowserMilestoneProgress(rawProgress, historicalSplitTerminalDone) } diff --git a/src/renderer/src/components/setup-guide/use-setup-guide-telemetry.test.ts b/src/renderer/src/components/setup-guide/use-setup-guide-telemetry.test.ts index 52235fb96..fd6e3c737 100644 --- a/src/renderer/src/components/setup-guide/use-setup-guide-telemetry.test.ts +++ b/src/renderer/src/components/setup-guide/use-setup-guide-telemetry.test.ts @@ -37,7 +37,7 @@ describe('setup guide step completion telemetry', () => { 'add-two-repos': true }) ) - ).toBe('split-terminal') + ).toBe('two-worktrees') expect( getSetupGuideTelemetryFirstIncompleteStepId( createProgress( @@ -61,21 +61,21 @@ describe('setup guide step completion telemetry', () => { }) recordSetupGuideStepCompletionTelemetry({ state, - progress: createProgress({ 'split-terminal': true }), + progress: createProgress({ 'two-worktrees': true }), setupGuideVisible: false }) expect(trackMock).not.toHaveBeenCalled() - expect([...readEmittedSetupGuideStepIds()]).toEqual(['split-terminal']) + expect([...readEmittedSetupGuideStepIds()]).toEqual(['two-worktrees']) recordSetupGuideStepCompletionTelemetry({ state, - progress: createProgress({ 'split-terminal': true, 'two-worktrees': true }), + progress: createProgress({ browser: true, 'two-worktrees': true }), setupGuideVisible: false }) expect(trackMock).not.toHaveBeenCalled() - expect([...readEmittedSetupGuideStepIds()].sort()).toEqual(['split-terminal', 'two-worktrees']) + expect([...readEmittedSetupGuideStepIds()].sort()).toEqual(['browser', 'two-worktrees']) }) it('emits visible setup-guide completions during the startup baseline window', () => { diff --git a/src/renderer/src/components/sidebar/SetupGuideSidebarEntry.test.tsx b/src/renderer/src/components/sidebar/SetupGuideSidebarEntry.test.tsx index 9ccce4fbe..7bf0d3846 100644 --- a/src/renderer/src/components/sidebar/SetupGuideSidebarEntry.test.tsx +++ b/src/renderer/src/components/sidebar/SetupGuideSidebarEntry.test.tsx @@ -51,7 +51,6 @@ function makeProgress(overrides: Partial = {}): Featur 'default-agent': false, 'add-two-repos': false, notifications: false, - 'split-terminal': false, 'two-worktrees': false, browser: false, 'task-sources': false, @@ -59,7 +58,7 @@ function makeProgress(overrides: Partial = {}): Featur 'setup-script': false }, coreDoneCount: 0, - coreTotal: 9, + coreTotal: 8, ...overrides } } @@ -72,15 +71,14 @@ function makeAllDoneProgress( 'default-agent': true, 'add-two-repos': true, notifications: true, - 'split-terminal': true, 'two-worktrees': true, browser: true, 'task-sources': true, 'agent-capabilities': true, 'setup-script': true }, - coreDoneCount: 9, - coreTotal: 9, + coreDoneCount: 8, + coreTotal: 8, ...overrides }) } @@ -91,8 +89,8 @@ function makeOnlyBrowserIncompleteProgress(): FeatureWallSetupProgress { ...makeAllDoneProgress().stepDone, browser: false }, - coreDoneCount: 8, - coreTotal: 9 + coreDoneCount: 7, + coreTotal: 8 }) } diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts index f26d9adc1..57eaca106 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts @@ -1209,7 +1209,7 @@ export function useTerminalPaneLifecycle({ const initialPane = manager.getActivePane() ?? manager.getPanes()[0] // Why: setup/issue automation panes are internal workspace bootstrap flows, - // not the user-visible split-terminal milestone recorded below. + // not the user-initiated terminal split interaction recorded below. if (setupSplit) { if (initialPane) { const setupPane = splitPaneWithOneShotStartup( diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 539d594fa..54dfb1937 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -10026,7 +10026,6 @@ "1a6a7d6c80": "Setup", "713cc529a5": "Milestones", "b1f1981c5e": "See tasks", - "505f4c910c": "split-terminal", "0235b268b2": "Not done yet", "13294d3405": "Done" }, @@ -10039,9 +10038,6 @@ "a7463915b6": "Failed to save setup script", "6299297dac": "Setup script saved", "f0bbf7da77": "Try it out", - "364430eb3d": ", or right-click a pane and choose a split. Close the active pane with", - "29e64f111d": "or down with", - "971775f639": "Split right with", "522cce9e33": "Add project" }, "FeatureWallTourPanel": { diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 0810d50d3..404463410 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -10026,7 +10026,6 @@ "1a6a7d6c80": "Configuración", "713cc529a5": "Hitos", "b1f1981c5e": "Ver tareas", - "505f4c910c": "terminal dividido", "0235b268b2": "Aún no hecho", "13294d3405": "Hecho" }, @@ -10039,9 +10038,6 @@ "a7463915b6": "No se pudo guardar el script de configuración", "6299297dac": "Script de configuración guardado", "f0bbf7da77": "Pruébalo", - "364430eb3d": "o haga clic con el botón derecho en un panel y elija una división. Cierre el panel activo con", - "29e64f111d": "o abajo con", - "971775f639": "Dividir a la derecha con", "522cce9e33": "Agregar proyecto" }, "FeatureWallTourPanel": { diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 8abd583d9..bb09cb3bb 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -10026,7 +10026,6 @@ "1a6a7d6c80": "設定", "713cc529a5": "マイルストーン", "b1f1981c5e": "タスクを参照", - "505f4c910c": "分割 terminal", "0235b268b2": "まだ終わっていない", "13294d3405": "完了" }, @@ -10039,9 +10038,6 @@ "a7463915b6": "セットアップ スクリプトの保存に失敗しました", "6299297dac": "セットアップスクリプトが保存されました", "f0bbf7da77": "試してみてください", - "364430eb3d": "、またはペインを右クリックして分割を選択します。アクティブなペインを閉じる", - "29e64f111d": "またはダウン", - "971775f639": "右に分割", "522cce9e33": "プロジェクトの追加" }, "FeatureWallTourPanel": { diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index a8cc9d3e1..0fd59771e 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -10026,7 +10026,6 @@ "1a6a7d6c80": "설정", "713cc529a5": "마일스톤", "b1f1981c5e": "작업 보기", - "505f4c910c": "분할 terminal", "0235b268b2": "아직 완료되지 않음", "13294d3405": "완료" }, @@ -10039,9 +10038,6 @@ "a7463915b6": "설정 스크립트를 저장하지 못했습니다.", "6299297dac": "설정 스크립트가 저장되었습니다.", "f0bbf7da77": "사용해 보세요", - "364430eb3d": ", 또는 창을 마우스 오른쪽 버튼으로 클릭하고 분할을 선택합니다. 다음을 사용하여 활성 창을 닫습니다.", - "29e64f111d": "아니면 아래로", - "971775f639": "오른쪽으로 분할", "522cce9e33": "프로젝트 추가" }, "FeatureWallTourPanel": { diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 4bdf6629d..a3c929383 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -10026,7 +10026,6 @@ "1a6a7d6c80": "设置", "713cc529a5": "里程碑", "b1f1981c5e": "查看任务", - "505f4c910c": "分体终端", "0235b268b2": "还没有完成", "13294d3405": "完成" }, @@ -10039,9 +10038,6 @@ "a7463915b6": "无法保存设置脚本", "6299297dac": "设置脚本已保存", "f0bbf7da77": "尝试一下", - "364430eb3d": ",或右键单击窗格并选择拆分。关闭活动窗格", - "29e64f111d": "或向下", - "971775f639": "向右拆分", "522cce9e33": "添加项目" }, "FeatureWallTourPanel": { diff --git a/src/renderer/src/lib/feature-education-telemetry.test.ts b/src/renderer/src/lib/feature-education-telemetry.test.ts index 24165d725..5533b17a2 100644 --- a/src/renderer/src/lib/feature-education-telemetry.test.ts +++ b/src/renderer/src/lib/feature-education-telemetry.test.ts @@ -85,19 +85,20 @@ describe('feature education telemetry helpers', () => { it('tracks setup guide step completion with bounded section and count fields', () => { trackSetupGuideStepCompleted({ - stepId: 'split-terminal', + stepId: 'two-worktrees', completedCount: 99, totalSteps: 8, setupGuideVisible: true }) expectTrackedFeatureEducationTelemetry('setup_guide_step_completed', { - step_id: 'split-terminal', + step_id: 'two-worktrees', section_id: 'parallel-work', completed_count: 8, total_steps: 8, setup_guide_visible: true }) + expect(getSetupGuideStepSection('browser')).toBe('parallel-work') expect(getSetupGuideStepSection('notifications')).toBe('setup') }) @@ -105,11 +106,22 @@ describe('feature education telemetry helpers', () => { const storage = createMemoryStorage() vi.stubGlobal('localStorage', storage) - persistEmittedSetupGuideStepId('split-terminal') - persistEmittedSetupGuideStepId('split-terminal') + persistEmittedSetupGuideStepId('two-worktrees') + persistEmittedSetupGuideStepId('two-worktrees') persistEmittedSetupGuideStepId('setup-script') - expect([...readEmittedSetupGuideStepIds()].sort()).toEqual(['setup-script', 'split-terminal']) + expect([...readEmittedSetupGuideStepIds()].sort()).toEqual(['setup-script', 'two-worktrees']) + }) + + it('ignores inactive historical setup guide step ids from local storage', () => { + const storage = createMemoryStorage() + vi.stubGlobal('localStorage', storage) + storage.setItem( + 'orca.setupGuideTelemetryCompletedSteps.v1', + JSON.stringify(['split-terminal', 'two-worktrees']) + ) + + expect([...readEmittedSetupGuideStepIds()]).toEqual(['two-worktrees']) }) it('tracks terminal pane split with explicit source and direction', () => { diff --git a/src/renderer/src/lib/feature-education-telemetry.ts b/src/renderer/src/lib/feature-education-telemetry.ts index e65fe1265..29c072002 100644 --- a/src/renderer/src/lib/feature-education-telemetry.ts +++ b/src/renderer/src/lib/feature-education-telemetry.ts @@ -9,6 +9,7 @@ import { type TerminalPaneSplitSource } from '../../../shared/feature-education-telemetry' import { + getFeatureWallSetupSectionId, isFeatureWallSetupStepId, type FeatureWallSetupStepId } from '../../../shared/feature-wall-setup-steps' @@ -17,10 +18,6 @@ import { track } from './telemetry' const SETUP_GUIDE_TELEMETRY_COMPLETED_STEPS_STORAGE_KEY = 'orca.setupGuideTelemetryCompletedSteps.v1' const TERMINAL_PANE_SPLIT_TELEMETRY_STORAGE_KEY = 'orca.terminalPaneSplitTelemetry.v1' -const SETUP_GUIDE_PARALLEL_WORK_STEP_IDS = new Set([ - 'split-terminal', - 'two-worktrees' -]) type FeatureEducationTelemetryEventName = Extract< EventName, @@ -195,7 +192,7 @@ export function reserveTerminalPaneSplitTelemetry( } export function getSetupGuideStepSection(id: FeatureWallSetupStepId): 'parallel-work' | 'setup' { - return SETUP_GUIDE_PARALLEL_WORK_STEP_IDS.has(id) ? 'parallel-work' : 'setup' + return getFeatureWallSetupSectionId(id) } function emitFeatureEducationTelemetry( diff --git a/src/shared/feature-wall-setup-steps.ts b/src/shared/feature-wall-setup-steps.ts index 11879e287..60a440f5c 100644 --- a/src/shared/feature-wall-setup-steps.ts +++ b/src/shared/feature-wall-setup-steps.ts @@ -2,7 +2,6 @@ export type FeatureWallSetupStepId = | 'default-agent' | 'add-two-repos' | 'notifications' - | 'split-terminal' | 'two-worktrees' | 'browser' | 'task-sources' @@ -17,7 +16,6 @@ export type FeatureWallSetupStep = { } export const FEATURE_WALL_SETUP_PARALLEL_WORK_STEP_IDS = [ - 'split-terminal', 'two-worktrees', 'browser' ] as const satisfies readonly FeatureWallSetupStepId[] @@ -25,13 +23,6 @@ export const FEATURE_WALL_SETUP_PARALLEL_WORK_STEP_IDS = [ export type FeatureWallSetupSectionId = 'parallel-work' | 'setup' export const FEATURE_WALL_SETUP_STEPS: readonly FeatureWallSetupStep[] = [ - { - id: 'split-terminal', - name: 'Split a terminal', - subtitle: 'Split a terminal', - description: - 'Split a terminal to run two things at once: two agents, an agent next to a dev server, or logs beside a shell.' - }, { id: 'two-worktrees', name: 'Multi-task', diff --git a/src/shared/telemetry-events-feature-education.test.ts b/src/shared/telemetry-events-feature-education.test.ts index 970217077..10e9be51e 100644 --- a/src/shared/telemetry-events-feature-education.test.ts +++ b/src/shared/telemetry-events-feature-education.test.ts @@ -70,7 +70,7 @@ describe('feature education telemetry event schemas', () => { source: 'help_menu', initial_completed_count: 0, total_steps: 8, - first_incomplete_step_id: 'split-terminal' + first_incomplete_step_id: 'two-worktrees' }).success ).toBe(true) @@ -85,4 +85,15 @@ describe('feature education telemetry event schemas', () => { }).success ).toBe(true) }) + + it('rejects inactive historical setup guide step ids', () => { + expect( + eventSchemas.setup_guide_opened.safeParse({ + source: 'help_menu', + initial_completed_count: 0, + total_steps: 8, + first_incomplete_step_id: 'split-terminal' + }).success + ).toBe(false) + }) })