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): name the workspace view, and make room for a third

rubenluetke10-beepd0185aa1cb40
diff --git a/jarvis/agentic_ide/session.py b/jarvis/agentic_ide/session.py
index 8246ec4e33..21622a7dd2 100644
--- a/jarvis/agentic_ide/session.py
+++ b/jarvis/agentic_ide/session.py
@@ -97,6 +97,12 @@ from .terminal_input import (
is_pointer_noise_only,
)
from .transcript import ReplayBuffer, Transcript
+from .workspace_view import (
+ VIEW_CHAT,
+ VIEW_DECK,
+ VIEW_GRID,
+ coerce_view,
+)
if TYPE_CHECKING: # pragma: no cover - typing only
from jarvis.agent_accounts import AgentAccount
@@ -1240,7 +1246,12 @@ class Session:
# in the grid every pane is visible and no default is honest. This state is
# reported by the mounted frontend and deliberately excluded from resume
# snapshots: after a restart the UI reports what it actually shows again.
- surface_chat_visible: bool = False
+ #
+ # Which of the three reading modes is on screen — see
+ # ``agentic_ide.workspace_view``. It replaced a ``chat_view`` boolean once a
+ # third mode existed, and it is read for more than deixis now: the Command
+ # Deck is the one surface allowed to speak a finished pane out loud.
+ surface_view: str = VIEW_GRID
surface_terminal: str = ""
# The written prompt bar and the voice orb share one explicit pane target.
# Unlike ``surface_terminal``, this remains meaningful in grid view: every
@@ -1289,11 +1300,23 @@ class Session:
return next((t for t in self.terminals if t.name == matched), None)
def contextual_terminal(self) -> Terminal | None:
- """The one pane visibly filling chat view, if there is exactly one."""
- if not self.surface_chat_visible or not self.surface_terminal:
+ """The one pane the visible surface puts in front of the user.
+
+ Two of the three views can answer this. Chat view stages exactly one
+ pane; the Command Deck stages one whenever a card has been unfolded to
+ read its terminal. The grid never answers — a dozen panes are visible
+ there, and picking one of them would be a guess dressed as a fact.
+ """
+ if self.surface_view not in (VIEW_CHAT, VIEW_DECK):
+ return None
+ if not self.surface_terminal:
return None
return self.find(self.surface_terminal)
+ def stages_one_pane(self) -> bool:
+ """Does the visible view show a single pane, rather than the wall?"""
+ return self.surface_view in (VIEW_CHAT, VIEW_DECK)
+
def prompt_target_terminal(self) -> Terminal | None:
"""The pane selected by the visible prompt bar and voice orb."""
if not self.surface_on_screen or not self.surface_prompt_target:
@@ -2343,23 +2366,28 @@ class Registry:
self,
*,
workspace_id: str,
- chat_view: bool,
+ view: str,
on_screen: bool,
terminal: str | None,
prompt_target: str | None = None,
) -> bool:
- """Record which single pane the active UI visibly puts on its stage.
+ """Record which view the active UI shows, and the pane it stages.
A stale grid can finish a request after the user changed workspace, so
only the active workspace may write this context. Invalid or hidden
selections clear the default rather than leaving a believable old one.
+
+ An off-screen section reports the grid regardless of what it was last
+ showing. That is not cosmetic: the deck speaks finished panes out loud,
+ and a section the user navigated away from must not keep talking from
+ behind whatever they are looking at now.
"""
session = self.session
if session is None or session.id != workspace_id:
return False
session.surface_on_screen = bool(on_screen)
- session.surface_chat_visible = bool(chat_view and on_screen)
- selected = session.find(terminal or "") if session.surface_chat_visible else None
+ session.surface_view = coerce_view(view) if session.surface_on_screen else VIEW_GRID
+ selected = session.find(terminal or "") if session.stages_one_pane() else None
session.surface_terminal = selected.name if selected is not None else ""
prompt = session.find(prompt_target or "") if session.surface_on_screen else None
session.surface_prompt_target = (
diff --git a/jarvis/agentic_ide/workspace_view.py b/jarvis/agentic_ide/workspace_view.py
new file mode 100644
index 0000000000..cd3f639462
--- /dev/null
+++ b/jarvis/agentic_ide/workspace_view.py
@@ -0,0 +1,68 @@
+"""Which way the user is reading the open workspace right now.
+
+The Agentic IDE renders one set of panes three different ways, and the backend
+has to know which one is on screen — not for looks, but because two behaviours
+depend on it:
+
+* **Deictic reference.** "This terminal" is only answerable when exactly one
+ pane fills the screen. Chat view puts one there; the grid puts a dozen, and
+ guessing among them is less honest than asking for a call-sign.
+* **Speaking unasked.** The Command Deck is the one surface where Jarvis
+ reports finished work out loud (see :mod:`.standup`). In the other two the
+ same events reach the header bell and stay silent, which is what they have
+ always done.
+
+This module is layer 0 of the five-layer enum pattern
+(``docs/anti-drift-three-layer.md``). The value crosses from this package into
+a Pydantic model, a REST body, a TypeScript union and a stored browser
+preference, and BUG-008 is what happens when one of those learns a value the
+others were never told about. Producers import the symbols; nobody spells the
+strings.
+
+Why a plain tuple of strings rather than ``enum.StrEnum``: this value is read
+on the voice hot path and serialised on every surface report, and the rest of
+this package (see :mod:`.task_kind`) already settled on module constants. One
+convention beats two.
+"""
+
+from __future__ import annotations
+
+#: The wall of terminals — every pane visible at once, sized by dragged seams.
+VIEW_GRID = "grid"
+#: One pane on a calm stage, the rest on a rail, read like a conversation.
+VIEW_CHAT = "chat"
+#: The Command Deck: the orb is the subject, Jarvis briefs and reports back.
+VIEW_DECK = "deck"
+
+#: Every value the contract allows, in the order the toolbar offers them.
+WORKSPACE_VIEWS: tuple[str, ...] = (VIEW_GRID, VIEW_CHAT, VIEW_DECK)
+
+#: What an unreadable or absent value falls back to.
+#:
+#: The grid, deliberately: it is the view that promises the least. A surface
+#: report that arrives garbled must not be able to switch a workspace INTO the
+#: deck, because the deck is the one that starts talking on its own.
+VIEW_DEFAULT = VIEW_GRID
+
+
+def coerce_view(raw: object) -> str:
+ """The named view, or :data:`VIEW_DEFAULT` for anything unrecognised.
+
+ Used wherever a view arrives from outside this process — a REST body, a
+ resume snapshot, an older frontend bundle. Never raises: a workspace whose
+ reading mode could not be understood is still a working workspace, and
+ taking a request down over a display preference would be the larger bug.
+ """
+ return raw if isinstance(raw, str) and raw in WORKSPACE_VIEWS else VIEW_DEFAULT
+
+
+def view_from_legacy_chat_flag(chat_view: object) -> str:
+ """Read the boolean that came before this enum.
+
+ The desktop shell is an embedded WebView holding a bundle that reloads
+ itself, so for a few seconds after an update a window can still be posting
+ the old ``chat_view: true|false`` body. Those two values map cleanly onto
+ two of the three views, and an old client can never mean the third — it
+ does not know the deck exists.
+ """
+ return VIEW_CHAT if bool(chat_view) else VIEW_GRID
diff --git a/jarvis/ui/web/agentic_ide_routes.py b/jarvis/ui/web/agentic_ide_routes.py
index 40ba349753..17cafb111f 100644
--- a/jarvis/ui/web/agentic_ide_routes.py
+++ b/jarvis/ui/web/agentic_ide_routes.py
@@ -55,6 +55,7 @@ import logging
import re
from dataclasses import asdict
from pathlib import Path
+from typing import Literal, get_args
from fastapi import (
APIRouter,
@@ -112,6 +113,10 @@ from jarvis.agentic_ide.session import (
workspace_changed_event,
)
from jarvis.agentic_ide.terminal_input import is_terminal_report_only
+from jarvis.agentic_ide.workspace_view import (
+ WORKSPACE_VIEWS,
+ view_from_legacy_chat_flag,
+)
from .surface_security import credentials_valid, is_loopback_request
@@ -296,11 +301,35 @@ class ModeRequest(BaseModel):
)
+#: Layer 3 of the workspace-view enum (``docs/anti-drift-three-layer.md``).
+#: Pydantic cannot take a tuple in ``Literal[...]``, so the values are spelled
+#: again here and the assertion below makes that duplication safe: any drift
+#: from layer 0 fails at import, which means pytest collection fails, rather
+#: than producing an HTTP 422 for one specific body weeks later.
+WorkspaceViewName = Literal["grid", "chat", "deck"]
+if set(get_args(WorkspaceViewName)) != set(WORKSPACE_VIEWS): # pragma: no cover - guard
+ raise RuntimeError(
+ "WorkspaceViewName drifted from WORKSPACE_VIEWS — update both "
+ "(jarvis/agentic_ide/workspace_view.py is the source of truth)."
+ )
+
+
class SurfaceContextRequest(BaseModel):
"""Which terminal the Agentic-IDE UI shows and targets for prompts."""
workspace_id: str = Field(description="Workspace currently rendered by this view.")
- chat_view: bool = Field(description="True only while the one-pane chat view is selected.")
+ view: WorkspaceViewName | None = Field(
+ default=None,
+ description="Which reading mode is on screen: grid, chat, or deck.",
+ )
+ chat_view: bool | None = Field(
+ default=None,
+ description=(
+ "Deprecated — superseded by `view`. Still read so a desktop WebView "
+ "still holding the pre-deck bundle keeps reporting its surface "
+ "correctly for the seconds before it reloads itself."
+ ),
+ )
on_screen: bool = Field(description="Whether the Agentic-IDE section is visible.")
terminal: str | None = Field(
default=None,
@@ -1913,15 +1942,20 @@ async def set_mode(request: Request, req: ModeRequest) -> dict:
@router.put("/surface-context", summary="Report the visible Agentic-IDE terminal")
async def set_surface_context(req: SurfaceContextRequest) -> dict:
- """Keep deictic voice/chat references aligned with the visible chat pane.
+ """Keep deictic voice/chat references aligned with the visible pane.
The state is ephemeral and active-workspace scoped. Grid view clears it,
because several terminals are visible there and guessing one would be less
honest than asking for a call-sign.
+
+ Two ways in, one meaning: `view` is the contract, `chat_view` is what the
+ pre-deck bundle sends. A body carrying neither reports the grid, which is
+ the view that promises the least — see `workspace_view.VIEW_DEFAULT`.
"""
+ view = req.view if req.view is not None else view_from_legacy_chat_flag(req.chat_view)
accepted = get_registry().set_surface_context(
workspace_id=req.workspace_id,
- chat_view=req.chat_view,
+ view=view,
on_screen=req.on_screen,
terminal=req.terminal,
prompt_target=req.prompt_target,
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
index b4a35313df..f18f31d60b 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
@@ -2549,7 +2549,13 @@ describe("chat view", () => {
const cellClass = (name: string) =>
screen.getByTestId(`pane-cell-${name}`).className;
+ /*
+ * The reading modes are three separate buttons, not one cycling control:
+ * past two states "click again" stops telling you where you land, and the
+ * third mode changes the assistant's behaviour rather than only the layout.
+ */
const toChat = () => fireEvent.click(screen.getByTestId("agentic-view-mode-toggle"));
+ const toGrid = () => fireEvent.click(screen.getByTestId("agentic-view-mode-grid"));
const railOrder = () =>
screen
@@ -2645,14 +2651,20 @@ describe("chat view", () => {
);
});
- it("keeps the very same pane elements across a switch and back", () => {
+ it("keeps the very same pane elements across every mode and back", () => {
+ // The iron rule of this component, and the one a new reading mode is most
+ // likely to break: element identity is the mounting guarantee. A remounted
+ // pane is a NEW element, and a new element means the WebSocket died with
+ // the old one — which kills the coding agent behind it.
renderGrid(FOUR);
const before = screen.getByTestId("pane-Nova");
+
toChat();
expect(screen.getByTestId("pane-Nova")).toBe(before);
- toChat();
- // Element identity is the mounting guarantee: a remounted pane would be a
- // NEW element, and a new element means the WebSocket died with the old one.
+ fireEvent.click(screen.getByTestId("agentic-view-mode-deck"));
+ expect(screen.getByTestId("pane-Nova")).toBe(before);
+ toGrid();
+
expect(screen.getByTestId("pane-Nova")).toBe(before);
expect(screen.getByTestId("agentic-chat-rail").className).toContain("hidden");
expect(cellClass("Kai")).not.toContain("hidden");
@@ -2751,7 +2763,7 @@ describe("chat view", () => {
await waitFor(() =>
expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith({
workspaceId: "ide_test",
- chatView: false,
+ view: "grid",
onScreen: true,
terminal: null,
promptTarget: "Mika",
@@ -2764,18 +2776,18 @@ describe("chat view", () => {
await waitFor(() =>
expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith({
workspaceId: "ide_test",
- chatView: true,
+ view: "chat",
onScreen: true,
terminal: "Aria",
promptTarget: "Aria",
}),
);
- toChat();
+ toGrid();
await waitFor(() =>
expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith({
workspaceId: "ide_test",
- chatView: false,
+ view: "grid",
onScreen: true,
terminal: null,
promptTarget: "Aria",
@@ -2783,6 +2795,45 @@ describe("chat view", () => {
);
});
+ /*
+ * The view travels to the backend by NAME, and the backend acts on more than
+ * deixis with it: the Command Deck is the only surface allowed to speak a
+ * finished pane out loud. A wrong name here is a wrong answer about whether
+ * Jarvis talks, which is why this is pinned separately from the pane above.
+ */
+ it("tells the backend which of the three modes is on screen", async () => {
+ renderGrid(FOUR);
+
+ fireEvent.click(screen.getByTestId("agentic-view-mode-deck"));
+
+ await waitFor(() =>
+ expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith(
+ expect.objectContaining({ view: "deck", onScreen: true }),
+ ),
+ );
+ });
+
+ it("reports the grid while the section is off screen, whatever it shows", async () => {
+ // The deck speaks; a deck nobody is looking at must not. This grid stays
+ // mounted behind another section, so "on screen" is the only thing that
+ // can stop it — see the matching backend test.
+ const { rerender } = renderGrid(FOUR);
+ fireEvent.click(screen.getByTestId("agentic-view-mode-deck"));
+ await waitFor(() =>
+ expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith(
+ expect.objectContaining({ view: "deck" }),
+ ),
+ );
+
+ rerender({ onScreen: false });
+
+ await waitFor(() =>
+ expect(api.syncAgenticIdeSurface).toHaveBeenLastCalledWith(
+ expect.objectContaining({ onScreen: false, terminal: null }),
+ ),
+ );
+ });
+
it("remembers the chosen view for the next workspace", () => {
renderGrid(FOUR);
toChat();
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index 679086ba19..3b59ff12b7 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -270,6 +270,41 @@ const TOOLBAR_BTN =
/** The same button, switched ON — the only yellow the toolbar spends. */
const TOOLBAR_BTN_ON = "bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary";
+/**
+ * The reading-mode switch, one entry per view.
+ *
+ * A table rather than three hand-written buttons because the set is a contract
+ * (see `WorkspaceView`): a fourth mode should be one row here, and a mode with
+ * no row is a mode the user cannot reach — which is the failure this shape
+ * makes obvious instead of silent.
+ */
+const VIEW_BUTTONS: ReadonlyArray<{
+ view: WorkspaceView;
+ testId: string;
+ icon: LucideIcon;
+ title: string;
+}> = [
+ {
+ view: "grid",
+ testId: "agentic-view-mode-grid",
+ icon: LayoutGrid,
+ title: "Terminal grid — every pane on screen at once.",
+ },
+ {
+ view: "chat",
+ testId: "agentic-view-mode-toggle",
+ icon: MessagesSquare,
+ title: "Chat view — read one agent at a time, like a conversation.",
+ },
+ {
+ view: "deck",
+ testId: "agentic-view-mode-deck",
+ icon: AudioLines,
+ title:
+ "Command Deck — brief the agents by voice and hear back when one is done.",
+ },
+];
+
/**
* The part of the hovered pane a drop would take, drawn as it will look.
*
@@ -488,22 +523,37 @@ const APPEARANCE_KEY = "jarvis.agenticIde.terminalAppearance";
const FONT_KEY = "jarvis.agenticIde.terminalFontSize";
/**
- * The two ways of looking at one workspace.
+ * The three ways of looking at one workspace.
*
* `grid` is the wall of terminals — every pane visible at once, sized by the
* dragged seams. `chat` is the same workspace read like a conversation: a rail
* of agents on the left, ONE terminal on a calm centred stage, and the prompt
- * bar underneath as the composer. Neither mode owns the panes — switching is a
- * pure restyle of the same mounted elements, because unmounting a pane kills
- * the coding agent behind it (see the grid container's comment below).
+ * bar underneath as the composer. `deck` is the Command Deck: the orb is the
+ * subject of the screen, each agent is a card, and Jarvis briefs them and
+ * reports their finished work back out loud.
+ *
+ * No mode owns the panes — switching is a pure restyle of the same mounted
+ * elements, because unmounting a pane kills the coding agent behind it (see
+ * the grid container's comment below). That rule is what makes a third mode
+ * cheap to add and is the one thing a fourth must not break.
+ *
+ * Layer 4 of the enum contract; `jarvis/agentic_ide/workspace_view.py` is the
+ * source of truth and the backend asserts the two agree at import.
*/
-export type WorkspaceView = "grid" | "chat";
+export type WorkspaceView = "grid" | "chat" | "deck";
+
+/** Every value, in the order the toolbar and the wizard offer them. */
+export const WORKSPACE_VIEWS: readonly WorkspaceView[] = ["grid", "chat", "deck"];
+
+function isWorkspaceView(raw: string): raw is WorkspaceView {
+ return (WORKSPACE_VIEWS as readonly string[]).includes(raw);
+}
const VIEW_KEY = "jarvis.agenticIde.workspaceView";
const CHAT_ORDER_KEY_PREFIX = "jarvis.agenticIde.chatOrder.v1";
export function storedViewMode(): WorkspaceView | null {
- return readStored(VIEW_KEY, (raw) => (raw === "grid" || raw === "chat" ? raw : null));
+ return readStored(VIEW_KEY, (raw) => (isWorkspaceView(raw) ? raw : null));
}
/**
@@ -1491,21 +1541,28 @@ export function AgenticGrid({
return names[0] ?? null;
}, [arrivingChatPane, chatPane, target, session.terminals]);
- // The browser is the only layer that knows which pane fills the one-pane
- // chat stage. Hand that fact to the backend so voice and chat can resolve
- // "this terminal" from what the user actually sees. Grid view clears the
- // context rather than guessing among several visible panes.
+ /*
+ * The browser is the only layer that knows what is actually on screen. Hand
+ * that fact to the backend so voice and chat can resolve "this terminal"
+ * from what the user sees, and so the deck knows it may speak.
+ *
+ * `stagedPane` is the ONE pane the view puts in front of the user: chat's
+ * stage, or the deck card the user unfolded to read. Grid has no such pane
+ * and reports none — guessing among a dozen visible terminals would be less
+ * honest than making the user name one.
+ */
+ const stagedPane = chatView ? chatSelected : null;
useEffect(() => {
void syncAgenticIdeSurface({
workspaceId: session.id,
- chatView,
+ view: viewMode,
onScreen,
- terminal: chatView && onScreen ? chatSelected : null,
+ terminal: onScreen ? stagedPane : null,
promptTarget: onScreen ? target || null : null,
}).catch((error) => {
console.warn("Agentic IDE: could not sync the visible terminal:", error);
});
- }, [chatSelected, chatView, onScreen, session.id, target]);
+ }, [onScreen, session.id, stagedPane, target, viewMode]);
/** Rail click: show the pane, and aim the composer at it when it can listen. */
const selectChatPane = useCallback((name: string, promptable: boolean) => {
@@ -2134,33 +2191,39 @@ export function AgenticGrid({
<Brain className="h-4 w-4 shrink-0" />
</button>
- {/* Grid or chat — how the same agents are read. The chat side opens
- the composer with it: a conversation surface without an input box
- is a screenshot, not a chat. */}
- <button
- type="button"
- data-testid="agentic-view-mode-toggle"
- aria-pressed={chatView}
- onClick={() => {
- const next: WorkspaceView = chatView ? "grid" : "chat";
- setViewMode(next);
- if (next === "chat" && composerCollapsed) {
- resizeComposer(COMPOSER_DEFAULT_PX);
- }
- }}
- title={
- chatView
- ? "Chat view is on — one agent at a time, like a conversation. Click for the terminal grid."
- : "Switch to chat view — read one agent at a time, like a conversation."
- }
- className={cn(TOOLBAR_BTN, chatView && TOOLBAR_BTN_ON)}
- >
- {chatView ? (
- <LayoutGrid className="h-4 w-4 shrink-0" />
- ) : (
- <MessagesSquare className="h-4 w-4 shrink-0" />
- )}
- </button>
+ {/* Grid, chat or deck — how the same agents are read.
+
+ Three buttons rather than one cycling through three states: past
+ two, "click again" stops telling you where you will land, and this
+ control now reaches a mode that changes the assistant's behaviour
+ rather than only the layout. They are three ordinary toolbar
+ glyphs, not a segmented group in a box — the row's rule is one
+ button shape throughout, with colour reserved for what is ON.
+
+ `agentic-view-mode-toggle` stays on the chat button: it is the one
+ this control used to be, and the tests that press it are about
+ chat view rather than about the switch. */}
+ {VIEW_BUTTONS.map(({ view, testId, icon: Icon, title }) => (
+ <button
+ key={view}
+ type="button"
+ data-testid={testId}
+ aria-pressed={viewMode === view}
+ onClick={() => {
+ setViewMode(view);
+ // A conversation surface with no input box is a screenshot, so
+ // both talking modes bring the composer with them. The deck is
+ // voice-first but must stay usable with the mic muted.
+ if (view !== "grid" && composerCollapsed) {
+ resizeComposer(COMPOSER_DEFAULT_PX);
+ }
+ }}
+ title={title}
+ className={cn(TOOLBAR_BTN, viewMode === view && TOOLBAR_BTN_ON)}
+ >
+ <Icon className="h-4 w-4 shrink-0" />
+ </button>
+ ))}
{/* Even out the sizes. Beside the grid/chat toggle because both are
about the SHAPE of the workspace rather than what is in it, and
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
index 99e48e293f..a945b1cbb0 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
@@ -11,6 +11,7 @@ import { useEffect, useMemo, useState, type ReactNode } from "react";
import {
ArrowLeft,
ArrowRight,
+ AudioLines,
LayoutGrid,
Loader2,
MessagesSquare,
@@ -454,19 +455,25 @@ function StepNavigation({
);
}
-/** The user-facing names of the two reading modes, shared by every step. */
+/** The user-facing names of the three reading modes, shared by every step. */
const VIEW_NAMES: Record<WorkspaceView, string> = {
grid: "Terminal grid",
chat: "Chat view",
+ deck: "Command Deck",
};
/**
* The last decision before review: how the workspace is read.
*
- * Two ways of looking at the SAME panes (see WorkspaceView in AgenticGrid) —
+ * Three ways of looking at the SAME panes (see WorkspaceView in AgenticGrid) —
* the grid shows every terminal at once, chat puts one agent on a stage like a
- * conversation. A choice of presentation, not of substance, which is why the
- * step needs no gate: both answers are always valid and one is preselected.
+ * conversation, and the deck hands the floor to Jarvis. A choice of
+ * presentation, not of substance, which is why the step needs no gate: every
+ * answer is valid and one is preselected.
+ *
+ * The deck's card says what it DOES differently rather than what it looks
+ * like, because it is the one option that changes the assistant's behaviour:
+ * pick it and Jarvis starts speaking finished work back to you.
*/
function ViewChoice({
view,
@@ -481,7 +488,7 @@ function ViewChoice({
<div
role="radiogroup"
aria-label="How the workspace opens"
- className="mt-4 grid gap-4 sm:grid-cols-2"
+ className="mt-4 grid gap-4 sm:grid-cols-3"
>
<ViewOption
selected={view === "grid"}
@@ -501,11 +508,21 @@ function ViewChoice({
description="One agent at a time on a calm stage, the rest on a rail — read like a conversation."
preview={<ChatPreview />}
/>
+ <ViewOption
+ selected={view === "deck"}
+ onSelect={() => onView("deck")}
+ testId="view-choice-deck"
+ icon={<AudioLines className="h-4 w-4 shrink-0" />}
+ title={VIEW_NAMES.deck}
+ description="You brief by voice, Jarvis runs the floor — and tells you when an agent is done."
+ preview={<DeckPreview />}
+ />
</div>
<p className="mt-5 max-w-2xl text-xs leading-relaxed text-muted-foreground">
Only how the workspace is read changes — the agents, panes and
- conversations are the same either way, and the workspace toolbar
- switches between the two whenever you like.
+ conversations are the same in all three, and the workspace toolbar
+ switches between them whenever you like. The Command Deck also speaks:
+ it reports a finished agent out loud, one at a time.
</p>
</div>
);
@@ -564,7 +581,7 @@ function ViewOption({
);
}
-/* Miniatures of the two modes, drawn with rules like the rest of the wizard. */
+/* Miniatures of the three modes, drawn with rules like the rest of the wizard. */
function GridPreview() {
return (
@@ -598,6 +615,35 @@ function ChatPreview() {
);
}
+/*
+ * The deck miniature is the odd one out on purpose.
+ *
+ * The other two draw their layout, because their layout IS the difference. The
+ * deck's difference is that the conversation is at the centre and the
+ * terminals have receded to cards around it — so it draws a ring with the
+ * agents arranged about it, which is the one glance that distinguishes it from
+ * "chat view with bigger panes".
+ */
+function DeckPreview() {
+ return (
+ <span aria-hidden className="flex h-[4.875rem] items-center justify-center gap-2">
+ <span className="flex flex-col gap-1.5">
+ {[0, 1].map((i) => (
+ <span key={i} className="block h-6 w-8 border border-border/70 bg-muted/20" />
+ ))}
+ </span>
+ <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full border border-primary/60 bg-primary/10">
+ <span className="block h-4 w-4 rounded-full border border-primary/70 bg-primary/25" />
+ </span>
+ <span className="flex flex-col gap-1.5">
+ {[0, 1].map((i) => (
+ <span key={i} className="block h-6 w-8 border border-border/70 bg-muted/20" />
+ ))}
+ </span>
+ </span>
+ );
+}
+
function WorkspaceReview({
folder,
planned,
diff --git a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
index d9fa393891..45ef7200cd 100644
--- a/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
+++ b/jarvis/ui/web/frontend/src/lib/agenticIdeApi.ts
@@ -1209,15 +1209,21 @@ export async function setFocusMode(enabled: boolean): Promise<boolean> {
}
/**
- * Tell the backend which pane is visible and which one owns the next prompt.
+ * Tell the backend which view is on screen, which pane it stages, and which
+ * one owns the next prompt.
*
* Ephemeral by design: this is grounding for "this terminal", not a display
* preference. Grid view has no single visible terminal, but its selected prompt
* chip remains an explicit target for the prompt bar, voice orb, and file drops.
+ *
+ * The view travels as a NAME rather than the `chat_view` boolean it replaced:
+ * there are three of them now, and the backend reads this to decide more than
+ * deixis — the Command Deck is the one surface allowed to speak a finished pane
+ * out loud, so a wrong answer here is a wrong answer about whether Jarvis talks.
*/
export async function syncAgenticIdeSurface(payload: {
workspaceId: string;
- chatView: boolean;
+ view: "grid" | "chat" | "deck";
onScreen: boolean;
terminal: string | null;
promptTarget: string | null;
@@ -1228,7 +1234,7 @@ export async function syncAgenticIdeSurface(payload: {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
workspace_id: payload.workspaceId,
- chat_view: payload.chatView,
+ view: payload.view,
on_screen: payload.onScreen,
terminal: payload.terminal,
prompt_target: payload.promptTarget,
diff --git a/tests/unit/agentic_ide/test_context.py b/tests/unit/agentic_ide/test_context.py
index 1e99db814b..983e90245d 100644
--- a/tests/unit/agentic_ide/test_context.py
+++ b/tests/unit/agentic_ide/test_context.py
@@ -74,7 +74,7 @@ async def test_focus_context_names_the_one_terminal_visible_in_chat_view(
registry.set_focus_mode(True)
assert registry.set_surface_context(
workspace_id=session.id,
- chat_view=True,
+ view="chat",
on_screen=True,
terminal="T2",
)
diff --git a/tests/unit/agentic_ide/test_prompt_attachment_staging.py b/tests/unit/agentic_ide/test_prompt_attachment_staging.py
index cb7d296d67..14c91a710d 100644
--- a/tests/unit/agentic_ide/test_prompt_attachment_staging.py
+++ b/tests/unit/agentic_ide/test_prompt_attachment_staging.py
@@ -24,7 +24,7 @@ async def test_bar_drop_is_copied_analysed_and_queued_for_prompt_target(
session = await registry.start(str(tmp_path), [{"agent": "claude"}, {"agent": "codex"}])
registry.set_surface_context(
workspace_id=session.id,
- chat_view=False,
+ view="grid",
on_screen=True,
terminal=None,
prompt_target="T2",
diff --git a/tests/unit/agentic_ide/test_surface_context_route.py b/tests/unit/agentic_ide/test_surface_context_route.py
index db095e406a..8b25f2327a 100644
--- a/tests/unit/agentic_ide/test_surface_context_route.py
+++ b/tests/unit/agentic_ide/test_surface_context_route.py
@@ -125,3 +125,152 @@ async def test_stale_workspace_cannot_replace_the_active_surface(
assert response.json()["accepted"] is False
assert second.contextual_terminal() is None
+
+
+# --------------------------------------------------------------- named views
+#
+# The boolean above became a three-value enum when the Command Deck arrived.
+# Both spellings are served: `view` is the contract, `chat_view` is what a
+# desktop WebView still holding the pre-deck bundle posts for the seconds
+# before it reloads itself.
+
+
+def test_the_pydantic_literal_still_matches_the_source_of_truth() -> None:
+ """Layer 3 against layer 0 — the drift BUG-008 is a repeat of.
+
+ The route's ``Literal`` has to spell the values a second time (Pydantic
+ cannot take a tuple), and this is the assertion that makes the duplication
+ safe. It also runs at import; the test states it out loud so a failure
+ reads as "the enum drifted" rather than as a collection error.
+ """
+ from typing import get_args
+
+ from jarvis.agentic_ide.workspace_view import WORKSPACE_VIEWS
+
+ assert set(get_args(agentic_ide_routes.WorkspaceViewName)) == set(WORKSPACE_VIEWS)
+
+
+async def test_the_deck_stages_one_pane_like_chat_does(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ """An unfolded deck card is a visible single pane, so "this one" resolves."""
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}, {"agent": "codex"}])
+
+ response = client.put(
+ "/api/agentic-ide/surface-context",
+ json={
+ "workspace_id": session.id,
+ "view": "deck",
+ "on_screen": True,
+ "terminal": "T2",
+ "prompt_target": "T2",
+ },
+ )
+
+ assert response.status_code == 200
+ assert session.surface_view == "deck"
+ assert session.contextual_terminal() is session.find("T2")
+
+
+async def test_a_named_grid_view_clears_the_staged_pane(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}])
+ body = {
+ "workspace_id": session.id,
+ "view": "deck",
+ "on_screen": True,
+ "terminal": "T1",
+ }
+ client.put("/api/agentic-ide/surface-context", json=body)
+
+ client.put("/api/agentic-ide/surface-context", json={**body, "view": "grid"})
+
+ assert session.surface_view == "grid"
+ assert session.contextual_terminal() is None
+
+
+async def test_a_hidden_section_reports_the_grid_however_it_was_left(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ """The deck speaks; a deck nobody is looking at must not.
+
+ Navigating to another section leaves this grid mounted behind it, so
+ without this the workspace would still be filed as "deck on screen" and
+ would go on reporting finished panes out loud from behind whatever the
+ user actually switched to.
+ """
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}])
+ body = {
+ "workspace_id": session.id,
+ "view": "deck",
+ "on_screen": True,
+ "terminal": "T1",
+ }
+ client.put("/api/agentic-ide/surface-context", json=body)
+ assert session.surface_view == "deck"
+
+ client.put("/api/agentic-ide/surface-context", json={**body, "on_screen": False})
+
+ assert session.surface_view == "grid"
+ assert session.contextual_terminal() is None
+
+
+async def test_a_pre_deck_bundle_is_still_understood(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ """`chat_view` with no `view` is an old window, not a malformed request."""
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}, {"agent": "codex"}])
+
+ client.put(
+ "/api/agentic-ide/surface-context",
+ json={
+ "workspace_id": session.id,
+ "chat_view": True,
+ "on_screen": True,
+ "terminal": "T2",
+ },
+ )
+
+ assert session.surface_view == "chat"
+ assert session.contextual_terminal() is session.find("T2")
+
+
+async def test_a_body_naming_no_view_at_all_reports_the_grid(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ """The view that promises the least is what an unclear answer falls to."""
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}])
+
+ response = client.put(
+ "/api/agentic-ide/surface-context",
+ json={"workspace_id": session.id, "on_screen": True, "terminal": "T1"},
+ )
+
+ assert response.status_code == 200
+ assert session.surface_view == "grid"
+ assert session.contextual_terminal() is None
+
+
+async def test_an_unknown_view_is_refused_rather_than_guessed(
+ client: TestClient, registry: Registry, tmp_path: Path
+) -> None:
+ """A view nobody defined is a bug in the caller, and says so at the door.
+
+ Deliberately a 422 rather than a quiet fall back to the grid: this body
+ comes from our own frontend, and a silent coercion here is exactly how the
+ two layers drift apart without anyone noticing.
+ """
+ session = await registry.start(str(tmp_path), [{"agent": "claude"}])
+
+ response = client.put(
+ "/api/agentic-ide/surface-context",
+ json={
+ "workspace_id": session.id,
+ "view": "cockpit",
+ "on_screen": True,
+ "terminal": "T1",
+ },
+ )
+
+ assert response.status_code == 422
diff --git a/tests/unit/brain/test_agentic_ide_handoff_silence.py b/tests/unit/brain/test_agentic_ide_handoff_silence.py
index a3e3665be8..377bad6153 100644
--- a/tests/unit/brain/test_agentic_ide_handoff_silence.py
+++ b/tests/unit/brain/test_agentic_ide_handoff_silence.py
@@ -273,7 +273,7 @@ async def test_the_visible_chat_terminal_beats_a_stale_conversation_target(
assert registry.session is not None
registry.set_surface_context(
workspace_id=registry.session.id,
- chat_view=True,
+ view="chat",
on_screen=True,
terminal="T4",
)