Complete parallel tour before workspace creation handoff

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
brennanb2025
2026-05-31 22:35:18 -07:00
co-authored by Orca
parent 98383468db
commit bb1ca8a887
2 changed files with 10 additions and 2 deletions
@@ -42,6 +42,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
it('hands off from the agent sessions create-worktree step to the workspace-creation tour', () => {
const openModal = vi.fn()
const detachContextualTourSource = vi.fn()
const completeContextualTour = vi.fn()
let activeModal: ReturnType<typeof useAppStore.getState>['activeModal'] = 'none'
vi.spyOn(useAppStore, 'getState').mockImplementation(
() =>
@@ -53,6 +54,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
contextualToursSeenIds: [],
repos: [{ id: 'repo-1' }],
detachContextualTourSource,
completeContextualTour,
openModal
}) as unknown as ReturnType<typeof useAppStore.getState>
)
@@ -63,6 +65,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
'workspace-agent-sessions',
'setup_guide_parallel_work'
)
expect(completeContextualTour).toHaveBeenCalledWith('workspace-agent-sessions')
expect(openModal).toHaveBeenCalledWith('new-workspace-composer', {
telemetrySource: 'sidebar',
contextualTourSource: 'workspace_creation_modal'
@@ -85,6 +88,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
it('opens the composer without re-showing workspace creation when that tour was already seen', () => {
const openModal = vi.fn()
const detachContextualTourSource = vi.fn()
const completeContextualTour = vi.fn()
vi.spyOn(useAppStore, 'getState').mockImplementation(
() =>
({
@@ -95,6 +99,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
contextualToursSeenIds: ['workspace-creation'],
repos: [{ id: 'repo-1' }],
detachContextualTourSource,
completeContextualTour,
openModal
}) as unknown as ReturnType<typeof useAppStore.getState>
)
@@ -105,6 +110,7 @@ describe('openWorkspaceCreationComposerWithTourHandoff', () => {
'workspace-agent-sessions',
'setup_guide_parallel_work'
)
expect(completeContextualTour).toHaveBeenCalledWith('workspace-agent-sessions')
expect(openModal).toHaveBeenCalledWith('new-workspace-composer', {
telemetrySource: 'sidebar',
contextualTourSource: 'workspace_creation_modal'
@@ -12,9 +12,11 @@ export function openWorkspaceCreationComposerWithTourHandoff(): void {
state.activeContextualTourStepIndex === 1
if (shouldHandoffFromAgentSessionsTour && state.activeContextualTourSource) {
// Why: the composer modal cancels the terminal-owned tour; detaching first
// prevents the source cleanup from treating this intentional handoff as suppression.
// Why: clicking the highlighted create button is the final tour action.
// Clear it synchronously so the composer tour request is not blocked by
// a modal-cancellation effect that may run after the handoff retry window.
state.detachContextualTourSource('workspace-agent-sessions', state.activeContextualTourSource)
state.completeContextualTour('workspace-agent-sessions')
}
state.openModal('new-workspace-composer', {