diff --git a/dev-dashboard/frontend/src/App.svelte b/dev-dashboard/frontend/src/App.svelte index 68ffa5fc28..e75ec33412 100644 --- a/dev-dashboard/frontend/src/App.svelte +++ b/dev-dashboard/frontend/src/App.svelte @@ -4,24 +4,17 @@ import TopBar from "./lib/TopBar.svelte"; import Terminal from "./lib/Terminal.svelte"; import ConfirmDialog from "./lib/ConfirmDialog.svelte"; + import CreateWorktreeDialog from "./lib/CreateWorktreeDialog.svelte"; import type { WorktreeInfo } from "./lib/types"; import type { Profile } from "./lib/api"; import * as api from "./lib/api"; - const PROFILES: { value: Profile; label: string }[] = [ - { value: "agent-only", label: "Agent only" }, - { value: "agent-yolo", label: "Agent (skip permissions)" }, - { value: "full", label: "Full (agent + backend + frontend)" }, - ]; - let worktrees = $state([]); let selectedBranch = $state(null); let removeBranch = $state(null); let removingBranches = $state>(new Set()); let showCreateDialog = $state(false); let creating = $state(false); - let createProfile = $state("agent-only"); - let createName = $state(""); let visibleWorktrees = $derived( worktrees.filter((w) => w.path === "(here)" || w.branch === "main" || w.mux === "✓") @@ -47,14 +40,13 @@ return result; } - async function handleCreate() { - const branch = createName.trim() || randomName(8); + async function handleCreate(name: string, profile: Profile) { + const branch = name || randomName(8); creating = true; try { - await api.createWorktree(branch, createProfile); + await api.createWorktree(branch, profile); await api.openWorktree(branch); showCreateDialog = false; - createName = ""; await refresh(); selectedBranch = branch; } catch (err) { @@ -135,51 +127,11 @@ {#if showCreateDialog} - {@const btn = "px-3 py-1.5 rounded-md border border-edge bg-surface text-primary text-xs cursor-pointer hover:bg-hover"} - -

New Worktree

-
- - -
-
- {#each PROFILES as profile} - - {/each} -
-
- - -
-
-
(showCreateDialog = false)}>
+ (showCreateDialog = false)} + /> {/if} {#if removeBranch} diff --git a/dev-dashboard/frontend/src/lib/ConfirmDialog.svelte b/dev-dashboard/frontend/src/lib/ConfirmDialog.svelte index 22aaa3e4fc..fa90579d85 100644 --- a/dev-dashboard/frontend/src/lib/ConfirmDialog.svelte +++ b/dev-dashboard/frontend/src/lib/ConfirmDialog.svelte @@ -16,15 +16,17 @@ -

Confirm

-

{message}

-
- - -
+
{ e.preventDefault(); onconfirm(); }}> +

Confirm

+

{message}

+
+ + +
+
diff --git a/dev-dashboard/frontend/src/lib/CreateWorktreeDialog.svelte b/dev-dashboard/frontend/src/lib/CreateWorktreeDialog.svelte new file mode 100644 index 0000000000..d49aa7d9f9 --- /dev/null +++ b/dev-dashboard/frontend/src/lib/CreateWorktreeDialog.svelte @@ -0,0 +1,68 @@ + + + +
{ e.preventDefault(); oncreate(name.trim(), profile); }}> +

New Worktree

+
+ + +
+
+ {#each PROFILES as p} + + {/each} +
+
+ + +
+
+