diff --git a/desktop/e2e/integration.e2e.ts b/desktop/e2e/integration.e2e.ts index 58e38bce5..07ce89190 100644 --- a/desktop/e2e/integration.e2e.ts +++ b/desktop/e2e/integration.e2e.ts @@ -232,11 +232,11 @@ test.describe await dialog.locator("button", { hasText: "docker" }).first().click() await dialog.getByRole("button", { name: /^continue$/i }).click() - // Step 2 — Source: click Node.js template. Scope to the active tab panel - // (Git) so the template button doesn't collide with the Image catalog's - // "Node.js 20" card, which is also present in the DOM. + // Step 2 — Source: click Node.js template. Scope to the active source + // panel (Git) so the template button doesn't collide with the Image + // catalog's "Node.js 20" card. await dialog - .getByRole("tabpanel") + .getByTestId("source-panel") .locator("button", { hasText: "Node.js" }) .click() const sourceInput = dialog.locator('input[placeholder*="github"]') @@ -376,10 +376,10 @@ test.describe await dialog.locator("button", { hasText: "docker" }).first().click() await dialog.getByRole("button", { name: /^continue$/i }).click() - // Step 2 — Source: click Python template (scope to the active Git tab - // panel so it doesn't match the Image tab catalog's "Python 3.12" entry) + // Step 2 — Source: click Python template (scope to the active Git source + // panel so it doesn't match the Image catalog's "Python 3.12" entry) await dialog - .getByRole("tabpanel") + .getByTestId("source-panel") .locator("button", { hasText: "Python" }) .click() const sourceInput = dialog.locator('input[placeholder*="github"]') diff --git a/desktop/e2e/workspaces.e2e.ts b/desktop/e2e/workspaces.e2e.ts index 3d5f83f36..c223c6ea9 100644 --- a/desktop/e2e/workspaces.e2e.ts +++ b/desktop/e2e/workspaces.e2e.ts @@ -82,10 +82,10 @@ test.describe.serial("Create Workspace Wizard", () => { ).toBeVisible() // Quick Start Templates section + 5 core templates. Scope to the active - // tab panel (Git) so the template buttons don't collide with the Image - // tab's catalog entries (e.g. "Python 3.12"), which share language names. + // source panel (Git) so the template buttons don't collide with the Image + // source's catalog entries (e.g. "Python 3.12"), which share language names. await expect(dialog).toContainText("Quick Start Templates") - const gitPanel = dialog.getByRole("tabpanel") + const gitPanel = dialog.getByTestId("source-panel") for (const lang of ["Python", "Node.js", "Go", "Rust", "Java"]) { await expect(gitPanel.locator("button", { hasText: lang })).toBeVisible() } @@ -103,7 +103,7 @@ test.describe.serial("Create Workspace Wizard", () => { test("should select a template and populate the source field", async () => { const dialog = page.locator('[role="dialog"]').first() - await dialog.getByRole("tabpanel").locator("button", { hasText: "Python" }).click() + await dialog.getByTestId("source-panel").locator("button", { hasText: "Python" }).click() const sourceInput = dialog.locator('input[placeholder*="github"]') await expect(sourceInput).toHaveValue( diff --git a/desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.svelte b/desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.svelte index 4a1fdd3f6..fd9b2f9ab 100644 --- a/desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.svelte +++ b/desktop/src/renderer/src/lib/components/workspace/WorkspaceWizard.svelte @@ -8,6 +8,9 @@ import { AlertCircle, TriangleAlert, Loader2, + GitBranch, + FolderOpen, + Container, } from "@lucide/svelte" import { Button } from "$lib/components/ui/button/index.js" import * as Command from "$lib/components/ui/command/index.js" @@ -16,7 +19,7 @@ import { Label } from "$lib/components/ui/label/index.js" import * as Popover from "$lib/components/ui/popover/index.js" import * as Dialog from "$lib/components/ui/dialog/index.js" import * as Alert from "$lib/components/ui/alert/index.js" -import * as Tabs from "$lib/components/ui/tabs/index.js" +import * as ToggleGroup from "$lib/components/ui/toggle-group/index.js" import * as Select from "$lib/components/ui/select/index.js" import { Progress } from "$lib/components/ui/progress/index.js" import { badgeVariants } from "$lib/components/ui/badge/index.js" @@ -134,6 +137,17 @@ const TEMPLATES = [ { name: "Ruby", source: "https://github.com/skevetter/devsy-quickstart-ruby" }, ] +const SOURCE_TYPES: { + value: WorkspaceSourceType + label: string + hint: string + icon: typeof GitBranch +}[] = [ + { value: "git", label: "Git Repo", hint: "Clone a repository", icon: GitBranch }, + { value: "local", label: "Local Directory", hint: "Use a folder on this machine", icon: FolderOpen }, + { value: "image", label: "Image", hint: "Start from a container image", icon: Container }, +] + const LAUNCH_TIMEOUT_MS = 10 * 60 * 1000 let { @@ -813,15 +827,29 @@ function selectTemplate(t: { name: string; source: string }) {
-