AI media harness for planning, generating, and editing locally
TypeScript
Agent pane: title-free toolbar, shared empty state, faint placeholder
Bittiaf04b31e2b45
diff --git a/src/components/workspace/AgentDock.test.tsx b/src/components/workspace/AgentDock.test.tsxindex a91105e..cafe1b2 100644--- a/src/components/workspace/AgentDock.test.tsx+++ b/src/components/workspace/AgentDock.test.tsx@@ -73,7 +73,7 @@ describe("Slop output panel", () => {} finally { spy.mockRestore(); }});- it("is a docked pane with a header, a provider picker and a one-line empty state", async () => {+ it("is a docked pane with a toolbar, a provider picker and the shared empty state", async () => {const available: ProviderStatus[] = [providers[0],{ id: "claude", label: "Claude Code", state: "ready", executable: "claude", version: "test", detail: "Ready" },@@ -82,9 +82,11 @@ describe("Slop output panel", () => {render(<AgentDock context="this project" record={project()} providers={available} onPromptStart={() => undefined} onCommands={async () => undefined} onClose={onClose} />);await act(async () => { await Promise.resolve(); });- expect(screen.getByRole("heading", { name: "Agent" })).toBeInTheDocument();- expect(screen.queryByRole("heading", { name: "What should we create today?" })).not.toBeInTheDocument();- expect(screen.getByRole("log", { name: "Slop output" })).toHaveTextContent("Ask Slop to write scenes");+ // A pane toolbar, not a title bar: the workspace's aside names the pane.+ expect(screen.queryByRole("heading")).not.toBeInTheDocument();+ const log = screen.getByRole("log", { name: "Slop output" });+ expect(log.querySelector(".ui-empty-state .ui-empty-state__title")).toHaveTextContent("Nothing asked yet");+ expect(log).toHaveTextContent("Ask Slop to write scenes");expect(screen.getByRole("img", { name: "Codex status: Ready" })).toBeInTheDocument();const selector = screen.getByRole("combobox", { name: "Agent provider" });fireEvent.click(selector);diff --git a/src/components/workspace/AgentDock.tsx b/src/components/workspace/AgentDock.tsxindex 9efa8c0..f4f55f6 100644--- a/src/components/workspace/AgentDock.tsx+++ b/src/components/workspace/AgentDock.tsx@@ -1,5 +1,5 @@import { listen } from "@tauri-apps/api/event";-import { ArrowUp, Eraser, Square, X } from "lucide-react";+import { ArrowUp, Bot, Eraser, Square, X } from "lucide-react";import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";import { describeDiagnosticError, errorContext, writeDiagnostic } from "../../lib/diagnostics";import { isTauri } from "../../lib/persistence";@@ -16,7 +16,7 @@ import {import { loadAgentProvider, saveAgentProvider } from "../../lib/settings";import type { ProjectRecord } from "../../lib/project";import type { AgentMessage } from "../../lib/project";-import { ComboBox, PaneHeader, ProgressRing, tooltipProps } from "../ui";+import { ComboBox, EmptyState, PaneHeader, ProgressRing, tooltipProps } from "../ui";/** How tall the prompt box grows before it scrolls. */export const COMPOSER_MAX_LINES = 6;@@ -26,8 +26,9 @@ interface AgentActivity {text: string;}-/** The agent as a docked tool pane: a 32px header (title, provider, clear,- * close), the conversation, and a flush text box with a send button.+/** The agent as a docked tool pane: a 36px pane toolbar (the provider picker+ * leading, clear and close trailing — no title, the workspace's aside already+ * names the pane), the conversation, and a flush text box with a send button.** The pane container — its placement, splitter and show/hide — belongs to the* workspace. `onClose` wires the header's close button to it; without it the@@ -182,9 +183,8 @@ export function AgentDock({ context, record, providers, onPromptStart, onCommand}}><PaneHeader- title="Agent"className="agent-dock__header"- actions={<>+ views={<><span className={`agent-provider-light agent-provider--${selected?.state ?? "unknown"}`} role="img" aria-label={providerStatusLabel} data-tooltip={blockedDetail ?? providerStatusLabel}><i /></span><ComboBoxclassName="agent-provider"@@ -200,12 +200,19 @@ export function AgentDock({ context, record, providers, onPromptStart, onCommand}))}onChange={(next) => { setProvider(next as ProviderId); saveAgentProvider(next as ProviderId); }}/>+ </>}+ actions={<><button type="button" className="icon-button agent-dock__action" aria-label="Clear conversation" {...tooltipProps("Clear conversation")} disabled={Boolean(requestId) || empty} onClick={clear}><Eraser size={16} aria-hidden="true" /></button>{onClose && <button type="button" className="icon-button agent-dock__action" aria-label="Close agent" {...tooltipProps("Close")} onClick={onClose}><X size={16} aria-hidden="true" /></button>}</>}/><div ref={conversation} className="agent-conversation" role="log" aria-label="Slop output" aria-live="polite">- {empty && <p className="agent-conversation__empty">Ask Slop to write scenes from a prompt, refine shots or edit {context}.</p>}+ {empty && <EmptyState+ className="agent-conversation__empty"+ icon={<Bot size={32} />}+ title="Nothing asked yet"+ description={`Ask Slop to write scenes from a prompt, refine shots or edit ${context}.`}+ />}{messages.map((message) => <p key={message.id} className={`agent-conversation__${message.role}`}><b>{message.role === "user" ? "You" : "Slop"}</b><span>{message.content}</span></p>)}{pendingPrompt && <p className="agent-conversation__pending"><b>You</b><span>{pendingPrompt}</span></p>}{activity.map((item, index) => <p key={`${item.kind}-${index}`} className={`agent-conversation__${item.kind}`}>diff --git a/src/styles/agent-dock.css b/src/styles/agent-dock.cssindex 9e404f1..7660007 100644--- a/src/styles/agent-dock.css+++ b/src/styles/agent-dock.css@@ -1,7 +1,7 @@/* ============================================================================- agent-dock.css — the agent as a docked tool pane: a 32px pane header- (title, provider status and ComboBox, clear, close), the conversation, and a- flush text box with a send button. No glass, shadow, glow or halo: it is a+ agent-dock.css — the agent as a docked tool pane: a 36px pane toolbar+ (provider status and ComboBox leading, clear and close trailing; no title),+ the conversation, and a flush text box with a send button. No glass, shadow, glow or halo: it is apane like the inspectors, sitting on the same layer. The pane container(placement, splitter, show/hide) is the workspace's (.project-agent-pane).========================================================================== */@@ -12,19 +12,16 @@min-height: 0;display: flex;flex-direction: column;- background: var(--layer);+ background: var(--surface-pane);}.agent-dock__header {flex: 0 0 auto;- border-bottom: 1px solid var(--line);}-.agent-dock__header .ui-pane-header__actions {- min-width: 0;- display: flex;- align-items: center;- gap: 2px;+/* The picker gives way before the clear and close buttons do. */+.agent-dock__header .ui-pane-header__views {+ flex: 0 1 auto;}.agent-dock__action.icon-button {@@ -32,14 +29,13 @@height: var(--control-sm);}-/* A compact provider picker in the header. */+/* A compact provider picker leading the toolbar, after its status light. */.ui-combo.agent-provider {min-width: 0;width: auto;- max-width: 160px;+ max-width: 200px;height: var(--control-sm);min-height: var(--control-sm);- margin-left: var(--space-1);font-size: var(--text-xs);}@@ -87,7 +83,8 @@padding: var(--space-2) var(--space-3);}-.agent-conversation p {+/* Direct children only: the empty state's own paragraphs keep its styles. */+.agent-conversation > p {display: flex;flex-direction: column;gap: 2px;@@ -97,14 +94,14 @@line-height: var(--leading-normal);}-.agent-conversation p > span {+.agent-conversation > p > span {min-width: 0;white-space: pre-wrap;overflow-wrap: anywhere;}/* Speaker labels: 12px semibold, sentence case, secondary ink. */-.agent-conversation b {+.agent-conversation > p > b {color: var(--text-secondary);font-size: var(--text-xs);font-weight: var(--weight-semibold);@@ -124,11 +121,6 @@color: var(--danger);}-.agent-conversation p.agent-conversation__empty {- color: var(--text-muted);- font-size: var(--text-xs);-}-.agent-conversation__thinking {display: inline-flex;align-items: center;@@ -164,7 +156,7 @@}.agent-composer__field::placeholder {- color: var(--text-muted);+ color: var(--text-faint);}.agent-composer__send {