mirror of
https://github.com/stablyai/orca.git
synced 2026-10-15 16:02:49 +00:00
Complete parallel tour before workspace creation handoff
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user