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): show a team thread as a live board, a lane per member and a band per step (#653)

Ruben Lütke5fd78fbc7802
diff --git a/docs/agentic-ide-team-threads.md b/docs/agentic-ide-team-threads.md
index c7e9596e44..af321c299a 100644
--- a/docs/agentic-ide-team-threads.md
+++ b/docs/agentic-ide-team-threads.md
@@ -54,18 +54,32 @@ cache that a check left behind can be told from an edit.
## The shared thread
-- Every contribution appears under its author's name with what it is: own plan,
- challenge, master plan, vote, build report, review, answer to the review.
- First plans and challenges open folded; the current master plan, the reports
- and the reviews are open.
+The thread is a board on one page: a lane per member, a band per step.
+
+- **Lanes.** Each member has a column. Its head stays in view while the board
+ scrolls and says what the member does right now: working, waiting for the
+ person, waiting for its turn, or gone (with the reason).
+- **Bands.** Each step is a row across the lanes: the own plans side by side,
+ a master plan beside the votes on it, a build beside its reviews. A further
+ master-plan or review round is a band of its own. What belongs to nobody's
+ lane (the person's messages, notices, the outcome) spans the board between
+ the bands.
+- **Live.** A member whose turn runs shows its newest steps as they happen:
+ the files it reads, the commands it runs, the edits it makes, its own words,
+ with the time and tokens spent so far. The board listens to a member's
+ thread only while that member works.
+- **Cards.** A filed contribution is a card with its first lines, its verdict
+ and, for a review, its blocking finding. A click opens the whole text under
+ its band, starting at its top; nothing is navigated to.
- **Caught by the team** lists every objection and finding with who raised it,
where, and whether it is resolved.
-- Each member is an ordinary thread underneath. A click on its chip opens it
- with every tool call and diff; the thread list shows the team once and keeps
- the members out of it.
-- The header shows the step, the time and turns used against their limits, and
- the cost where a seat reports one. That amount is the list price the coding
- agents report; a subscription seat is not billed per turn.
+- The header shows the five steps as one line, and time and turns as bars
+ against their limits, with the cost where a seat reports one. That amount is
+ the list price the coding agents report; a subscription seat is not billed
+ per turn.
+- Each member is still an ordinary thread underneath. A click on a lane's head
+ opens it with every tool call and diff; the thread list shows the team once
+ and keeps the members out of it.
## Stepping in
diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.test.tsx
index 99273afe36..3741030466 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.test.tsx
@@ -1,15 +1,35 @@
-import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { afterEach, expect, it, vi } from "vitest";
+import { afterEach, beforeEach, expect, it, vi } from "vitest";
import type { IdeProject } from "@/lib/agenticIdeApi";
import type { TeamThread } from "@/lib/teamThreadsApi";
import { TEAM_DRAFT, useIdeThreadsStore } from "@/store/ideThreads";
+import { buildBoard, gist, type StepBand } from "./board";
import { TeamThreadView } from "./TeamThreadView";
-vi.mock("@/i18n", () => ({
+vi.mock("@/i18n", async (importOriginal) => ({
+ ...(await importOriginal<typeof import("@/i18n")>()),
useT: () => (key: string) => key,
fill: (template: string, vars: Record<string, unknown>) => `${template} ${JSON.stringify(vars)}`,
}));
+
+/** A member's own thread socket, driven by hand. */
+class FakeSocket {
+ static instances: FakeSocket[] = [];
+ onopen: (() => void) | null = null;
+ onmessage: ((message: { data: string }) => void) | null = null;
+ onclose: (() => void) | null = null;
+ onerror: (() => void) | null = null;
+ closed = false;
+ constructor(readonly url: string) { FakeSocket.instances.push(this); }
+ close() { this.closed = true; }
+ frame(data: unknown) { this.onmessage?.({ data: JSON.stringify(data) }); }
+}
+
+beforeEach(() => {
+ FakeSocket.instances = [];
+ vi.stubGlobal("WebSocket", FakeSocket);
+});
afterEach(() => { cleanup(); vi.unstubAllGlobals(); });
const project = { id: "p1", name: "Shop", path: "/work/shop", workspaces: [] } as unknown as IdeProject;
@@ -20,8 +40,8 @@ const member = (id: string, name: string, extra: Partial<TeamThread["members"][n
...extra,
});
-const entry = (seq: number, kind: string, author: string, payload: object, round = 0) =>
- ({ seq, ts_ms: seq, kind, author, phase: "review", round, payload }) as TeamThread["entries"][number];
+const entry = (seq: number, kind: string, author: string, payload: object, phase = "review", round = 0) =>
+ ({ seq, ts_ms: seq, kind, author, phase, round, payload }) as TeamThread["entries"][number];
const thread: TeamThread = {
team_id: "t1", title: "Add a retry", task: "Add a retry", cwd: "/work/shop",
@@ -30,24 +50,25 @@ const thread: TeamThread = {
usage: { elapsed_ms: 12 * 60_000, turns: 14, cost_usd: 0, cost_partial: true },
rounds: { plan: 1, review: 3 },
builder: "m1",
- members: [member("m1", "Claude"), member("m2", "GPT", { working: true }), member("m3", "Gemini", { state: "left", left_reason: "not signed in" })],
+ members: [member("m1", "Claude"), member("m2", "GPT"), member("m3", "Gemini", { state: "left", left_reason: "not signed in" })],
entries: [
- entry(1, "user", "user", { text: "Add a retry" }),
- entry(2, "draft", "m1", { text: "Plan **A**" }),
- entry(3, "plan", "m1", { text: "The master plan" }, 1),
- entry(4, "vote", "m2", { text: "ok", agree: true, objections: [] }, 1),
- entry(5, "notice", "team", { code: "plan_agreed", rounds: 1, by: "m1" }),
- entry(6, "build", "m1", { text: "Built it", files: ["app.py", "test_app.py"], stat: "2 files" }),
- entry(7, "review", "m2", {
+ entry(1, "user", "user", { text: "Add a retry" }, "draft"),
+ entry(2, "draft", "m1", { text: "## Plan\nUse **backoff** with jitter.\n\n```py\nretry()\n```" }, "draft"),
+ entry(3, "draft", "m2", { text: "Retry three times." }, "draft"),
+ entry(4, "plan", "m1", { text: "The master plan" }, "converge", 1),
+ entry(5, "vote", "m2", { text: "ok", agree: true, objections: [], plan_seq: 4 }, "converge", 1),
+ entry(6, "notice", "team", { code: "plan_agreed", rounds: 1, by: "m1" }, "converge"),
+ entry(7, "build", "m1", { text: "Built it", files: ["app.py", "test_app.py"], stat: "2 files" }, "build"),
+ entry(8, "review", "m2", {
text: "Not yet", approve: false,
findings: [{ severity: "blocking", where: "app.py:3", issue: "Loops forever on a 404", fix: "Stop on 4xx" }],
- }, 3),
- entry(8, "summary", "team", {
+ }, "review", 3),
+ entry(9, "summary", "team", {
outcome: "review_disagreement", rounds: 3,
open: [{ member_id: "m2", name: "GPT", items: ["app.py:3: Loops forever on a 404"] }],
- }),
+ }, "review"),
],
- issues: [{ seq: 7, stage: "review", round: 3, by: "m2", severity: "blocking", where: "app.py:3", issue: "Loops forever on a 404", fix: "Stop on 4xx", resolved: false }],
+ issues: [{ seq: 8, stage: "review", round: 3, by: "m2", severity: "blocking", where: "app.py:3", issue: "Loops forever on a 404", fix: "Stop on 4xx", resolved: false }],
created_ms: 1, updated_ms: 2,
};
@@ -68,7 +89,7 @@ function mount(team: string, data: unknown) {
}
// Like the server: a read with `after` returns only the entries past it.
const after = Number(new URL(url, "http://x").searchParams.get("after") ?? 0);
- const entries = (data as TeamThread).entries.filter((entry) => entry.seq > after);
+ const entries = (data as TeamThread).entries.filter((item) => item.seq > after);
return { ok: true, json: async () => (init?.method ? data : { ...(data as TeamThread), entries }) };
});
vi.stubGlobal("fetch", fetcher);
@@ -77,33 +98,95 @@ function mount(team: string, data: unknown) {
return calls;
}
-it("shows who said what, what was caught and why the team waits", async () => {
+it("lays the work out as one board: a lane per member, a band per step", async () => {
const calls = mount("t1", thread);
expect((await screen.findByTestId("team-thread-state")).textContent).toBe("team_threads.state.needs_input");
- // The person's task, the plan, the report and the review are one thread.
+ // The person's task and the outcome span the board; each step is a band.
expect(screen.getByTestId("team-entry-user").textContent).toBe("Add a retry");
- expect(screen.getByText("The master plan")).toBeTruthy();
- expect(screen.getByText("Built it")).toBeTruthy();
+ for (const key of ["draft", "converge:1", "build", "review:3"]) expect(screen.getByTestId(`team-band-${key}`)).toBeTruthy();
+ // Both own plans sit side by side, each in its author's lane, as a gist without Markdown marks.
+ expect(screen.getByTestId("team-cell-draft-m1").textContent).toContain("Plan · Use backoff with jitter.");
+ expect(screen.getByTestId("team-cell-draft-m2").textContent).toContain("Retry three times.");
+ expect(screen.getByTestId("team-cell-draft-m3").textContent).toBe("");
+ // The plan is in its author's lane, the vote on it in the voter's.
+ expect(within(screen.getByTestId("team-cell-converge:1-m1")).getByTestId("team-entry-plan")).toBeTruthy();
+ expect(screen.getByTestId("team-cell-converge:1-m2").textContent).toContain("team_threads.vote.agree");
+ // A review shows its blocking finding right on the card.
+ expect(screen.getByTestId("team-cell-review:3-m2").textContent).toContain("Loops forever on a 404");
+ expect(screen.getByTestId("team-cell-build-m1").textContent).toContain('"count":2');
expect(screen.getByTestId("team-notice-plan_agreed").textContent).toContain('"member":"Claude"');
- // A first plan opens folded; the master plan supersedes it.
- expect(screen.queryByText("A")).toBeNull();
- fireEvent.click(screen.getAllByRole("button", { expanded: false })[0]);
- expect(screen.getByText("A").tagName).toBe("STRONG");
- // The finding is in the review, in the open points and in the record.
- expect(screen.getAllByText("Loops forever on a 404")).toHaveLength(2);
expect(screen.getByTestId("team-summary-review_disagreement").textContent).toContain("app.py:3: Loops forever on a 404");
expect(screen.getByTestId("team-thread-issues").textContent).toContain("team_threads.issues.open");
- // Members: one working, one gone with its reason.
- expect(screen.getByTestId("team-member-m2").textContent).toContain("team_threads.member.working");
+ // Lanes: who is gone says why; the bounds are in the header.
expect(screen.getByTestId("team-member-m3").getAttribute("title")).toBe("not signed in");
expect(screen.getByTestId("team-thread-usage").textContent).toContain('"minutes":12');
+ expect(screen.getByTestId("team-thread-usage").textContent).toContain('"turns":14');
fireEvent.click(screen.getByRole("button", { name: "team_threads.accept_work" }));
await waitFor(() => expect(calls.some((call) => call.url === "/api/team-threads/t1/accept" && call.method === "POST")).toBe(true));
// The first read asks for everything; nothing was fetched twice.
expect(calls.find((call) => call.url.startsWith("/api/team-threads/t1?"))?.url).toBe("/api/team-threads/t1?after=0");
expect(screen.getAllByTestId("team-entry-user")).toHaveLength(1);
+ // Nobody works, so no member's thread is listened to.
+ expect(FakeSocket.instances).toHaveLength(0);
+});
+
+it("opens a whole contribution under its band, without leaving the board", async () => {
+ mount("t1", thread);
+
+ const card = within(await screen.findByTestId("team-cell-draft-m1")).getByTestId("team-entry-draft");
+ expect(screen.queryByTestId("team-reader")).toBeNull();
+ fireEvent.click(card);
+ const reader = within(screen.getByTestId("team-band-draft")).getByTestId("team-reader");
+ expect(within(reader).getByText("backoff").tagName).toBe("STRONG");
+ expect(reader.textContent).toContain("Claude");
+ // Another card of the band takes the reader over; the same card closes it.
+ fireEvent.click(within(screen.getByTestId("team-cell-draft-m2")).getByTestId("team-entry-draft"));
+ expect(screen.getAllByTestId("team-reader")).toHaveLength(1);
+ expect(screen.getByTestId("team-reader").textContent).toContain("Retry three times.");
+ fireEvent.click(within(screen.getByTestId("team-cell-draft-m2")).getByTestId("team-entry-draft"));
+ expect(screen.queryByTestId("team-reader")).toBeNull();
+});
+
+it("shows a working member's newest steps as they happen", async () => {
+ const working: TeamThread = {
+ ...thread, state: "running", reason: "", phase: "challenge", builder: "", rounds: { plan: 0, review: 0 },
+ members: [member("m1", "Claude", { working: true, since_ms: Date.now() - 65_000 }), member("m2", "GPT")],
+ entries: thread.entries.slice(0, 3).concat(entry(4, "critique", "m2", { text: "Claude skips the timeout." }, "challenge")),
+ issues: [],
+ };
+ mount("t1", working);
+
+ // The step being worked on: one lane is done, the other is live.
+ expect((await screen.findByTestId("team-cell-challenge-m2")).textContent).toContain("Claude skips the timeout.");
+ const live = await screen.findByTestId("team-live-m1");
+ expect(live.textContent).toContain("team_threads.live_starting");
+ expect(live.textContent).toContain("1:05");
+ // Only the working member's thread is listened to.
+ await waitFor(() => expect(FakeSocket.instances).toHaveLength(1));
+ const socket = FakeSocket.instances[0];
+ expect(socket.url).toContain("/api/agent-chat/sessions/session-m1/ws");
+
+ vi.useFakeTimers();
+ try {
+ act(() => {
+ socket.frame({ type: "snapshot", events: [
+ { seq: 1, ts_ms: 1, kind: "turn_started", payload: { turn_id: "t", provider: "claude-api", model: "", runner: "claude-cli" } },
+ { seq: 2, ts_ms: 2, kind: "tool_call", payload: { turn_id: "t", call_id: "c1", name: "Read", input: { file_path: "/work/shop/app.py" } } },
+ ] });
+ socket.frame({ type: "event", event: { seq: 3, ts_ms: 3, kind: "tool_call", payload: { turn_id: "t", call_id: "c2", name: "Bash", input: { command: "pytest -q" } } } });
+ vi.advanceTimersByTime(400);
+ });
+ } finally {
+ vi.useRealTimers();
+ }
+ expect(live.textContent).not.toContain("team_threads.live_starting");
+ expect(live.textContent).toContain("app.py");
+ expect(live.textContent).toContain("pytest -q");
+ // A working thread offers pause and stop, never the waiting banner.
+ expect(screen.getByRole("button", { name: "team_threads.pause" })).toBeTruthy();
+ expect(screen.queryByTestId("team-thread-waiting")).toBeNull();
});
it("sends what the person says to the team and opens a member's own thread", async () => {
@@ -113,9 +196,6 @@ it("sends what the person says to the team and opens a member's own thread", asy
fireEvent.change(field, { target: { value: "Keep the public API unchanged" } });
fireEvent.keyDown(field, { key: "Enter" });
await waitFor(() => expect(calls.find((call) => call.url.endsWith("/message"))?.body).toEqual({ text: "Keep the public API unchanged" }));
- // A working thread offers pause and stop, never the waiting banner.
- expect(screen.getByRole("button", { name: "team_threads.pause" })).toBeTruthy();
- expect(screen.queryByTestId("team-thread-waiting")).toBeNull();
fireEvent.click(screen.getByTestId("team-member-m1"));
expect(useIdeThreadsStore.getState().selection).toEqual({ projectId: "p1", sessionId: "session-m1" });
@@ -139,3 +219,40 @@ it("starts the suggested team with one prompt", async () => {
}));
await waitFor(() => expect(useIdeThreadsStore.getState().selection).toEqual({ projectId: "p1", sessionId: null, team: "t9" }));
});
+
+it("derives the board: roles in a step nobody has filed for, rounds as bands of their own", () => {
+ const start: TeamThread = {
+ ...thread, state: "running", reason: "", phase: "draft", builder: "", rounds: { plan: 0, review: 0 },
+ members: [member("m1", "Claude", { working: true }), member("m2", "GPT", { working: true })],
+ entries: [thread.entries[0]], issues: [],
+ };
+ const [note, band] = buildBoard(start);
+ expect(note.type).toBe("note");
+ const draft = band as StepBand;
+ expect(draft.key).toBe("draft");
+ expect(draft.current).toBe(true);
+ expect(draft.cells.map((cell) => [cell.role, cell.live])).toEqual([["plans", true], ["plans", true]]);
+
+ // Two master-plan rounds are two bands; the author of each is who wrote its plan.
+ const rounds: TeamThread = {
+ ...start, phase: "converge", rounds: { plan: 2, review: 0 },
+ members: [member("m1", "Claude"), member("m2", "GPT", { working: true })],
+ entries: [
+ thread.entries[0],
+ entry(2, "plan", "m1", { text: "v1" }, "converge", 1),
+ entry(3, "vote", "m2", { text: "no", agree: false, objections: ["No tests"] }, "converge", 1),
+ ],
+ };
+ const steps = buildBoard(rounds).filter((item): item is StepBand => item.type === "step");
+ expect(steps.map((item) => [item.key, item.current])).toEqual([["converge:1", false], ["converge:2", true]]);
+ expect(steps[0].cells.map((cell) => cell.role)).toEqual(["author", "voter"]);
+ expect(steps[1].cells.map((cell) => [cell.role, cell.live])).toEqual([["voter", false], ["author", true]]);
+
+ // A paused thread keeps its current band but shows nobody as working.
+ const paused = buildBoard({ ...rounds, state: "paused" }).filter((item): item is StepBand => item.type === "step");
+ expect(paused.map((item) => item.key)).toEqual(["converge:1"]);
+ expect(paused.flatMap((item) => item.cells.map((cell) => cell.live))).toEqual([false, false]);
+
+ expect(gist("# Title\n\n- **Bold** point with `code`\n```\nskipped()\n```\n[link](http://x)")).toBe("Title · Bold point with code · link");
+ expect(gist("x".repeat(400)).length).toBe(320);
+});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.tsx b/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.tsx
index 108f70c24b..35ef9f1114 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/team/TeamThreadView.tsx
@@ -1,6 +1,9 @@
-import { useLayoutEffect, useMemo, useState, type ReactNode } from "react";
+import { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from "react";
import { useQueryClient } from "@tanstack/react-query";
-import { Check, ChevronDown, ChevronRight, Hammer, Loader2, Pause, Play, Send, ShieldAlert, Square, Trash2, Users, X } from "lucide-react";
+import {
+ Brain, Check, ChevronDown, ChevronRight, FileText, FolderOpen, Globe, Hammer, Loader2, MessageSquareText, Pause,
+ Pencil, Play, Search, Send, ShieldAlert, Square, Terminal, Trash2, Users, Wrench, X,
+} from "lucide-react";
import { AgentMark } from "@/components/agentic/AgentMark";
import { ChatMarkdown } from "@/components/agentchat/ChatMarkdown";
import { ScrollToEndButton } from "@/components/ui/scroll-to-end-button";
@@ -25,20 +28,25 @@ import {
import { cn } from "@/lib/utils";
import { useEventStore } from "@/store/events";
import { TEAM_DRAFT, useIdeThreadsStore } from "@/store/ideThreads";
+import { buildBoard, gist, stepsDone, type BandCell, type StepBand } from "./board";
+import { liveLines, liveTokens, useMemberTurn, type LiveLine } from "./memberLive";
import { TeamThreadDraft } from "./TeamThreadDraft";
-/** The reading width of the shared thread, the same as a single thread's. */
-const MEASURE = "mx-auto w-full max-w-3xl";
+/** The board's width: wide enough for four lanes, never wider than reads well. */
+const MEASURE = "mx-auto w-full max-w-6xl";
+/** A lane never gets narrower than this; a team too wide for the window scrolls sideways. */
+const LANE_MIN = 208;
-/** Contributions that open folded: long, and superseded by the master plan. */
-const FOLDED_KINDS = new Set(["draft", "critique"]);
+const lanes = (count: number) => ({ gridTemplateColumns: `repeat(${Math.max(1, count)}, minmax(${LANE_MIN}px, 1fr))` });
/**
- * One team thread: the task, every member's contributions in the order of
- * work, where they disagreed and how it ended, and the controls to step in.
+ * One team thread as a board: a lane per member, a band per step.
*
- * The models never read this page. A coordinator on the server passes
- * contributions between them; this view only shows what it filed.
+ * Everything is on one page. A member whose turn runs shows its newest tool
+ * calls and words as they happen; a finished contribution is a card with its
+ * gist, and a click opens the whole text under its band. The models never
+ * read this page: a coordinator on the server passes contributions between
+ * them, and this view shows what it filed.
*/
export function TeamThreadView({ team, project, onScreen }: { team: string; project: IdeProject; onScreen: boolean }) {
if (team === TEAM_DRAFT) return <TeamThreadDraft project={project} />;
@@ -55,7 +63,7 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
const [text, setText] = useState("");
const [busy, setBusy] = useState(false);
const [confirmDelete, setConfirmDelete] = useState(false);
- const { rootRef, contentRef, atEnd, jumpToEnd, follow } = useStickToBottom();
+ const { rootRef, contentRef, atEnd, jumpToEnd, follow, release } = useStickToBottom();
useLayoutEffect(follow, [follow, thread?.entries.length, thread?.state]);
const names = useMemo(
@@ -66,6 +74,7 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
() => new Map((seats?.seats ?? []).map((seat) => [seat.provider, seat.agent])),
[seats],
);
+ const bands = useMemo(() => (thread ? buildBoard(thread) : []), [thread]);
const run = async (work: () => Promise<TeamThread | { deleted: boolean }>) => {
setBusy(true);
@@ -108,12 +117,11 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
const waiting = thread.state === "needs_input" || thread.state === "paused";
const disagreement = thread.state === "needs_input"
&& (thread.reason === "plan_disagreement" || thread.reason === "review_disagreement");
- const phaseIndex = TEAM_THREAD_PHASES.indexOf(thread.phase);
- const minutes = Math.floor(thread.usage.elapsed_ms / 60_000);
+ const count = thread.members.length;
return <div className="flex h-full min-h-0 flex-col" data-testid="team-thread-view">
- <header className="shrink-0 border-b border-border px-5 py-3">
- <div className={cn(MEASURE, "flex flex-col gap-2")}>
+ <header className="shrink-0 border-b border-border px-5 pb-3 pt-3">
+ <div className={cn(MEASURE, "flex flex-col gap-3")}>
<div className="flex items-center gap-2">
<Users aria-hidden className="h-4 w-4 shrink-0 text-muted-foreground" />
<h1 className="min-w-0 flex-1 truncate text-sm font-medium text-foreground" title={thread.title}>{thread.title}</h1>
@@ -130,45 +138,25 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
</>
: <IconButton label={t("team_threads.delete")} onClick={() => setConfirmDelete(true)}><Trash2 className="h-3.5 w-3.5" /></IconButton>)}
</div>
- <ol className="flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs" aria-label={t("team_threads.steps")}>
- {TEAM_THREAD_PHASES.slice(0, 5).map((phase, index) => {
- const done = index < phaseIndex;
- const now = index === phaseIndex && !over;
- return <li key={phase} aria-current={now ? "step" : undefined}
- className={cn("flex items-center gap-1 rounded-full border px-2 py-0.5",
- now ? "border-border-strong bg-secondary text-foreground"
- : done ? "border-transparent text-foreground" : "border-transparent text-muted-foreground")}>
- {done && <Check aria-hidden className="h-3 w-3 text-success" />}
- {t(`team_threads.phase.${phase}`)}
- </li>;
- })}
- <li className="ml-auto tabular-nums text-muted-foreground" data-testid="team-thread-usage"
- title={thread.usage.cost_usd > 0
- ? `${t("team_threads.cost_hint")}${thread.usage.cost_partial ? ` ${t("team_threads.cost_partial")}` : ""}`
- : undefined}>
- {fill(t("team_threads.usage"), {
- minutes, max_minutes: thread.limits.max_minutes,
- turns: thread.usage.turns, max_turns: thread.limits.max_turns,
- })}
- {thread.usage.cost_usd > 0 && ` · ≈ $${thread.usage.cost_usd.toFixed(2)}`}
- </li>
- </ol>
- <ul className="flex flex-wrap gap-1.5" aria-label={t("team_threads.members")}>
- {thread.members.map((member) => <MemberChip key={member.member_id} member={member}
- agent={agentOf.get(member.provider) ?? ""} builder={thread.builder === member.member_id}
- onOpen={() => useIdeThreadsStore.getState().openThread(member.session_id, project.id)} />)}
- </ul>
+ <div className="flex flex-wrap items-center gap-x-6 gap-y-2">
+ <StepRail thread={thread} />
+ <Meters thread={thread} />
+ </div>
</div>
</header>
<div className="relative flex min-h-0 flex-1 flex-col">
- <div ref={rootRef} className="chat-scroller min-h-0 flex-1 overflow-y-auto px-5 py-5" role="log" aria-label={thread.title}>
- <div ref={contentRef} className={cn(MEASURE, "flex flex-col gap-3")}>
- {thread.entries.map((entry) => {
- const latestPlan = entry.kind === "plan" && !thread.entries.some((other) => other.kind === "plan" && other.seq > entry.seq);
- // Keyed by it too: a plan that a newer one replaced folds by itself.
- return <Entry key={`${entry.seq}:${latestPlan}`} entry={entry} names={names} latestPlan={latestPlan} />;
- })}
+ <div ref={rootRef} className="chat-scroller min-h-0 flex-1 overflow-auto px-5 pb-5" role="log" aria-label={thread.title}>
+ <div ref={contentRef} className={cn(MEASURE, "flex flex-col gap-4")} style={{ minWidth: count * LANE_MIN + (count - 1) * 12 }}>
+ {/* Who sits in which lane stays in view while the work scrolls under it. */}
+ <ul className="sticky top-0 z-10 grid gap-3 bg-background pb-2 pt-4" style={lanes(count)} aria-label={t("team_threads.members")}>
+ {thread.members.map((member) => <LaneHead key={member.member_id} member={member}
+ agent={agentOf.get(member.provider) ?? ""} builder={thread.builder === member.member_id} over={over}
+ onOpen={() => useIdeThreadsStore.getState().openThread(member.session_id, project.id)} />)}
+ </ul>
+ {bands.map((band) => band.type === "note"
+ ? <Note key={band.key} entry={band.entry} names={names} />
+ : <Band key={band.key} band={band} names={names} onOpen={release} />)}
{thread.issues.length > 0 && <Issues thread={thread} names={names} />}
</div>
</div>
@@ -176,7 +164,7 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
</div>
<footer className="shrink-0 px-5 pb-4 pt-2">
- <div className={cn(MEASURE, "flex flex-col gap-2")}>
+ <div className="mx-auto flex w-full max-w-3xl flex-col gap-2">
{waiting && <div role="status" data-testid="team-thread-waiting"
className="flex flex-wrap items-center gap-2 rounded-xl border border-warning/40 bg-warning/10 px-3 py-2 text-sm text-foreground">
<ShieldAlert aria-hidden className="h-4 w-4 shrink-0 text-warning" />
@@ -219,13 +207,16 @@ function OpenTeamThread({ teamId, project, onScreen }: { teamId: string; project
</div>;
}
+/* ------------------------------------------------------------------ header */
+
function StateBadge({ state }: { state: TeamThread["state"] }) {
const t = useT();
return <span data-testid="team-thread-state" className={cn(
"flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",
state === "done" ? "border-success/40 text-success"
: state === "needs_input" || state === "paused" ? "border-warning/40 text-warning"
- : state === "failed" ? "border-destructive/40 text-destructive" : "border-border text-muted-foreground",
+ : state === "failed" ? "border-destructive/40 text-destructive"
+ : state === "running" ? "border-accent/40 text-accent" : "border-border text-muted-foreground",
)}>
{state === "running" && <Loader2 aria-hidden className="h-3 w-3 animate-spin" />}
{t(`team_threads.state.${state}`)}
@@ -249,83 +240,286 @@ function TextButton({ onClick, disabled, primary, children }: { onClick: () => v
</button>;
}
-function MemberChip({ member, agent, builder, onOpen }: { member: TeamMember; agent: string; builder: boolean; onOpen: () => void }) {
+/** The five steps as one line: done, now, still to come. */
+function StepRail({ thread }: { thread: TeamThread }) {
+ const t = useT();
+ const done = stepsDone(thread);
+ const active = thread.state === "running";
+ return <ol className="flex min-w-0 flex-1 items-center" aria-label={t("team_threads.steps")}>
+ {TEAM_THREAD_PHASES.slice(0, 5).map((phase, index) => {
+ const isDone = index < done;
+ const now = index === done;
+ return <li key={phase} aria-current={now ? "step" : undefined} className="flex min-w-0 flex-1 items-center last:flex-none">
+ <span className={cn(
+ "flex h-5 w-5 shrink-0 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
+ isDone ? "border-success bg-success text-background"
+ : now ? "border-accent text-accent" : "border-border text-muted-foreground",
+ now && active && "team-step-now",
+ )}>
+ {isDone ? <Check aria-hidden className="h-3 w-3" strokeWidth={3} /> : index + 1}
+ </span>
+ <span className={cn("ml-1.5 truncate text-xs", isDone || now ? "text-foreground" : "text-muted-foreground", now && "font-medium")}>
+ {t(`team_threads.phase.${phase}`)}
+ </span>
+ {index < 4 && <span aria-hidden className={cn("mx-2 h-px min-w-3 flex-1", isDone ? "bg-success" : "bg-border")} />}
+ </li>;
+ })}
+ </ol>;
+}
+
+/** Time and turns against their bounds, as two thin bars with their numbers. */
+function Meters({ thread }: { thread: TeamThread }) {
+ const t = useT();
+ const minutes = Math.floor(thread.usage.elapsed_ms / 60_000);
+ const meter = (value: number, max: number, label: string) => {
+ const share = max > 0 ? Math.min(1, value / max) : 0;
+ return <span className="flex items-center gap-1.5">
+ <span aria-hidden className="h-1 w-14 overflow-hidden rounded-full bg-secondary">
+ <span className={cn("block h-full rounded-full", share >= 0.9 ? "bg-warning" : "bg-foreground/50")} style={{ width: `${Math.max(share * 100, value > 0 ? 6 : 0)}%` }} />
+ </span>
+ <span className="tabular-nums">{label}</span>
+ </span>;
+ };
+ return <div className="flex shrink-0 items-center gap-4 text-xs text-muted-foreground" data-testid="team-thread-usage"
+ title={thread.usage.cost_usd > 0
+ ? `${t("team_threads.cost_hint")}${thread.usage.cost_partial ? ` ${t("team_threads.cost_partial")}` : ""}`
+ : undefined}>
+ {meter(minutes, thread.limits.max_minutes, fill(t("team_threads.meter_time"), { minutes, max_minutes: thread.limits.max_minutes }))}
+ {meter(thread.usage.turns, thread.limits.max_turns, fill(t("team_threads.meter_turns"), { turns: thread.usage.turns, max_turns: thread.limits.max_turns }))}
+ {thread.usage.cost_usd > 0 && <span className="tabular-nums">≈ ${thread.usage.cost_usd.toFixed(2)}</span>}
+ </div>;
+}
+
+/* ------------------------------------------------------------------- lanes */
+
+function LaneHead({ member, agent, builder, over, onOpen }: { member: TeamMember; agent: string; builder: boolean; over: boolean; onOpen: () => void }) {
const t = useT();
const left = member.state === "left";
const status = left ? t("team_threads.member.left")
: member.waiting ? t("team_threads.member.waiting")
- : member.working ? t("team_threads.member.working") : "";
- return <li>
+ : member.working ? t("team_threads.member.working")
+ : over ? "" : t("team_threads.member.idle");
+ return <li className="min-w-0">
<button type="button" onClick={onOpen} data-testid={`team-member-${member.member_id}`}
aria-label={fill(t("team_threads.open_member"), { member: member.name })}
title={left ? member.left_reason : fill(t("team_threads.open_member"), { member: member.name })}
className={cn(
- "flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-xs hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
- left ? "text-muted-foreground line-through" : "text-foreground",
+ "group flex w-full min-w-0 items-center gap-2.5 rounded-xl border px-3 py-2 text-left transition-colors hover:bg-secondary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ member.working && !left ? "border-accent/50 bg-accent/5" : "border-border bg-card",
+ left && "opacity-55",
)}>
- {agent ? <AgentMark agent={agent} label={member.name} variant="plain" size="sm" /> : null}
- <span className="max-w-[16ch] truncate">{member.name}</span>
- {builder && !left && <Hammer aria-label={t("team_threads.member.builder")} className="h-3 w-3 text-muted-foreground" />}
- {member.waiting ? <ShieldAlert aria-hidden className="h-3 w-3 text-warning" />
- : member.working ? <Loader2 aria-hidden className="h-3 w-3 animate-spin text-muted-foreground" /> : null}
- {status && <span className="text-muted-foreground no-underline">{status}</span>}
+ <span className="grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-secondary">
+ {agent ? <AgentMark agent={agent} label={member.name} variant="plain" size="sm" /> : <Users aria-hidden className="h-4 w-4 text-muted-foreground" />}
+ </span>
+ <span className="min-w-0 flex-1">
+ <span className="flex items-center gap-1.5">
+ <span className={cn("truncate text-sm font-medium text-foreground", left && "line-through")}>{member.name}</span>
+ {builder && !left && <Hammer aria-label={t("team_threads.member.builder")} className="h-3 w-3 shrink-0 text-muted-foreground" />}
+ </span>
+ <span className={cn("flex items-center gap-1.5 truncate text-xs",
+ member.waiting ? "text-warning" : member.working && !left ? "text-accent" : "text-muted-foreground")}>
+ {member.waiting ? <ShieldAlert aria-hidden className="h-3 w-3 shrink-0" />
+ : member.working && !left ? <span aria-hidden className="team-pulse h-1.5 w-1.5 shrink-0 rounded-full bg-accent" /> : null}
+ <span className="truncate">{[status, member.model].filter(Boolean).join(" · ")}</span>
+ </span>
+ </span>
</button>
</li>;
}
-function Entry({ entry, names, latestPlan }: { entry: TeamEntry; names: Map<string, string>; latestPlan: boolean }) {
+/* ------------------------------------------------------------------- bands */
+
+function Band({ band, names, onOpen }: { band: StepBand; names: Map<string, string>; onOpen: () => void }) {
const t = useT();
- const name = names.get(entry.author) ?? entry.author;
- const payload = entry.payload;
- const [open, setOpen] = useState(!FOLDED_KINDS.has(entry.kind) && (entry.kind !== "plan" || latestPlan));
+ // The contribution whose whole text is open under this band.
+ const [reading, setReading] = useState<number | null>(null);
+ const entries = band.cells.flatMap((cell) => cell.entries);
+ const open = entries.find((entry) => entry.seq === reading) ?? null;
+ const filed = band.cells.filter((cell) => cell.entries.length > 0).length;
+ const part = band.cells.filter((cell) => cell.role !== "none" || cell.entries.length > 0).length;
+ return <section className="flex flex-col gap-2" data-testid={`team-band-${band.key}`} aria-label={t(`team_threads.phase.${band.step}`)}>
+ <header className="flex items-center gap-2 text-xs">
+ <span className={cn("font-medium uppercase tracking-wide", band.current ? "text-foreground" : "text-muted-foreground")}>
+ {t(`team_threads.phase.${band.step}`)}
+ </span>
+ {band.round > 1 && <span className="rounded-full border border-border px-1.5 py-px text-muted-foreground">{fill(t("team_threads.round"), { round: band.round })}</span>}
+ <span aria-hidden className="h-px flex-1 bg-border" />
+ <span className="tabular-nums text-muted-foreground">{fill(t("team_threads.band_count"), { done: filed, total: part })}</span>
+ </header>
+ <div className="grid items-start gap-3" style={lanes(band.cells.length)}>
+ {band.cells.map((cell) => <Cell key={cell.member.member_id} cell={cell} band={band} reading={reading}
+ onRead={(seq) => {
+ // The person wants to read here: the board stops following its newest entry.
+ if (reading !== seq) onOpen();
+ setReading(reading === seq ? null : seq);
+ }} />)}
+ </div>
+ {open && <Reader entry={open} name={names.get(open.author) ?? open.author} onClose={() => setReading(null)} />}
+ </section>;
+}
- if (entry.kind === "user") {
- return <div className="jarvis-chat-tinted jarvis-chat-out max-w-[min(85%,42rem)] self-end whitespace-pre-wrap rounded-[20px] px-4 py-2.5 text-sm [overflow-wrap:anywhere]"
- data-testid="team-entry-user">{payload.text}</div>;
- }
- if (entry.kind === "notice") {
- const code = payload.code ?? "";
- return <p className="self-center px-2 text-center text-xs text-muted-foreground" data-testid={`team-notice-${code}`}>
- {fill(t(`team_threads.notice.${code}`), {
- member: names.get(payload.member_id ?? payload.by ?? "") ?? "",
- error: payload.error ?? "", note: payload.note ?? "", rounds: payload.rounds ?? 0,
- step: payload.step ? t(`team_threads.kind.${payload.step}`) : "",
- files: (payload.files ?? []).join(", "), model: payload.model ?? "",
- })}
- </p>;
- }
- if (entry.kind === "summary") return <Summary entry={entry} names={names} />;
+function Cell({ cell, band, reading, onRead }: { cell: BandCell; band: StepBand; reading: number | null; onRead: (seq: number) => void }) {
+ const t = useT();
+ const empty = cell.entries.length === 0 && !cell.live;
+ return <div className="flex min-w-0 flex-col gap-2" data-testid={`team-cell-${band.key}-${cell.member.member_id}`}>
+ {cell.entries.map((entry) => <EntryCard key={entry.seq} entry={entry} open={reading === entry.seq} onRead={() => onRead(entry.seq)} />)}
+ {cell.live && <LiveCard member={cell.member} />}
+ {empty && band.current && cell.role !== "none" && <p className="rounded-xl border border-dashed border-border px-3 py-2.5 text-xs text-muted-foreground">
+ {t(`team_threads.role.${cell.role}`)}
+ </p>}
+ </div>;
+}
+/** A filed contribution at a glance: what it is, how it ended, its first lines. */
+function EntryCard({ entry, open, onRead }: { entry: TeamEntry; open: boolean; onRead: () => void }) {
+ const t = useT();
+ const payload = entry.payload;
const verdict = entry.kind === "vote"
? t(payload.agree ? "team_threads.vote.agree" : "team_threads.vote.object")
: entry.kind === "review" ? t(payload.approve ? "team_threads.review.approve" : "team_threads.review.changes") : "";
const positive = entry.kind === "vote" ? payload.agree : entry.kind === "review" ? payload.approve : undefined;
- const round = entry.round > 1 ? ` · ${fill(t("team_threads.round"), { round: entry.round })}` : "";
const points = entry.kind === "vote" ? payload.objections ?? [] : [];
- return <article className="flex min-w-0 flex-col gap-1.5 self-stretch" data-testid={`team-entry-${entry.kind}`}>
- <button type="button" aria-expanded={open} onClick={() => setOpen(!open)}
- className="flex items-center gap-1.5 self-start rounded-md px-1 text-left text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
- {open ? <ChevronDown aria-hidden className="h-3.5 w-3.5 text-muted-foreground" /> : <ChevronRight aria-hidden className="h-3.5 w-3.5 text-muted-foreground" />}
- <span className="font-medium text-foreground">{name}</span>
- <span className="text-muted-foreground">{t(`team_threads.kind.${entry.kind}`)}{round}</span>
+ const findings = payload.findings ?? [];
+ const files = payload.files ?? [];
+ const lead = points[0] ?? findings.find((finding) => finding.severity === "blocking")?.issue ?? findings[0]?.issue ?? "";
+ return <button type="button" onClick={onRead} aria-expanded={open} data-testid={`team-entry-${entry.kind}`}
+ className={cn(
+ "flex w-full min-w-0 flex-col gap-1.5 rounded-xl border bg-card px-3 py-2.5 text-left transition-colors hover:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ open ? "border-border-strong" : "border-border",
+ )}>
+ <span className="flex items-center gap-1.5 text-xs">
+ <span className="font-medium text-foreground">{t(`team_threads.kind.${entry.kind}`)}</span>
{verdict && <span className={cn("rounded-full border px-1.5 py-px",
positive ? "border-success/40 text-success" : "border-warning/40 text-warning")}>{verdict}</span>}
- </button>
- {open && <div className="jarvis-chat-in min-w-0 rounded-[20px] px-4 py-2.5">
- {payload.text ? <ChatMarkdown text={payload.text} /> : null}
+ <span className="ml-auto text-muted-foreground">
+ {open ? <ChevronDown aria-hidden className="h-3.5 w-3.5" /> : <ChevronRight aria-hidden className="h-3.5 w-3.5" />}
+ </span>
+ </span>
+ {lead
+ ? <span className="line-clamp-3 text-xs text-foreground [overflow-wrap:anywhere]">{lead}</span>
+ : <span className="line-clamp-4 text-xs leading-relaxed text-muted-foreground [overflow-wrap:anywhere]">{gist(payload.text ?? "") || t("team_threads.no_report")}</span>}
+ {(files.length > 0 || findings.length > 1 || points.length > 1) && <span className="flex flex-wrap gap-x-3 text-[11px] text-muted-foreground">
+ {files.length > 0 && <span title={payload.stat}>{fill(t("team_threads.files_changed"), { count: files.length })}</span>}
+ {findings.length > 1 && <span>{fill(t("team_threads.findings_count"), { count: findings.length })}</span>}
+ {points.length > 1 && <span>{fill(t("team_threads.objections_count"), { count: points.length })}</span>}
+ </span>}
+ </button>;
+}
+
+/** The whole contribution, opened under its band: nothing to navigate to. */
+function Reader({ entry, name, onClose }: { entry: TeamEntry; name: string; onClose: () => void }) {
+ const t = useT();
+ const payload = entry.payload;
+ const points = entry.kind === "vote" ? payload.objections ?? [] : [];
+ const box = useRef<HTMLElement | null>(null);
+ // Reading starts at the top: the board follows its newest entry, and a long
+ // text opened at the end of the page would otherwise show its last lines.
+ useEffect(() => {
+ box.current?.scrollIntoView?.({ block: "start" });
+ }, [entry.seq]);
+ return <article ref={box} className="scroll-mt-20 rounded-xl border border-border-strong bg-card" data-testid="team-reader">
+ <header className="flex items-center gap-2 border-b border-border px-4 py-2 text-xs">
+ <span className="font-medium text-foreground">{name}</span>
+ <span className="text-muted-foreground">{t(`team_threads.kind.${entry.kind}`)}</span>
+ <button type="button" onClick={onClose} aria-label={t("team_threads.close_reader")} title={t("team_threads.close_reader")}
+ className="ml-auto rounded-md p-1 text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <X className="h-3.5 w-3.5" />
+ </button>
+ </header>
+ <div className="mx-auto max-w-3xl px-4 py-3">
+ {payload.text ? <ChatMarkdown text={payload.text} /> : <p className="text-sm text-muted-foreground">{t("team_threads.no_report")}</p>}
{points.length > 0 && <ul className="mt-2 list-disc space-y-1 pl-5 text-sm text-foreground">
{points.map((point, index) => <li key={index}>{point}</li>)}
</ul>}
- {(payload.findings ?? []).length > 0 && <ul className="mt-2 flex flex-col gap-1.5">
+ {(payload.findings ?? []).length > 0 && <ul className="mt-3 flex flex-col gap-1.5">
{(payload.findings ?? []).map((finding, index) => <FindingRow key={index} finding={finding} />)}
</ul>}
- {(payload.files ?? []).length > 0 && <p className="mt-2 text-xs text-muted-foreground" title={payload.stat}>
- {fill(t("team_threads.files_changed"), { count: (payload.files ?? []).length })}
+ {(payload.files ?? []).length > 0 && <p className="mt-3 font-mono text-xs text-muted-foreground [overflow-wrap:anywhere]">
+ {(payload.files ?? []).join(" · ")}
</p>}
- </div>}
+ </div>
</article>;
}
+/* -------------------------------------------------------------------- live */
+
+const CALL_GLYPH: Record<string, typeof Terminal> = {
+ command: Terminal, read: FileText, list: FolderOpen, search: Search, edit: Pencil, write: Pencil, web: Globe,
+};
+
+function useSeconds(sinceMs: number): number {
+ const [now, setNow] = useState(() => Date.now());
+ useEffect(() => {
+ const timer = window.setInterval(() => setNow(Date.now()), 1000);
+ return () => window.clearInterval(timer);
+ }, []);
+ return sinceMs > 0 ? Math.max(0, Math.floor((now - sinceMs) / 1000)) : 0;
+}
+
+const clock = (seconds: number) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
+
+/** A member at work: its newest steps as they happen, in a few lines. */
+function LiveCard({ member }: { member: TeamMember }) {
+ const t = useT();
+ const turn = useMemberTurn(member.session_id, true);
+ const seconds = useSeconds(member.since_ms);
+ const lang = t("trace_report.locale");
+ const lines = useMemo(() => liveLines(turn, { t, lang, max: 6 }), [turn, t, lang]);
+ const tokens = liveTokens(turn);
+ return <div role="status" data-testid={`team-live-${member.member_id}`}
+ className={cn("team-live flex min-w-0 flex-col gap-1.5 overflow-hidden rounded-xl border bg-card px-3 py-2.5",
+ member.waiting ? "border-warning/50" : "border-accent/50")}>
+ <div className="flex items-center gap-1.5 text-xs">
+ {member.waiting
+ ? <><ShieldAlert aria-hidden className="h-3.5 w-3.5 text-warning" /><span className="font-medium text-warning">{t("team_threads.member.waiting")}</span></>
+ : <><span aria-hidden className="team-pulse h-1.5 w-1.5 rounded-full bg-accent" /><span className="font-medium text-accent">{t("team_threads.member.working")}</span></>}
+ <span className="ml-auto tabular-nums text-muted-foreground">
+ {tokens > 0 ? `${fill(t("team_threads.live_tokens"), { count: tokens.toLocaleString() })} · ` : ""}{clock(seconds)}
+ </span>
+ </div>
+ {lines.length === 0
+ ? <p className="text-xs text-muted-foreground">{t("team_threads.live_starting")}</p>
+ : <ol className="flex flex-col gap-1">
+ {lines.map((line, index) => <LiveRow key={line.id} line={line} newest={index === lines.length - 1} />)}
+ </ol>}
+ </div>;
+}
+
+function LiveRow({ line, newest }: { line: LiveLine; newest: boolean }) {
+ const t = useT();
+ const Glyph = line.kind === "call" ? CALL_GLYPH[line.call ?? ""] ?? Wrench : line.kind === "thought" ? Brain : MessageSquareText;
+ return <li className={cn("team-live-line flex min-w-0 items-start gap-1.5 text-xs", newest ? "text-foreground" : "text-muted-foreground")}>
+ {line.running && line.kind === "call"
+ ? <Loader2 aria-hidden className="mt-0.5 h-3 w-3 shrink-0 animate-spin" />
+ : <Glyph aria-hidden className={cn("mt-0.5 h-3 w-3 shrink-0", line.failed && "text-destructive")} />}
+ <span className={cn("min-w-0 [overflow-wrap:anywhere]", line.kind === "call" ? "truncate font-mono text-[11px]" : "line-clamp-2")}>
+ {line.text || t("team_threads.live_thinking")}
+ </span>
+ </li>;
+}
+
+/* ------------------------------------------------------------------- notes */
+
+/** What belongs to nobody's lane: the person's words, a notice, the outcome. */
+function Note({ entry, names }: { entry: TeamEntry; names: Map<string, string> }) {
+ const t = useT();
+ const payload = entry.payload;
+ if (entry.kind === "user") {
+ return <div className="jarvis-chat-tinted jarvis-chat-out max-w-[min(85%,46rem)] self-end whitespace-pre-wrap rounded-[20px] px-4 py-2.5 text-sm [overflow-wrap:anywhere]"
+ data-testid="team-entry-user">{payload.text}</div>;
+ }
+ if (entry.kind === "summary") return <Summary entry={entry} names={names} />;
+ const code = payload.code ?? "";
+ return <p className="self-center px-2 text-center text-xs text-muted-foreground" data-testid={`team-notice-${code}`}>
+ {fill(t(`team_threads.notice.${code}`), {
+ member: names.get(payload.member_id ?? payload.by ?? "") ?? "",
+ error: payload.error ?? "", note: payload.note ?? "", rounds: payload.rounds ?? 0,
+ step: payload.step ? t(`team_threads.kind.${payload.step}`) : "",
+ files: (payload.files ?? []).join(", "), model: payload.model ?? "",
+ })}
+ </p>;
+}
+
function FindingRow({ finding, by, resolved }: { finding: TeamFinding; by?: string; resolved?: boolean }) {
const t = useT();
return <li className="rounded-lg border border-border px-3 py-2 text-sm">
@@ -381,13 +575,13 @@ function Issues({ thread, names }: { thread: TeamThread; names: Map<string, stri
const t = useT();
const [open, setOpen] = useState(true);
const unresolved = thread.issues.filter((issue) => !issue.resolved).length;
- return <section className="mt-2 flex flex-col gap-2" data-testid="team-thread-issues">
+ return <section className="mt-1 flex flex-col gap-2" data-testid="team-thread-issues">
<button type="button" aria-expanded={open} onClick={() => setOpen(!open)}
className="flex items-center gap-1.5 self-start rounded-md px-1 text-xs font-medium text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
{open ? <ChevronDown aria-hidden className="h-3.5 w-3.5 text-muted-foreground" /> : <ChevronRight aria-hidden className="h-3.5 w-3.5 text-muted-foreground" />}
{fill(t("team_threads.issues.title"), { count: thread.issues.length, open: unresolved })}
</button>
- {open && <ul className="flex flex-col gap-1.5">
+ {open && <ul className="grid gap-1.5 md:grid-cols-2">
{thread.issues.map((issue, index) => <FindingRow key={`${issue.seq}-${index}`} finding={issue} resolved={issue.resolved}
by={`${names.get(issue.by) ?? issue.by} · ${t(`team_threads.issues.${issue.stage}`)}`} />)}
</ul>}
diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/team/board.ts b/jarvis/ui/web/frontend/src/components/agentic/threads/team/board.ts
new file mode 100644
index 0000000000..40b107b58d
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/team/board.ts
@@ -0,0 +1,148 @@
+import type { TeamEntry, TeamMember, TeamThread } from "@/lib/teamThreadsApi";
+
+/**
+ * The team thread laid out as a board: one lane per member, one band per step.
+ *
+ * A band holds what each member contributed to one step (the three own plans
+ * side by side, a master plan beside the votes on it, a build beside its
+ * reviews), so who did what reads across and how the work went reads down.
+ * What belongs to nobody's lane (the person's messages, notices, the outcome)
+ * sits between the bands at full width.
+ */
+
+/** One step of the work; a master-plan or review round is a step of its own. */
+export type BandStep = "draft" | "challenge" | "converge" | "build" | "review";
+
+/** What a member does in a band it has not contributed to yet. */
+export type CellRole = "plans" | "challenges" | "author" | "voter" | "builder" | "reviewer" | "answers" | "none";
+
+export interface BandCell {
+ member: TeamMember;
+ /** What the member filed in this step, oldest first. */
+ entries: TeamEntry[];
+ /** The member's turn for this step is running right now. */
+ live: boolean;
+ role: CellRole;
+}
+
+export interface StepBand {
+ type: "step";
+ key: string;
+ step: BandStep;
+ round: number;
+ cells: BandCell[];
+ /** The step the team is in right now. */
+ current: boolean;
+}
+
+export interface NoteBand {
+ type: "note";
+ key: string;
+ entry: TeamEntry;
+}
+
+export type Band = StepBand | NoteBand;
+
+const STEP_OF: Partial<Record<TeamEntry["kind"], BandStep>> = {
+ draft: "draft",
+ critique: "challenge",
+ plan: "converge",
+ vote: "converge",
+ build: "build",
+ review: "review",
+ fix: "review",
+};
+
+const bandKey = (step: BandStep, round: number) => (step === "converge" || step === "review" ? `${step}:${round}` : step);
+
+function roleIn(step: BandStep, member: TeamMember, thread: TeamThread, entries: TeamEntry[]): CellRole {
+ if (member.state === "left") return "none";
+ if (step === "draft") return "plans";
+ if (step === "challenge") return "challenges";
+ if (step === "converge") {
+ const plan = entries.find((entry) => entry.kind === "plan");
+ if (!plan) return member.working ? "author" : "voter";
+ return plan.author === member.member_id ? "author" : "voter";
+ }
+ if (step === "build") return thread.builder === member.member_id ? "builder" : "reviewer";
+ return thread.builder === member.member_id ? "answers" : "reviewer";
+}
+
+/** The bands of a thread in the order the work happened. */
+export function buildBoard(thread: TeamThread): Band[] {
+ const bands: Band[] = [];
+ const steps = new Map<string, { band: StepBand; entries: TeamEntry[] }>();
+
+ const stepBand = (step: BandStep, round: number) => {
+ const key = bandKey(step, round);
+ let found = steps.get(key);
+ if (!found) {
+ found = { band: { type: "step", key, step, round, cells: [], current: false }, entries: [] };
+ steps.set(key, found);
+ bands.push(found.band);
+ }
+ return found;
+ };
+
+ for (const entry of thread.entries) {
+ const step = STEP_OF[entry.kind];
+ if (step) stepBand(step, entry.round).entries.push(entry);
+ else bands.push({ type: "note", key: `note:${entry.seq}`, entry });
+ }
+
+ // The step being worked on shows from its first second, before anything is filed.
+ const running = thread.state === "running";
+ if (thread.phase !== "done") {
+ const step = thread.phase as BandStep;
+ const round = step === "converge" ? Math.max(1, thread.rounds.plan) : step === "review" ? Math.max(1, thread.rounds.review) : 0;
+ const current = running || steps.has(bandKey(step, round)) ? stepBand(step, round) : null;
+ if (current) current.band.current = thread.state !== "stopped" && thread.state !== "failed";
+ }
+
+ for (const { band, entries } of steps.values()) {
+ band.cells = thread.members.map((member) => {
+ const mine = entries.filter((entry) => entry.author === member.member_id);
+ return {
+ member,
+ entries: mine,
+ // A member works on the current step; its earlier bands are settled.
+ live: band.current && running && member.working,
+ role: roleIn(band.step, member, thread, entries),
+ };
+ });
+ }
+ return bands;
+}
+
+/** A contribution in a few plain lines: Markdown marks, code fences and blank lines dropped. */
+export function gist(text: string, maxChars = 320): string {
+ const lines: string[] = [];
+ let fenced = false;
+ for (const raw of (text ?? "").split(/\r?\n/)) {
+ const line = raw.trim();
+ if (line.startsWith("```")) {
+ fenced = !fenced;
+ continue;
+ }
+ if (fenced || !line) continue;
+ const plain = line
+ .replace(/^#{1,6}\s+/, "")
+ .replace(/^[-*+]\s+/, "")
+ .replace(/^>\s?/, "")
+ .replace(/\*\*([^*]+)\*\*/g, "$1")
+ .replace(/__([^_]+)__/g, "$1")
+ .replace(/`([^`]+)`/g, "$1")
+ .replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
+ .trim();
+ if (plain) lines.push(plain);
+ if (lines.join(" ").length >= maxChars) break;
+ }
+ const joined = lines.join(" · ");
+ return joined.length > maxChars ? `${joined.slice(0, maxChars - 1).trimEnd()}…` : joined;
+}
+
+/** How far the work has come, for the step rail: 0 to 5 (5 = every step done). */
+export function stepsDone(thread: TeamThread): number {
+ const order = ["draft", "challenge", "converge", "build", "review", "done"];
+ return Math.max(0, order.indexOf(thread.phase));
+}
diff --git a/jarvis/ui/web/frontend/src/components/agentic/threads/team/memberLive.ts b/jarvis/ui/web/frontend/src/components/agentic/threads/team/memberLive.ts
new file mode 100644
index 0000000000..e99f9a146e
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/threads/team/memberLive.ts
@@ -0,0 +1,144 @@
+import { useEffect, useState } from "react";
+import { EMPTY_TIMELINE, reduceEvent, reduceEvents, type Timeline, type TurnItem } from "@/components/agentchat/reduce";
+import type { Translate } from "@/components/agentchat/traceEntries";
+import { agentChatSocketUrl, type AgentChatEvent } from "@/lib/agentChatApi";
+import { jitteredDelay, requestConnect } from "@/lib/connectBudget";
+import { buildThreadRows, thoughtGist } from "../threadWork";
+
+/**
+ * What a member is doing right now, read from its own thread's event stream.
+ *
+ * A member of a team thread is an ordinary thread session, so its tool calls
+ * and its text arrive on that session's socket as they happen. The board
+ * listens only while the member's turn runs and shows the newest steps; the
+ * whole conversation stays one click away in the member's thread.
+ */
+
+const RECONNECT_MS = 1500;
+const RECONNECT_MAX_MS = 20_000;
+/** Text streams in many small events; the board repaints at most this often. */
+const PAINT_MS = 200;
+
+/** The turn a member is in, or `null` while it has none running. */
+export function useMemberTurn(sessionId: string, enabled: boolean): TurnItem | null {
+ const [turn, setTurn] = useState<TurnItem | null>(null);
+
+ useEffect(() => {
+ if (!enabled || !sessionId || typeof WebSocket === "undefined") {
+ setTurn(null);
+ return;
+ }
+ let timeline: Timeline = EMPTY_TIMELINE;
+ let socket: WebSocket | null = null;
+ let cancelConnect: (() => void) | null = null;
+ let paint: ReturnType<typeof setTimeout> | null = null;
+ let attempt = 0;
+ let closed = false;
+
+ const publish = () => {
+ paint = null;
+ if (closed) return;
+ const last = [...timeline.items].reverse().find((item): item is TurnItem => item.type === "turn");
+ setTurn(last && last.status === "running" ? last : null);
+ };
+ const schedule = () => {
+ if (paint === null) paint = setTimeout(publish, PAINT_MS);
+ };
+
+ const connect = () => {
+ cancelConnect = null;
+ if (closed) return;
+ const afterSeq = timeline.lastSeq;
+ const ws = new WebSocket(agentChatSocketUrl(sessionId, afterSeq));
+ socket = ws;
+ ws.onopen = () => { attempt = 0; };
+ ws.onmessage = (message) => {
+ if (socket !== ws) return;
+ let frame: { type?: string; events?: AgentChatEvent[]; event?: AgentChatEvent };
+ try {
+ frame = JSON.parse(String(message.data));
+ } catch {
+ return; // not a frame of this protocol
+ }
+ if (frame.type === "snapshot") {
+ // After a reconnect the snapshot only carries what was missed.
+ timeline = reduceEvents(afterSeq > 0 ? timeline : EMPTY_TIMELINE, frame.events ?? []);
+ schedule();
+ } else if (frame.type === "event" && frame.event) {
+ timeline = reduceEvent(timeline, frame.event);
+ schedule();
+ }
+ };
+ ws.onclose = () => {
+ if (socket !== ws || closed) return;
+ socket = null;
+ // Jittered, escalating and paid for out of the shared connect budget (AP-33).
+ attempt += 1;
+ cancelConnect = requestConnect(connect, jitteredDelay(attempt - 1, RECONNECT_MS, RECONNECT_MAX_MS));
+ };
+ ws.onerror = () => { /* onclose follows and schedules the reconnect */ };
+ };
+
+ cancelConnect = requestConnect(connect, 0);
+ return () => {
+ closed = true;
+ cancelConnect?.();
+ if (paint !== null) clearTimeout(paint);
+ const ws = socket;
+ socket = null;
+ ws?.close();
+ };
+ }, [sessionId, enabled]);
+
+ return turn;
+}
+
+/** One line of a member's live feed. */
+export interface LiveLine {
+ id: string;
+ /** A tool call, the member's own words, or a thought. */
+ kind: "call" | "text" | "thought";
+ text: string;
+ /** A tool call's kind, for its glyph ("read", "command", "edit", …). */
+ call?: string;
+ running: boolean;
+ failed: boolean;
+}
+
+/** The newest steps of a running turn, oldest first, at most `max`. */
+export function liveLines(turn: TurnItem | null, options: { t: Translate; lang: string; max?: number }): LiveLine[] {
+ if (!turn) return [];
+ const lines: LiveLine[] = [];
+ for (const row of buildThreadRows(turn.blocks, { t: options.t, lang: options.lang, status: turn.status })) {
+ if (row.kind === "work") {
+ for (const item of row.items) {
+ if (item.kind === "call") {
+ lines.push({
+ id: item.id,
+ kind: "call",
+ text: [item.call.text, item.call.detail].filter(Boolean).join(" "),
+ call: item.call.kind,
+ running: item.call.status === "running",
+ failed: item.call.status === "failed",
+ });
+ } else {
+ lines.push({ id: item.id, kind: "thought", text: "", running: true, failed: false });
+ }
+ }
+ } else if (row.kind === "text") {
+ const text = thoughtGist(row.text);
+ if (text) lines.push({ id: row.id, kind: "text", text, running: false, failed: false });
+ } else if (row.kind === "thought") {
+ const text = thoughtGist(row.text);
+ if (text) lines.push({ id: row.id, kind: "thought", text, running: row.live, failed: false });
+ }
+ }
+ return lines.slice(-(options.max ?? 6));
+}
+
+/** Tokens a running turn has produced so far, when its runner reports them. */
+export function liveTokens(turn: TurnItem | null): number {
+ const usage = turn?.liveUsage;
+ if (!usage) return 0;
+ return Number(usage.output_tokens ?? usage.output ?? 0) || 0;
+}
diff --git a/jarvis/ui/web/frontend/src/hooks/useStickToBottom.ts b/jarvis/ui/web/frontend/src/hooks/useStickToBottom.ts
index b186205ab6..b470769c11 100644
--- a/jarvis/ui/web/frontend/src/hooks/useStickToBottom.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useStickToBottom.ts
@@ -163,7 +163,17 @@ export function useStickToBottom() {
return () => ro.disconnect();
}, [rootEl, contentEl]);
- return { rootRef, contentRef, atEnd, jumpToEnd, follow };
+ /**
+ * The reader picked a place themselves (opened something to read in the
+ * middle of the page): stop following until they are back at the end. Call
+ * it BEFORE the content grows, or the growth still counts as new output.
+ */
+ const release = useCallback(() => {
+ stickRef.current = false;
+ setAtEnd(false);
+ }, []);
+
+ return { rootRef, contentRef, atEnd, jumpToEnd, follow, release };
}
/**
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 5a7697c384..86ad3ff0ad 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -9561,7 +9561,6 @@
"delete_confirm": "Mit den Threads der Mitglieder löschen?",
"steps": "Schritte",
"members": "Team",
- "usage": "{minutes} von {max_minutes} Min. · {turns} von {max_turns} Zügen",
"cost_partial": "Einige Mitglieder laufen auf einem Platz, der keinen Preis meldet. Der Betrag ist daher unvollständig.",
"cost_hint": "Betrag zum Listenpreis, wie ihn die Coding-Agents melden. Ein Abo-Platz wird nicht pro Zug abgerechnet.",
"accept_plan": "Diesen Plan nehmen",
@@ -9613,7 +9612,8 @@
"working": "arbeitet",
"waiting": "wartet auf dich",
"left": "ausgeschieden",
- "builder": "Baut den Plan"
+ "builder": "Baut den Plan",
+ "idle": "wartet"
},
"reason": {
"user": "Du hast diesen Team-Thread pausiert.",
@@ -9669,6 +9669,25 @@
"placeholder": "Beschreibe die Aufgabe für das Team",
"start": "Team starten",
"bounds": "Hält an und fragt dich nach 90 Minuten, 40 Zügen oder drei Runden ohne Einigung."
+ },
+ "meter_time": "{minutes} von {max_minutes} Min.",
+ "meter_turns": "{turns} von {max_turns} Zügen",
+ "band_count": "{done} von {total}",
+ "no_report": "Es wurde kein Bericht geschrieben.",
+ "findings_count": "{count} Befunde",
+ "objections_count": "{count} Einwände",
+ "close_reader": "Schließen",
+ "live_tokens": "{count} Tokens",
+ "live_starting": "Startet…",
+ "live_thinking": "Denkt nach",
+ "role": {
+ "plans": "Schreibt den eigenen Plan",
+ "challenges": "Prüft die anderen Pläne",
+ "author": "Schreibt den Masterplan",
+ "voter": "Stimmt ab, sobald der Plan da ist",
+ "builder": "Baut den Plan",
+ "reviewer": "Prüft, sobald gebaut ist",
+ "answers": "Antwortet auf das Review"
}
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 8fc84c95f4..db84569e7a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -9561,7 +9561,6 @@
"delete_confirm": "Delete it with its members' threads?",
"steps": "Steps",
"members": "Team",
- "usage": "{minutes} of {max_minutes} min · {turns} of {max_turns} turns",
"cost_partial": "Some members run on a seat that reports no price, so the amount is incomplete.",
"cost_hint": "The amount at list price, as the coding agents report it. A subscription seat is not billed per turn.",
"accept_plan": "Take this plan",
@@ -9613,7 +9612,8 @@
"working": "working",
"waiting": "waits for you",
"left": "left",
- "builder": "Builds the plan"
+ "builder": "Builds the plan",
+ "idle": "waiting"
},
"reason": {
"user": "You paused this team thread.",
@@ -9669,6 +9669,25 @@
"placeholder": "Describe the task for the team",
"start": "Start the team",
"bounds": "Stops and asks you after 90 minutes, 40 turns, or three rounds without agreement."
+ },
+ "meter_time": "{minutes} of {max_minutes} min",
+ "meter_turns": "{turns} of {max_turns} turns",
+ "band_count": "{done} of {total}",
+ "no_report": "No report was written.",
+ "findings_count": "{count} findings",
+ "objections_count": "{count} objections",
+ "close_reader": "Close",
+ "live_tokens": "{count} tokens",
+ "live_starting": "Starting…",
+ "live_thinking": "Thinking",
+ "role": {
+ "plans": "Writes its own plan",
+ "challenges": "Challenges the other plans",
+ "author": "Writes the master plan",
+ "voter": "Votes once the plan is there",
+ "builder": "Builds the plan",
+ "reviewer": "Reviews once the build is there",
+ "answers": "Answers the review"
}
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index d41c004ff0..1001b00e50 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -9561,7 +9561,6 @@
"delete_confirm": "¿Eliminarlo con los hilos de sus miembros?",
"steps": "Pasos",
"members": "Equipo",
- "usage": "{minutes} de {max_minutes} min · {turns} de {max_turns} turnos",
"cost_partial": "Algunos miembros usan un puesto que no informa del precio, así que el importe está incompleto.",
"cost_hint": "Importe a precio de lista, tal como lo informan los agentes de código. Un puesto de suscripción no se factura por turno.",
"accept_plan": "Aceptar este plan",
@@ -9613,7 +9612,8 @@
"working": "trabajando",
"waiting": "te espera",
"left": "salió",
- "builder": "Construye el plan"
+ "builder": "Construye el plan",
+ "idle": "en espera"
},
"reason": {
"user": "Has pausado este hilo de equipo.",
@@ -9669,6 +9669,25 @@
"placeholder": "Describe la tarea para el equipo",
"start": "Iniciar el equipo",
"bounds": "Se detiene y te pregunta tras 90 minutos, 40 turnos o tres rondas sin acuerdo."
+ },
+ "meter_time": "{minutes} de {max_minutes} min",
+ "meter_turns": "{turns} de {max_turns} turnos",
+ "band_count": "{done} de {total}",
+ "no_report": "No se escribió ningún informe.",
+ "findings_count": "{count} hallazgos",
+ "objections_count": "{count} objeciones",
+ "close_reader": "Cerrar",
+ "live_tokens": "{count} tokens",
+ "live_starting": "Iniciando…",
+ "live_thinking": "Pensando",
+ "role": {
+ "plans": "Escribe su propio plan",
+ "challenges": "Contrasta los otros planes",
+ "author": "Escribe el plan maestro",
+ "voter": "Vota cuando esté el plan",
+ "builder": "Construye el plan",
+ "reviewer": "Revisa cuando esté construido",
+ "answers": "Responde a la revisión"
}
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/pt.json b/jarvis/ui/web/frontend/src/i18n/locales/pt.json
index 532497eb10..9df813de03 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/pt.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/pt.json
@@ -9561,7 +9561,6 @@
"delete_confirm": "Eliminar com os tópicos dos membros?",
"steps": "Passos",
"members": "Equipa",
- "usage": "{minutes} de {max_minutes} min · {turns} de {max_turns} turnos",
"cost_partial": "Alguns membros usam um lugar que não indica o preço, por isso o valor está incompleto.",
"cost_hint": "Valor ao preço de tabela, tal como os agentes de código o indicam. Um lugar de subscrição não é faturado por turno.",
"accept_plan": "Aceitar este plano",
@@ -9613,7 +9612,8 @@
"working": "a trabalhar",
"waiting": "à sua espera",
"left": "saiu",
- "builder": "Constrói o plano"
+ "builder": "Constrói o plano",
+ "idle": "em espera"
},
"reason": {
"user": "Pausou este tópico de equipa.",
@@ -9669,6 +9669,25 @@
"placeholder": "Descreva a tarefa para a equipa",
"start": "Iniciar a equipa",
"bounds": "Para e pergunta-lhe após 90 minutos, 40 turnos ou três rondas sem acordo."
+ },
+ "meter_time": "{minutes} de {max_minutes} min",
+ "meter_turns": "{turns} de {max_turns} turnos",
+ "band_count": "{done} de {total}",
+ "no_report": "Não foi escrito nenhum relatório.",
+ "findings_count": "{count} problemas",
+ "objections_count": "{count} objeções",
+ "close_reader": "Fechar",
+ "live_tokens": "{count} tokens",
+ "live_starting": "A iniciar…",
+ "live_thinking": "A pensar",
+ "role": {
+ "plans": "Escreve o seu próprio plano",
+ "challenges": "Contrasta os outros planos",
+ "author": "Escreve o plano principal",
+ "voter": "Vota quando o plano existir",
+ "builder": "Constrói o plano",
+ "reviewer": "Revê quando estiver construído",
+ "answers": "Responde à revisão"
}
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/zh.json b/jarvis/ui/web/frontend/src/i18n/locales/zh.json
index 2d396c6ea0..940978d35f 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/zh.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/zh.json
@@ -9561,7 +9561,6 @@
"delete_confirm": "连同成员的会话一起删除?",
"steps": "步骤",
"members": "团队",
- "usage": "{minutes} / {max_minutes} 分钟 · {turns} / {max_turns} 轮",
"cost_partial": "部分成员使用的席位不报告价格,因此金额不完整。",
"cost_hint": "按标价计算的金额,由编码代理报告。订阅席位不按轮次计费。",
"accept_plan": "采用此方案",
@@ -9613,7 +9612,8 @@
"working": "工作中",
"waiting": "等待你",
"left": "已退出",
- "builder": "负责实现方案"
+ "builder": "负责实现方案",
+ "idle": "等待中"
},
"reason": {
"user": "你已暂停此团队会话。",
@@ -9669,6 +9669,25 @@
"placeholder": "描述交给团队的任务",
"start": "启动团队",
"bounds": "在 90 分钟、40 轮或三轮未达成一致后停止并询问你。"
+ },
+ "meter_time": "{minutes} / {max_minutes} 分钟",
+ "meter_turns": "{turns} / {max_turns} 轮",
+ "band_count": "{done} / {total}",
+ "no_report": "未写报告。",
+ "findings_count": "{count} 项发现",
+ "objections_count": "{count} 条异议",
+ "close_reader": "关闭",
+ "live_tokens": "{count} tokens",
+ "live_starting": "正在启动…",
+ "live_thinking": "思考中",
+ "role": {
+ "plans": "撰写自己的方案",
+ "challenges": "质询其他方案",
+ "author": "撰写总方案",
+ "voter": "方案完成后表决",
+ "builder": "实现方案",
+ "reviewer": "实现完成后评审",
+ "answers": "答复评审"
}
}
}
diff --git a/jarvis/ui/web/frontend/src/index.css b/jarvis/ui/web/frontend/src/index.css
index 2b41bb5940..0ebd636c40 100644
--- a/jarvis/ui/web/frontend/src/index.css
+++ b/jarvis/ui/web/frontend/src/index.css
@@ -2955,3 +2955,47 @@ body {
color: hsl(var(--diff-del));
}
}
+
+/* Team thread board (components/agentic/threads/team): a cell whose member is
+ working right now carries a signal line that travels along its top edge, and
+ the step being worked on breathes. The app's reduced-motion floor stills all
+ of it; the line stays visible. */
+@layer components {
+ .team-live {
+ position: relative;
+ }
+ .team-live::before {
+ content: "";
+ position: absolute;
+ inset: 0 0 auto 0;
+ height: 2px;
+ background: linear-gradient(90deg, transparent 0%, hsl(var(--accent)) 50%, transparent 100%);
+ background-size: 200% 100%;
+ animation: team-live-sweep 1.8s linear infinite;
+ }
+ .team-live-line {
+ animation: team-live-in 0.24s ease-out;
+ }
+ .team-pulse {
+ animation: team-pulse 1.4s ease-in-out infinite;
+ }
+ .team-step-now {
+ animation: team-step-now 1.8s ease-in-out infinite;
+ }
+ @keyframes team-live-sweep {
+ from { background-position: 200% 0; }
+ to { background-position: -200% 0; }
+ }
+ @keyframes team-live-in {
+ from { opacity: 0; transform: translateY(4px); }
+ to { opacity: 1; transform: none; }
+ }
+ @keyframes team-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.35; }
+ }
+ @keyframes team-step-now {
+ 0%, 100% { box-shadow: 0 0 0 0 hsl(var(--accent) / 0.45); }
+ 50% { box-shadow: 0 0 0 4px hsl(var(--accent) / 0); }
+ }
+}