Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(agentic-ide): batch assign launcher agents

Ruben Lütke5897d7d1d9bb
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx
new file mode 100644
index 0000000000..fec271e5ac
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx
@@ -0,0 +1,192 @@
+import { useState } from "react";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import type { AgentAccount } from "@/lib/agentAccountsApi";
+import type { AgentStatus } from "@/lib/agenticIdeApi";
+import { AgentAllocation, type PlannedTerminal } from "./AgentAllocation";
+
+const COPY: Record<string, string> = {
+ "workspace_launcher.agents.all": "All",
+ "workspace_launcher.agents.select": "Select {0}",
+ "workspace_launcher.agents.decrease": "Use one fewer {0} terminal",
+ "workspace_launcher.agents.count_for": "Terminal count for {0}",
+ "workspace_launcher.agents.increase": "Use one more {0} terminal",
+ "workspace_launcher.agents.account_for": "Subscription for {0}",
+};
+
+vi.mock("@/i18n", () => ({
+ useT: () => (key: string) => COPY[key] ?? key,
+}));
+
+const AGENTS: AgentStatus[] = [
+ {
+ name: "claude",
+ display_name: "Claude Code",
+ installed: true,
+ version: "2.1",
+ install_command: null,
+ },
+ {
+ name: "codex",
+ display_name: "Codex",
+ installed: true,
+ version: "0.142",
+ install_command: null,
+ },
+ {
+ name: "opencode",
+ display_name: "OpenCode",
+ installed: false,
+ version: null,
+ install_command: "npm install -g opencode-ai",
+ },
+];
+
+const ACCOUNTS: AgentAccount[] = [
+ {
+ id: "claude:default",
+ platform: "claude",
+ label: "Default",
+ config_dir: "",
+ builtin: true,
+ connected: true,
+ mode: "subscription",
+ message: "",
+ email: null,
+ tier: null,
+ },
+ {
+ id: "claude:work",
+ platform: "claude",
+ label: "Work seat",
+ config_dir: "C:/accounts/work",
+ builtin: false,
+ connected: true,
+ mode: "subscription",
+ message: "",
+ email: null,
+ tier: null,
+ },
+];
+
+function Harness({
+ count = 5,
+ accounts = [],
+}: {
+ count?: number;
+ accounts?: AgentAccount[];
+}) {
+ const [planned, setPlanned] = useState<PlannedTerminal[]>(
+ Array.from({ length: count }, (_, index) => ({
+ agent: "",
+ name: `T${index + 1}`,
+ })),
+ );
+ return (
+ <>
+ <AgentAllocation
+ planned={planned}
+ agents={AGENTS}
+ accountsFor={(platform) => (platform === "claude" ? accounts : [])}
+ onPlanned={(update) => setPlanned((previous) => update(previous))}
+ />
+ <output data-testid="plan">{JSON.stringify(planned)}</output>
+ </>
+ );
+}
+
+function plan(): PlannedTerminal[] {
+ return JSON.parse(
+ screen.getByTestId("plan").textContent ?? "[]",
+ ) as PlannedTerminal[];
+}
+
+afterEach(cleanup);
+
+describe("AgentAllocation", () => {
+ it("assigns every terminal to one agent with one click", () => {
+ render(<Harness />);
+
+ fireEvent.click(screen.getAllByRole("button", { name: "All" })[0]);
+
+ expect(plan().map((pane) => pane.agent)).toEqual([
+ "claude",
+ "claude",
+ "claude",
+ "claude",
+ "claude",
+ ]);
+ expect(screen.getByText("5 / 5")).toBeTruthy();
+ });
+
+ it("turns a typed count into a batch split without per-terminal editing", () => {
+ render(<Harness count={17} />);
+ fireEvent.click(screen.getAllByRole("button", { name: "All" })[0]);
+
+ fireEvent.change(
+ screen.getByRole("spinbutton", { name: "Terminal count for Codex" }),
+ { target: { value: "7" } },
+ );
+
+ const agents = plan().map((pane) => pane.agent);
+ expect(agents.filter((agent) => agent === "claude")).toHaveLength(10);
+ expect(agents.filter((agent) => agent === "codex")).toHaveLength(7);
+ });
+
+ it("splits every slot evenly across installed agents", () => {
+ render(<Harness />);
+
+ fireEvent.click(screen.getByText("workspace_launcher.agents.split_evenly"));
+
+ expect(plan().map((pane) => pane.agent)).toEqual([
+ "claude",
+ "claude",
+ "claude",
+ "codex",
+ "codex",
+ ]);
+ });
+
+ it("can place one of each and leave the remaining slots visibly open", () => {
+ render(<Harness />);
+
+ fireEvent.click(screen.getByText("workspace_launcher.agents.one_each"));
+
+ expect(plan().map((pane) => pane.agent)).toEqual([
+ "claude",
+ "codex",
+ "",
+ "",
+ "",
+ ]);
+ expect(screen.getByText("2 / 5")).toBeTruthy();
+ });
+
+ it("applies one selected subscription to every terminal of an agent", () => {
+ render(<Harness count={3} accounts={ACCOUNTS} />);
+ fireEvent.click(screen.getAllByRole("button", { name: "All" })[0]);
+
+ fireEvent.change(
+ screen.getByRole("combobox", { name: "Subscription for Claude Code" }),
+ { target: { value: "claude:work" } },
+ );
+
+ expect(plan().map((pane) => pane.account)).toEqual([
+ "claude:work",
+ "claude:work",
+ "claude:work",
+ ]);
+ });
+
+ it("shows unavailable agents without allowing them to consume slots", () => {
+ render(<Harness />);
+
+ expect(
+ (
+ screen.getByRole("spinbutton", {
+ name: "Terminal count for OpenCode",
+ }) as HTMLInputElement
+ ).disabled,
+ ).toBe(true);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.tsx
new file mode 100644
index 0000000000..d36ed6ed24
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.tsx
@@ -0,0 +1,390 @@
+/**
+ * Allocate terminal slots by agent instead of editing every pane separately.
+ * The backend still receives its existing one-entry-per-terminal plan.
+ */
+import { Check, Minus, Plus, SquareTerminal } from "lucide-react";
+import { useT } from "@/i18n";
+import { cn } from "@/lib/utils";
+import type { AgentAccount } from "@/lib/agentAccountsApi";
+import type { AgentStatus } from "@/lib/agenticIdeApi";
+import { Button, Select, SectionLabel } from "./controls";
+
+export interface PlannedTerminal {
+ agent: string;
+ name: string;
+ /** Which subscription of `agent` this pane opens on. */
+ account?: string;
+}
+
+type Counts = Record<string, number>;
+
+export interface AgentAllocationProps {
+ planned: PlannedTerminal[];
+ agents: AgentStatus[];
+ accountsFor: (platform: string) => AgentAccount[];
+ onPlanned: (
+ update: (previous: PlannedTerminal[]) => PlannedTerminal[],
+ ) => void;
+}
+
+/** Count assigned panes without treating the unassigned sentinel as an agent. */
+export function allocationCounts(planned: PlannedTerminal[]): Counts {
+ const counts: Counts = {};
+ for (const pane of planned) {
+ if (!pane.agent) continue;
+ counts[pane.agent] = (counts[pane.agent] ?? 0) + 1;
+ }
+ return counts;
+}
+
+/**
+ * Set one agent's count. If every slot is occupied, a larger count takes slots
+ * from the largest other allocation first. Typing 7 beside Codex can therefore
+ * turn an initial 17/0 split into 10/7 in one action.
+ */
+export function setAllocationCount(
+ planned: PlannedTerminal[],
+ agentOrder: string[],
+ agent: string,
+ requested: number,
+): Counts {
+ const total = planned.length;
+ const counts = allocationCounts(planned);
+ counts[agent] = Math.max(0, Math.min(total, Math.trunc(requested || 0)));
+
+ let overflow =
+ Object.values(counts).reduce((sum, value) => sum + value, 0) - total;
+ if (overflow <= 0) return counts;
+
+ const donors = agentOrder
+ .filter((name) => name !== agent && (counts[name] ?? 0) > 0)
+ .sort((a, b) => (counts[b] ?? 0) - (counts[a] ?? 0));
+ for (const donor of donors) {
+ const taken = Math.min(overflow, counts[donor] ?? 0);
+ counts[donor] = (counts[donor] ?? 0) - taken;
+ overflow -= taken;
+ if (overflow === 0) break;
+ }
+ return counts;
+}
+
+/** Expand aggregate counts back into the backend's per-pane plan. */
+export function applyAllocation(
+ previous: PlannedTerminal[],
+ agentOrder: string[],
+ counts: Counts,
+ preferredAccounts?: Record<string, string | undefined>,
+): PlannedTerminal[] {
+ const assignments: string[] = [];
+ const known = new Set(agentOrder);
+ const order = [
+ ...agentOrder,
+ ...Object.keys(counts)
+ .filter((name) => !known.has(name))
+ .sort(),
+ ];
+ for (const agent of order) {
+ const count = Math.max(0, Math.trunc(counts[agent] ?? 0));
+ for (
+ let index = 0;
+ index < count && assignments.length < previous.length;
+ index += 1
+ ) {
+ assignments.push(agent);
+ }
+ }
+
+ return previous.map((pane, index) => {
+ const agent = assignments[index] ?? "";
+ if (!agent) return { name: pane.name, agent: "" };
+ return {
+ name: pane.name,
+ agent,
+ account: preferredAccounts?.[agent],
+ };
+ });
+}
+
+function preferredAccounts(
+ planned: PlannedTerminal[],
+): Record<string, string | undefined> {
+ const result: Record<string, string | undefined> = {};
+ for (const pane of planned) {
+ if (pane.agent && !(pane.agent in result))
+ result[pane.agent] = pane.account;
+ }
+ return result;
+}
+
+export function AgentAllocation({
+ planned,
+ agents,
+ accountsFor,
+ onPlanned,
+}: AgentAllocationProps) {
+ const t = useT();
+ const counts = allocationCounts(planned);
+ const assigned = Object.values(counts).reduce((sum, value) => sum + value, 0);
+ const total = planned.length;
+ const unassigned = Math.max(0, total - assigned);
+ const installed = agents.filter((agent) => agent.installed);
+ const agentOrder = agents.map((agent) => agent.name);
+
+ const commitCounts = (next: Counts) =>
+ onPlanned((previous) =>
+ applyAllocation(previous, agentOrder, next, preferredAccounts(previous)),
+ );
+
+ const setCount = (agent: string, next: number) =>
+ onPlanned((previous) =>
+ applyAllocation(
+ previous,
+ agentOrder,
+ setAllocationCount(previous, agentOrder, agent, next),
+ preferredAccounts(previous),
+ ),
+ );
+
+ const oneEach = () => {
+ const next: Counts = {};
+ installed.slice(0, total).forEach((agent) => {
+ next[agent.name] = 1;
+ });
+ commitCounts(next);
+ };
+
+ const splitEvenly = () => {
+ const next: Counts = {};
+ if (installed.length === 0) return commitCounts(next);
+ const base = Math.floor(total / installed.length);
+ const remainder = total % installed.length;
+ installed.forEach((agent, index) => {
+ next[agent.name] = base + (index < remainder ? 1 : 0);
+ });
+ commitCounts(next);
+ };
+
+ const setAccount = (agent: string, account: string | undefined) =>
+ onPlanned((previous) =>
+ previous.map((pane) =>
+ pane.agent === agent ? { ...pane, account } : pane,
+ ),
+ );
+
+ return (
+ <div>
+ <div className="border-b border-border/70 pb-5">
+ <div className="flex items-end justify-between gap-5">
+ <div>
+ <SectionLabel>
+ {t("workspace_launcher.agents.allocation")}
+ </SectionLabel>
+ <p className="mt-1 max-w-2xl text-xs leading-relaxed text-muted-foreground">
+ {t("workspace_launcher.agents.hint")}
+ </p>
+ </div>
+ <p className="shrink-0 font-mono text-sm tabular-nums text-foreground">
+ {assigned} / {total}
+ </p>
+ </div>
+ <div
+ className="mt-4 h-1.5 overflow-hidden rounded-full bg-muted"
+ role="progressbar"
+ aria-label={t("workspace_launcher.agents.assigned")}
+ aria-valuemin={0}
+ aria-valuemax={total}
+ aria-valuenow={assigned}
+ >
+ <div
+ className="h-full origin-left rounded-full bg-primary transition-transform duration-200"
+ style={{
+ transform: `scaleX(${total === 0 ? 0 : assigned / total})`,
+ }}
+ />
+ </div>
+ <p className="mt-2 text-right text-[11px] text-muted-foreground">
+ {unassigned === 0
+ ? t("workspace_launcher.agents.all_assigned")
+ : t("workspace_launcher.agents.unassigned").replace(
+ "{0}",
+ String(unassigned),
+ )}
+ </p>
+ </div>
+
+ <div className="flex flex-wrap items-center gap-2 border-b border-border/70 py-4">
+ <SectionLabel className="mr-1">
+ {t("workspace_launcher.agents.quick_fill")}
+ </SectionLabel>
+ <Button
+ variant="quiet"
+ onClick={oneEach}
+ disabled={installed.length === 0}
+ >
+ {t("workspace_launcher.agents.one_each")}
+ </Button>
+ <Button
+ variant="quiet"
+ onClick={splitEvenly}
+ disabled={installed.length === 0}
+ >
+ {t("workspace_launcher.agents.split_evenly")}
+ </Button>
+ <Button
+ variant="subtle"
+ onClick={() => commitCounts({})}
+ disabled={assigned === 0}
+ >
+ {t("workspace_launcher.agents.clear")}
+ </Button>
+ </div>
+
+ <div className="border-b border-border/70">
+ {agents.map((agent) => {
+ const count = counts[agent.name] ?? 0;
+ const accounts = accountsFor(agent.name);
+ const selectedAccount =
+ planned.find((pane) => pane.agent === agent.name)?.account ?? "";
+ return (
+ <div
+ key={agent.name}
+ className={cn(
+ "grid gap-3 border-b border-border/50 px-1 py-3 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",
+ count > 0 && "bg-primary/[0.035]",
+ )}
+ >
+ <div className="flex min-w-0 items-center gap-3">
+ <button
+ type="button"
+ aria-pressed={count > 0}
+ aria-label={t("workspace_launcher.agents.select").replace(
+ "{0}",
+ agent.display_name,
+ )}
+ disabled={!agent.installed}
+ onClick={() => setCount(agent.name, count > 0 ? 0 : 1)}
+ className={cn(
+ "flex h-8 w-8 shrink-0 items-center justify-center rounded-control border transition-colors",
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 disabled:cursor-not-allowed disabled:opacity-40",
+ count > 0
+ ? "border-primary/60 bg-primary text-primary-foreground"
+ : "border-border bg-card/60 text-muted-foreground hover:border-primary/40",
+ )}
+ >
+ {count > 0 ? (
+ <Check className="h-4 w-4" />
+ ) : (
+ <SquareTerminal className="h-4 w-4" />
+ )}
+ </button>
+ <div className="min-w-0">
+ <div className="flex flex-wrap items-baseline gap-x-2 gap-y-0.5">
+ <span className="font-medium text-foreground">
+ {agent.display_name}
+ </span>
+ <span className="text-[11px] text-muted-foreground">
+ {agent.installed
+ ? agent.version ||
+ t("workspace_launcher.agents.installed")
+ : t("workspace_launcher.agents.not_installed")}
+ </span>
+ </div>
+ {agent.description && (
+ <p className="truncate text-[11px] text-muted-foreground">
+ {agent.description}
+ </p>
+ )}
+ {accounts.length >= 2 && count > 0 && (
+ <label className="mt-2 flex max-w-sm items-center gap-2 text-[11px] text-muted-foreground">
+ <span>{t("workspace_launcher.agents.account")}</span>
+ <Select
+ value={selectedAccount}
+ aria-label={t(
+ "workspace_launcher.agents.account_for",
+ ).replace("{0}", agent.display_name)}
+ onChange={(event) =>
+ setAccount(
+ agent.name,
+ event.target.value || undefined,
+ )
+ }
+ className="h-7 min-w-0 flex-1 text-xs"
+ >
+ <option value="">
+ {t("workspace_launcher.agents.active_account")}
+ </option>
+ {accounts.map((account) => (
+ <option key={account.id} value={account.id}>
+ {account.label}
+ {account.connected
+ ? ""
+ : ` (${t("workspace_launcher.agents.not_signed_in")})`}
+ </option>
+ ))}
+ </Select>
+ </label>
+ )}
+ </div>
+ </div>
+
+ <div className="flex items-center justify-end gap-1.5">
+ <Button
+ variant="subtle"
+ className="px-2 text-xs uppercase tracking-wide"
+ disabled={!agent.installed}
+ onClick={() => commitCounts({ [agent.name]: total })}
+ >
+ {t("workspace_launcher.agents.all")}
+ </Button>
+ <div className="grid grid-cols-[2rem_3rem_2rem] items-center rounded-control border border-border bg-background">
+ <button
+ type="button"
+ aria-label={t("workspace_launcher.agents.decrease").replace(
+ "{0}",
+ agent.display_name,
+ )}
+ disabled={!agent.installed || count === 0}
+ onClick={() => setCount(agent.name, count - 1)}
+ className="flex h-8 items-center justify-center text-muted-foreground hover:text-foreground disabled:opacity-30"
+ >
+ <Minus className="h-3.5 w-3.5" />
+ </button>
+ <input
+ type="number"
+ min={0}
+ max={total}
+ value={count}
+ aria-label={t(
+ "workspace_launcher.agents.count_for",
+ ).replace("{0}", agent.display_name)}
+ disabled={!agent.installed}
+ onChange={(event) =>
+ setCount(agent.name, Number(event.target.value))
+ }
+ className="h-8 min-w-0 border-x border-border bg-transparent text-center font-mono text-sm tabular-nums text-foreground outline-none focus:bg-secondary/50 disabled:opacity-40"
+ />
+ <button
+ type="button"
+ aria-label={t("workspace_launcher.agents.increase").replace(
+ "{0}",
+ agent.display_name,
+ )}
+ disabled={!agent.installed || count >= total}
+ onClick={() => setCount(agent.name, count + 1)}
+ className="flex h-8 items-center justify-center text-muted-foreground hover:text-foreground disabled:opacity-30"
+ >
+ <Plus className="h-3.5 w-3.5" />
+ </button>
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+
+ <p className="mt-3 text-[11px] leading-relaxed text-muted-foreground">
+ {t("workspace_launcher.agents.auto_names")}
+ </p>
+ </div>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
index 8774e44acb..5a812a055c 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
@@ -8,10 +8,12 @@
*/
import { useEffect, useMemo, useState } from "react";
import { ArrowLeft, ArrowRight, Loader2 } from "lucide-react";
+import { useT } from "@/i18n";
import { cn } from "@/lib/utils";
import { FolderPicker } from "./FolderPicker";
import { ResumeCard } from "./ResumeCard";
-import { Button, Field, Notice, Select, SectionLabel } from "./controls";
+import { AgentAllocation, type PlannedTerminal } from "./AgentAllocation";
+import { Button, Notice, SectionLabel } from "./controls";
import { CountStepper, CountTrack, WorkspaceShape } from "./WorkspaceShape";
import type { AgentAccount } from "@/lib/agentAccountsApi";
import type {
@@ -20,13 +22,7 @@ import type {
ResumeOffer,
} from "@/lib/agenticIdeApi";
-/** One pane the workspace will open with, as the launcher holds it. */
-export interface PlannedTerminal {
- agent: string;
- name: string;
- /** Which subscription of `agent` this pane opens on. */
- account?: string;
-}
+export type { PlannedTerminal } from "./AgentAllocation";
export interface WorkspaceLauncherProps {
/** True while this is opening an additional workspace beside running ones. */
@@ -85,8 +81,8 @@ const STEPS = [
},
{
label: "Agents",
- title: "Assign the terminals",
- hint: "Name each pane and choose the coding agent that runs there.",
+ title: "Choose the coding agents",
+ hint: "Distribute all terminal slots at once instead of editing every pane.",
},
{
label: "Review",
@@ -119,17 +115,13 @@ export function WorkspaceLauncher({
onDismissOffer,
onStart,
}: WorkspaceLauncherProps) {
+ const t = useT();
const [step, setStep] = useState<LauncherStep>(0);
const planReady =
planned.length > 0 &&
planned.every((pane) => pane.name.trim() && pane.agent);
const ready = Boolean(folder) && planReady;
- const setPane = (index: number, patch: Partial<PlannedTerminal>) =>
- onPlanned((previous) =>
- previous.map((pane, i) => (i === index ? { ...pane, ...patch } : pane)),
- );
-
const canLeaveCurrent =
(step === 0 && Boolean(folder)) ||
(step === 1 && count > 0) ||
@@ -156,6 +148,10 @@ export function WorkspaceLauncher({
}, [busy, onStart, ready, step]);
const active = STEPS[step];
+ const activeTitle =
+ step === 2 ? t("workspace_launcher.agents.step_title") : active.title;
+ const activeHint =
+ step === 2 ? t("workspace_launcher.agents.step_hint") : active.hint;
return (
<div
@@ -174,10 +170,10 @@ export function WorkspaceLauncher({
id="workspace-launcher-title"
className="mt-2 text-xl font-semibold tracking-tight text-foreground sm:text-2xl"
>
- {active.title}
+ {activeTitle}
</h2>
<p className="mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground">
- {active.hint}
+ {activeHint}
{addingNew && step === 0
? " Your open workspaces keep running."
: ""}
@@ -291,11 +287,11 @@ export function WorkspaceLauncher({
)}
{step === 2 && (
- <PanePlan
+ <AgentAllocation
planned={planned}
agents={agents}
accountsFor={accountsFor}
- onChange={setPane}
+ onPlanned={onPlanned}
/>
)}
@@ -374,14 +370,18 @@ function StepNavigation({
canVisit: (target: LauncherStep) => boolean;
onStep: (step: LauncherStep) => void;
}) {
+ const t = useT();
+ const assigned = planned.filter((pane) => Boolean(pane.agent)).length;
const summaries = useMemo(
() => [
folder ? leafName(folder) : "Not chosen",
`${count} terminal${count === 1 ? "" : "s"}`,
- `${planned.length} assigned`,
+ t("workspace_launcher.agents.nav_summary")
+ .replace("{0}", String(assigned))
+ .replace("{1}", String(planned.length)),
"Check and open",
],
- [count, folder, planned.length],
+ [assigned, count, folder, planned.length, t],
);
return (
@@ -429,124 +429,6 @@ function StepNavigation({
);
}
-/** One row per terminal, aligned as a table rather than framed as cards. */
-function PanePlan({
- planned,
- agents,
- accountsFor,
- onChange,
-}: {
- planned: PlannedTerminal[];
- agents: AgentStatus[];
- accountsFor: (platform: string) => AgentAccount[];
- onChange: (index: number, patch: Partial<PlannedTerminal>) => void;
-}) {
- return (
- <div>
- <div className="flex flex-wrap items-end justify-between gap-3 pb-4">
- <div>
- <SectionLabel>Terminal assignments</SectionLabel>
- <p className="mt-1 text-xs leading-relaxed text-muted-foreground">
- Call-signs are what you say aloud when addressing a pane.
- </p>
- </div>
- <p className="text-[11px] text-muted-foreground">
- “What is {planned[1]?.name || planned[0]?.name || "T2"} doing?”
- </p>
- </div>
- <div className="max-h-[28rem] overflow-y-auto scrollbar-jarvis border-y border-border/70">
- <table className="w-full border-collapse">
- <thead className="sticky top-0 z-10 bg-background/95 backdrop-blur">
- <tr className="border-b border-border/70">
- <th className="w-12 px-3 py-2 text-left">
- <SectionLabel>#</SectionLabel>
- </th>
- <th className="px-2 py-2 text-left">
- <SectionLabel>Call-sign</SectionLabel>
- </th>
- <th className="px-2 py-2 text-left">
- <SectionLabel>Agent</SectionLabel>
- </th>
- </tr>
- </thead>
- <tbody>
- {planned.map((pane, index) => {
- const accounts = accountsFor(pane.agent);
- return (
- <tr
- key={index}
- className="border-b border-border/50 last:border-b-0"
- >
- <td className="px-3 py-2 align-middle font-mono text-xs tabular-nums text-muted-foreground">
- {(index + 1).toString().padStart(2, "0")}
- </td>
- <td className="px-2 py-2 align-middle">
- <Field
- value={pane.name}
- onChange={(event) =>
- onChange(index, { name: event.target.value })
- }
- aria-label={`Call-sign for terminal ${index + 1}`}
- className="w-full min-w-24 font-mono sm:w-40"
- spellCheck={false}
- />
- </td>
- <td className="px-2 py-2 align-middle">
- <div className="flex flex-wrap items-center gap-2">
- <Select
- value={pane.agent}
- aria-label={`Agent for terminal ${index + 1}`}
- onChange={(event) =>
- onChange(index, {
- agent: event.target.value,
- account: undefined,
- })
- }
- className="w-44"
- >
- {agents.map((agent) => (
- <option
- key={agent.name}
- value={agent.name}
- disabled={!agent.installed}
- >
- {agent.display_name}
- {agent.installed ? "" : " — not installed"}
- </option>
- ))}
- </Select>
- {accounts.length >= 2 && (
- <Select
- value={pane.account ?? ""}
- aria-label={`Subscription for the ${pane.agent} terminal`}
- onChange={(event) =>
- onChange(index, {
- account: event.target.value || undefined,
- })
- }
- className="w-40 text-xs"
- >
- <option value="">Active account</option>
- {accounts.map((account) => (
- <option key={account.id} value={account.id}>
- {account.label}
- {account.connected ? "" : " (not signed in)"}
- </option>
- ))}
- </Select>
- )}
- </div>
- </td>
- </tr>
- );
- })}
- </tbody>
- </table>
- </div>
- </div>
- );
-}
-
function WorkspaceReview({
folder,
planned,
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 5fc88d34b4..03b522d1fc 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -3497,6 +3497,34 @@
"paste_unavailable": "Zwischenablage konnte nicht gelesen werden.",
"paste_failed": "Hier kann nicht eingefügt werden."
},
+ "workspace_launcher": {
+ "agents": {
+ "step_title": "Coding-Agents auswählen",
+ "step_hint": "Verteile alle Terminal-Plätze auf einmal, statt jedes Terminal einzeln zu bearbeiten.",
+ "nav_summary": "{0} von {1} zugewiesen",
+ "allocation": "Terminal-Verteilung",
+ "hint": "Lege fest, wie viele Terminal-Plätze jeder installierte Agent erhält. Die Namen werden automatisch vergeben.",
+ "assigned": "Zugewiesene Terminals",
+ "unassigned": "Freie Terminal-Plätze: {0}",
+ "all_assigned": "Alle Terminals zugewiesen",
+ "quick_fill": "Schnellverteilung",
+ "one_each": "Je einer",
+ "split_evenly": "Gleichmäßig verteilen",
+ "clear": "Leeren",
+ "select": "{0} auswählen",
+ "installed": "Installiert",
+ "not_installed": "Nicht installiert",
+ "account": "Abonnement",
+ "account_for": "Abonnement für {0}",
+ "active_account": "Aktives Konto",
+ "not_signed_in": "nicht angemeldet",
+ "all": "Alle",
+ "decrease": "Ein {0}-Terminal weniger verwenden",
+ "count_for": "Terminal-Anzahl für {0}",
+ "increase": "Ein {0}-Terminal mehr verwenden",
+ "auto_names": "Die Terminal-Namen werden automatisch vergeben. Nach dem Öffnen kannst du sie im jeweiligen Terminal-Header umbenennen."
+ }
+ },
"agent_accounts": {
"title": "Deine Abos",
"hint": "mehrere Logins pro CLI",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 74d69d69f0..5c3e139f8c 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -3498,6 +3498,34 @@
"paste_unavailable": "Could not read the clipboard.",
"paste_failed": "Cannot paste here."
},
+ "workspace_launcher": {
+ "agents": {
+ "step_title": "Choose the coding agents",
+ "step_hint": "Distribute all terminal slots at once instead of editing every pane.",
+ "nav_summary": "{0} of {1} assigned",
+ "allocation": "Terminal allocation",
+ "hint": "Choose how many terminal slots each installed agent receives. Names are assigned automatically.",
+ "assigned": "Assigned terminals",
+ "unassigned": "Open terminal slots: {0}",
+ "all_assigned": "All terminals assigned",
+ "quick_fill": "Quick fill",
+ "one_each": "One of each",
+ "split_evenly": "Split evenly",
+ "clear": "Clear",
+ "select": "Select {0}",
+ "installed": "Installed",
+ "not_installed": "Not installed",
+ "account": "Subscription",
+ "account_for": "Subscription for {0}",
+ "active_account": "Active account",
+ "not_signed_in": "not signed in",
+ "all": "All",
+ "decrease": "Use one fewer {0} terminal",
+ "count_for": "Terminal count for {0}",
+ "increase": "Use one more {0} terminal",
+ "auto_names": "Terminal names are assigned automatically. After opening, you can rename them from each terminal header."
+ }
+ },
"agent_accounts": {
"title": "Your subscriptions",
"hint": "several logins per CLI",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 126afdc43b..42064102c9 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -3497,6 +3497,34 @@
"paste_unavailable": "No se pudo leer el portapapeles.",
"paste_failed": "Aquí no se puede pegar."
},
+ "workspace_launcher": {
+ "agents": {
+ "step_title": "Elige los agentes de programación",
+ "step_hint": "Distribuye todas las terminales de una vez en lugar de editar cada una por separado.",
+ "nav_summary": "{0} de {1} asignadas",
+ "allocation": "Distribución de terminales",
+ "hint": "Elige cuántas terminales recibe cada agente instalado. Los nombres se asignan automáticamente.",
+ "assigned": "Terminales asignadas",
+ "unassigned": "Terminales libres: {0}",
+ "all_assigned": "Todas las terminales están asignadas",
+ "quick_fill": "Asignación rápida",
+ "one_each": "Uno de cada",
+ "split_evenly": "Repartir por igual",
+ "clear": "Vaciar",
+ "select": "Seleccionar {0}",
+ "installed": "Instalado",
+ "not_installed": "No instalado",
+ "account": "Suscripción",
+ "account_for": "Suscripción para {0}",
+ "active_account": "Cuenta activa",
+ "not_signed_in": "sesión no iniciada",
+ "all": "Todos",
+ "decrease": "Usar una terminal menos de {0}",
+ "count_for": "Cantidad de terminales para {0}",
+ "increase": "Usar una terminal más de {0}",
+ "auto_names": "Los nombres de las terminales se asignan automáticamente. Después de abrirlas, puedes renombrarlas desde cada cabecera."
+ }
+ },
"agent_accounts": {
"title": "Tus suscripciones",
"hint": "varios inicios de sesión por CLI",
diff --git a/jarvis/ui/web/frontend/src/i18n/workspace-launcher-i18n-parity.test.ts b/jarvis/ui/web/frontend/src/i18n/workspace-launcher-i18n-parity.test.ts
new file mode 100644
index 0000000000..1ec2dfa545
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/i18n/workspace-launcher-i18n-parity.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from "vitest";
+import en from "./locales/en.json";
+import de from "./locales/de.json";
+import es from "./locales/es.json";
+
+type Locale = Record<string, unknown>;
+
+function flatten(value: Locale, prefix = ""): string[] {
+ return Object.entries(value).flatMap(([key, nested]) => {
+ const path = prefix ? `${prefix}.${key}` : key;
+ return nested && typeof nested === "object"
+ ? flatten(nested as Locale, path)
+ : [path];
+ });
+}
+
+const keys = (locale: Locale) =>
+ flatten((locale.workspace_launcher ?? {}) as Locale).sort();
+
+describe("workspace launcher i18n parity", () => {
+ for (const [language, locale] of Object.entries({ de, es })) {
+ it(`${language} has the same workspace launcher keys as en`, () => {
+ expect(keys(locale as Locale)).toEqual(keys(en as Locale));
+ });
+ }
+});
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
index e2ca0cf3e4..3bfa66df4d 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
@@ -408,8 +408,9 @@ describe("Agentic IDE launcher", () => {
fireEvent.click(
screen.getByRole("button", { name: /continue to agents/i }),
);
- expect(await screen.findByDisplayValue("Mika")).toBeTruthy();
- expect(screen.getByDisplayValue("Nova")).toBeTruthy();
+ expect(await screen.findByText("0 / 2")).toBeTruthy();
+ fireEvent.click(screen.getAllByText("workspace_launcher.agents.all")[0]);
+ expect(screen.getByText("2 / 2")).toBeTruthy();
fireEvent.click(screen.getByRole("button", { name: /review workspace/i }));
expect(
@@ -427,14 +428,12 @@ describe("Agentic IDE launcher", () => {
expect(await screen.findByTestId("pane-Mika")).toBeTruthy();
});
- it("keeps a half-made plan across backward navigation", async () => {
+ it("keeps an aggregate agent split across backward navigation", async () => {
render(<AgenticIdeView />);
await waitFor(() => expect(api.fetchIdeAgents).toHaveBeenCalled());
await openAgents();
- fireEvent.change(await screen.findByLabelText("Call-sign for terminal 1"), {
- target: { value: "Scout" },
- });
+ fireEvent.click(screen.getByText("workspace_launcher.agents.split_evenly"));
fireEvent.click(screen.getByTestId("launcher-step-folder"));
const path = screen.getByTestId("folder-path-input");
@@ -443,7 +442,11 @@ describe("Agentic IDE launcher", () => {
fireEvent.click(screen.getByTestId("launcher-step-agents"));
- expect(screen.getByDisplayValue("Scout")).toBeTruthy();
+ expect(
+ screen
+ .getAllByRole("spinbutton")
+ .map((input) => (input as HTMLInputElement).value),
+ ).toEqual(["1", "1"]);
});
/**
@@ -535,7 +538,14 @@ describe("Agentic IDE launcher", () => {
screen.getByRole("button", { name: /continue to agents/i }),
);
- expect(screen.getByLabelText("Call-sign for terminal 10")).toBeTruthy();
+ expect(screen.getByText("0 / 10")).toBeTruthy();
+ expect(
+ screen
+ .getByRole("progressbar", {
+ name: "workspace_launcher.agents.assigned",
+ })
+ .getAttribute("aria-valuemax"),
+ ).toBe("10");
});
it("caps the count at the backend limit", async () => {
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
index ad0aec5253..8f8a1e0be7 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
@@ -3,8 +3,8 @@
*
* Two states in one view:
*
- * * no workspace open → a four-step wizard: folder, how many terminals, which
- * agent + call-sign per terminal, then start,
+ * * no workspace open → a four-step wizard: folder, how many terminals, an
+ * aggregate agent allocation, then start,
* * workspace open → the terminal grid (see AgenticGrid).
*
* The wizard order is deliberate and matches how the decision actually gets
@@ -387,7 +387,7 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
const chooseCount = (n: number) => {
const next = Math.max(1, Math.min(maxTerminals, Math.trunc(n)));
setCount(next);
- setPlanned((prev) => buildPlan(next, prev, defaultAgent, suggested));
+ setPlanned((prev) => buildPlan(next, prev, "", suggested));
};
const replayRecent = (recent: {
@@ -436,9 +436,9 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
setPlanned((previous) =>
previous.length === count
? previous
- : buildPlan(count, previous, defaultAgent, suggested),
+ : buildPlan(count, previous, "", suggested),
);
- }, [meta, count, defaultAgent, suggested]);
+ }, [meta, count, suggested]);
const start = async () => {
if (!folder) return;