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): the chat header wears the grid's recap line, card and all

rubenluetke10-beepcf2db0f21ec1
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index 5f68dc2005..63f844b246 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -77,6 +77,7 @@ import { WorkspaceExplorer } from "./WorkspaceExplorer";
import { WorkspaceFileViewer } from "./WorkspaceFileViewer";
import { PaneChat } from "./PaneChat";
import { useIdeChatStore } from "@/store/ideChat";
+import { PANE_ACTIVITY_EVENT, readPaneActivityChange } from "@/store/workspacePanes";
import type { WorkspaceView } from "@/components/agentic/workspaceView";
import { sameRows } from "./chatState";
import { usePaneArrange, type DropZone } from "./paneArrange";
@@ -975,9 +976,41 @@ export function AgenticGrid({
timer = window.setTimeout(() => void run(), busy ? ACTIVITY_POLL_MS : ACTIVITY_POLL_IDLE_MS);
};
void run();
+ // The socket's own word, ahead of the poll: the backend sweep says the
+ // moment a pane's reading changes (`AgenticIdePaneActivity`), and the
+ // badge follows on that beat rather than on the next pull. Same cache,
+ // same workspace guard, same keep-identity rule — an event repeating what
+ // the poll already said changes nothing.
+ const onActivity = (event: Event) => {
+ const change = readPaneActivityChange((event as CustomEvent).detail);
+ if (!change || change.session_id !== session.id || cancelled) return;
+ const row: TerminalActivityRow = {
+ key: change.key,
+ name: change.name,
+ status: change.status,
+ activity: change.activity,
+ activity_since: change.activity_since,
+ worked: change.worked,
+ };
+ setActivityCache((current) => {
+ const currentRows = current.workspaceId === session.id ? current.rows : {};
+ const next = { ...currentRows, [row.name]: row };
+ return sameRows(currentRows, next) ? current : { workspaceId: session.id, rows: next };
+ });
+ if (change.activity === "working") {
+ // The backend confirmed what the optimistic bridge was holding.
+ setSentAt((current) =>
+ row.name in current
+ ? Object.fromEntries(Object.entries(current).filter(([name]) => name !== row.name))
+ : current,
+ );
+ }
+ };
+ window.addEventListener(PANE_ACTIVITY_EVENT, onActivity);
return () => {
cancelled = true;
if (timer !== undefined) window.clearTimeout(timer);
+ window.removeEventListener(PANE_ACTIVITY_EVENT, onActivity);
};
}, [session.id, pollRecaps]);
@@ -2536,8 +2569,20 @@ export function AgenticGrid({
}
// The same recap the pane's own header wears (polled, else the one
// the workspace state carried), so the stage and the terminal
- // behind it never name one pane two ways.
+ // behind it never name one pane two ways — and the same card
+ // behind it: the longer form, who wrote it and why, and the
+ // actions, exactly as the pane's own header hands them to
+ // PaneRecap above.
title={recaps[stagedTerm.name]?.recap ?? stagedTerm.recap}
+ titleDetail={recaps[stagedTerm.name]?.recap_detail ?? stagedTerm.recap_detail}
+ recapMeta={{
+ source: recaps[stagedTerm.name]?.source,
+ reason: recaps[stagedTerm.name]?.reason,
+ writer: recaps[stagedTerm.name]?.writer,
+ note: recaps[stagedTerm.name]?.note,
+ generatedAt: recaps[stagedTerm.name]?.generated_at,
+ }}
+ recapActions={recapActionsFor(stagedTerm.name)}
// The whole reading, not just the word: the header spells the
// state out with how long it has held, and tells a finished pane
// from one nobody has spoken to — the same three facts the
diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
index 4316e6f48b..8e9cd0bac0 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.test.tsx
@@ -182,17 +182,48 @@ describe("PaneChat", () => {
renderStage({ title: "Fixing the login test" });
await screen.findByTestId("agent-turn");
const header = screen.getByTestId("pane-chat-T7").querySelector("header")!;
- expect(screen.getByTestId("pane-chat-title").textContent).toBe("Fixing the login test");
+ expect(screen.getByTestId("pane-recap-T7").textContent).toBe("Fixing the login test");
+ expect(screen.getByTestId("pane-chat-agent").textContent).toBe("Claude Code");
expect(header.textContent).toContain("Claude Code");
});
+ // The title is the grid's own recap line, card and all: the backend cuts
+ // the header line to a grid pane's width ("Look into why the embedding
+ // models show up in…"), and the card is where the rest of the sentence,
+ // the longer recap and the reason for it can be read — in the chat exactly
+ // as in the grid (maintainer report 2026-08-27).
+ it("opens the same recap card the grid opens, with the longer form behind the cut line", async () => {
+ vi.mocked(api.fetchTerminalTimeline).mockResolvedValue(answer());
+ const onSave = vi.fn().mockResolvedValue(undefined);
+ renderStage({
+ title: "Look into why the embedding models show up in…",
+ titleDetail:
+ "Look into why the embedding models show up in the voice model picker although they should not.",
+ recapMeta: { source: "heuristic", reason: "warming" },
+ recapActions: { onSave },
+ });
+ await screen.findByTestId("agent-turn");
+ expect(screen.queryByTestId("pane-recap-card-T7")).toBeNull();
+ fireEvent.click(screen.getByTestId("pane-recap-T7"));
+ const card = screen.getByTestId("pane-recap-card-T7");
+ expect(screen.getByTestId("pane-recap-headline-T7").textContent).toBe(
+ "Look into why the embedding models show up in…",
+ );
+ expect(screen.getByTestId("pane-recap-detail-T7").textContent).toContain(
+ "although they should not",
+ );
+ expect(screen.getByTestId("pane-recap-why-T7").textContent).toContain("Too little output");
+ expect(card.textContent).toContain("Read from the output");
+ expect(screen.getByTestId("pane-recap-card-edit-T7")).toBeTruthy();
+ });
+
it("names the CLI alone while no header has described the pane", async () => {
vi.mocked(api.fetchTerminalTimeline).mockResolvedValue(answer());
renderStage({ title: " " });
await screen.findByTestId("agent-turn");
- expect(screen.queryByTestId("pane-chat-title")).toBeNull();
- const header = screen.getByTestId("pane-chat-T7").querySelector("header")!;
- expect(header.textContent).toContain("Claude Code");
+ expect(screen.queryByTestId("pane-recap-T7")).toBeNull();
+ expect(screen.queryByTestId("pane-chat-agent")).toBeNull();
+ expect(screen.getByTestId("pane-agent-T7").textContent).toBe("Claude Code");
});
it("flags a pane that is asking something only the terminal can answer", async () => {
@@ -229,7 +260,7 @@ describe("the header's state", () => {
const chip = screen.getByTestId("pane-chat-state");
expect(chip.dataset.state).toBe("done");
expect(chip.textContent).toContain("Done");
- expect(chip.querySelector("[data-icon='dot']")).not.toBeNull();
+ expect(chip.querySelector("[data-icon='check']")).not.toBeNull();
});
it("does not call a pane that was never asked anything done", async () => {
diff --git a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
index 4b2e478375..a90fd6c9d4 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/PaneChat.tsx
@@ -25,7 +25,10 @@ import {
paneActivityState,
type PaneActivityState,
} from "@/components/agentic/PaneActivityPill";
+import { PaneRecap } from "@/components/agentic/PaneRecap";
+import type { PaneRecapActions, PaneRecapMeta } from "@/components/agentic/AgenticTerminal";
import { ChatStage } from "@/components/home/ChatStage";
+import { useThemeValue } from "@/hooks/useTheme";
import { createPaneChatStore, type PaneChatStoreHook } from "@/store/paneChat";
import type { PaneActivity } from "@/lib/agenticIdeApi";
import { fill, useT } from "@/i18n";
@@ -109,6 +112,17 @@ export interface PaneChatProps {
* CLI's name then carries the header alone, as it always did.
*/
title?: string;
+ /**
+ * The longer form behind the title — the paragraph the recap card shows.
+ * The header line is cut to a grid pane's width on the backend (48
+ * characters, hence the "…" a long prompt ends in); this is where the
+ * rest of the sentence lives, and the card is the place it can be read.
+ */
+ titleDetail?: string;
+ /** Who wrote the recap and why it is the one on screen — the card's footer. */
+ recapMeta?: PaneRecapMeta;
+ /** Rewrite, reset or refresh the recap; absent leaves the card read-only. */
+ recapActions?: PaneRecapActions;
/** The workspace folder — the composer's chip and the empty page's headline. */
folder: string;
/** The grid's own reading of the pane: working, waiting, asking… */
@@ -130,6 +144,9 @@ export function PaneChat({
agent,
agentLabel,
title = "",
+ titleDetail = "",
+ recapMeta,
+ recapActions,
folder,
activity,
activitySince = 0,
@@ -177,6 +194,11 @@ export function PaneChat({
const timed = activitySince > 0 && state !== "live" && state !== "starting";
const now = useClock(timed);
const elapsed = timed ? elapsedLabel(activitySince, now, t) : "";
+ // The recap line dresses in the pane brand's ink, keyed to the ground it
+ // sits on. In the grid that is the terminal's own appearance; here the
+ // header sits on the app's background, so the app's theme is the ground.
+ const theme = useThemeValue();
+ const titled = title.trim().length > 0;
return (
<div
@@ -188,25 +210,50 @@ export function PaneChat({
<header className="flex h-11 shrink-0 items-center gap-2 border-b border-border px-4">
<MessageSquare className="h-4 w-4 shrink-0 text-primary" aria-hidden />
<span className="font-mono text-xs font-semibold text-foreground">{terminal}</span>
- {/* The pane's title where the sidebar row showed it too, so the header
- and the row that opened it agree on what this conversation is; the
- CLI's name steps aside to the right, the logo-sized fact it is. */}
- {title.trim() ? (
- <>
- <span
- className="min-w-0 flex-1 truncate text-sm text-foreground"
- data-testid="pane-chat-title"
- title={title}
- >
- {title}
- </span>
- <span className="max-w-[10rem] shrink-0 truncate text-xs text-muted-foreground">
- {agentLabel}
- </span>
- </>
- ) : (
- <span className="min-w-0 flex-1 truncate text-sm text-muted-foreground">{agentLabel}</span>
+ {/* The pane's title, drawn by the same component the grid draws it
+ with in the pane's own header — so the stage and the terminal
+ behind it are one pane named one way, and so the title IS the
+ same thing here that it is there: a line that opens into a card
+ with the whole sentence, the longer recap, who wrote it and why,
+ and the two ways to change it. A plain span said less than the
+ grid did about the very session the stage was opened to read
+ (maintainer report 2026-08-27). Without a title the line names
+ the CLI, as the grid's header does; with one, the CLI's name
+ steps aside to the right, the logo-sized fact it is.
+
+ The line hugs its text rather than filling the header: the
+ recap's chevron trails the sentence, and in a grid pane's
+ narrow header that IS the far edge — across a window-wide
+ header it would sit half a screen from the words it opens. So
+ the wrapper is content-sized (still able to shrink and clip
+ when the header is crowded) and a spacer after the CLI's name
+ pushes the state and the buttons to the right instead. */}
+ <span className="flex min-w-0 items-center" data-testid="pane-chat-title">
+ <PaneRecap
+ name={terminal}
+ displayName={agentLabel}
+ recap={title}
+ detail={titleDetail}
+ source={recapMeta?.source}
+ reason={recapMeta?.reason}
+ writer={recapMeta?.writer}
+ note={recapMeta?.note}
+ generatedAt={recapMeta?.generatedAt}
+ light={theme === "light"}
+ onSave={recapActions?.onSave}
+ onClear={recapActions?.onClear}
+ onRefresh={recapActions?.onRefresh}
+ />
+ </span>
+ {titled && (
+ <span
+ className="max-w-[10rem] shrink-0 truncate text-xs text-muted-foreground"
+ data-testid="pane-chat-agent"
+ >
+ {agentLabel}
+ </span>
)}
+ <span className="flex-1" aria-hidden />
{/* The state, spelled out: the pill's shape and a word for it, with
how long it has been so. A chip rather than loose text so it reads
as ONE fact beside the title, and never wraps into it. */}