From cce7bb41f14e26ad475ffbefc610f43cf5bf3afb Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 3 Sep 2026 14:30:34 -0700 Subject: [PATCH] fix: scope workspace-creation-project tour target to project picker only Move the tour target attribute from the outer project section to an inner wrapper around just the combobox and its messages, excluding the header label and "Add project" button. Update tests to verify the narrower scope. --- .../NewWorkspaceComposerCard.test.tsx | 20 +++++-- .../NewWorkspaceComposerProjectSection.tsx | 58 ++++++++++--------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.test.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.test.tsx index 86cc6a3bb1a..1456f7e30ad 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.test.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.test.tsx @@ -190,9 +190,18 @@ const pnpmInstallSetupConfig = { } const vmRecipeHostOptions: ProjectHostSetupOption[] = [ - { kind: 'ready', id: 'setup-local', label: 'Local Mac', path: '/Users/alice/orca' }, - { kind: 'ready', id: 'setup-builder', label: 'Builder', path: '/workspace/orca' } -] as never + localReadyHostOption, + { + kind: 'ready', + id: 'setup-builder', + projectId: 'project-group:platform', + hostId: 'ssh:builder', + repoId: 'repo-a', + label: 'Builder', + detail: 'Orca', + path: '/workspace/orca' + } +] function findConnectButton(label: string): HTMLButtonElement | undefined { const item = findRunTargetItem(label) @@ -317,7 +326,7 @@ function unmountCurrent(): void { } function findWaitSwitch(container: HTMLElement): HTMLButtonElement | null { - return container.querySelector( + return container.querySelector( '[role="switch"][aria-label="Wait for setup to complete before starting agent"]' ) } @@ -404,6 +413,9 @@ describe('NewWorkspaceComposerCard folder task source mode', () => { expect(projectTourTarget?.querySelector('[data-project-combobox-root="true"]')).toBeTruthy() expect(projectTourTarget?.querySelector('[data-run-target-combobox-root="true"]')).toBeNull() expect(projectTourTarget?.textContent).not.toContain('Run on') + expect(projectTourTarget?.querySelector('label')).toBeNull() + expect(projectTourTarget?.querySelector('[aria-label="Add project"]')).toBeNull() + expect(current.container.querySelector('[aria-label="Add project"]')).toBeTruthy() const runTargetPicker = current.container.querySelector( 'div[data-run-target-combobox-root="true"]' diff --git a/src/renderer/src/components/new-workspace/NewWorkspaceComposerProjectSection.tsx b/src/renderer/src/components/new-workspace/NewWorkspaceComposerProjectSection.tsx index c526d9a8fc6..1928b205ff6 100644 --- a/src/renderer/src/components/new-workspace/NewWorkspaceComposerProjectSection.tsx +++ b/src/renderer/src/components/new-workspace/NewWorkspaceComposerProjectSection.tsx @@ -81,7 +81,7 @@ export function NewWorkspaceComposerProjectSection({ }: NewWorkspaceComposerProjectSectionProps): React.JSX.Element { return (
-
+
- - {projectError ? ( -

- {projectError} -

- ) : projectOptions.length === 0 ? ( -

- {emptyProjectMessage ?? - translate( - 'auto.components.NewWorkspaceComposerCard.addProjectBeforeWorkspace', - 'Add a project before creating a workspace.' - )} -

- ) : null} +
+ + {projectError ? ( +

+ {projectError} +

+ ) : projectOptions.length === 0 ? ( +

+ {emptyProjectMessage ?? + translate( + 'auto.components.NewWorkspaceComposerCard.addProjectBeforeWorkspace', + 'Add a project before creating a workspace.' + )} +

+ ) : null} +
{shouldShowRunTargetPicker ? (