Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Tighten native workspace chrome

Rach92960d096054
diff --git a/apps/native/components/primitives/SidebarNav.tsx b/apps/native/components/primitives/SidebarNav.tsx
index d08efd4b..e4531af6 100644
--- a/apps/native/components/primitives/SidebarNav.tsx
+++ b/apps/native/components/primitives/SidebarNav.tsx
@@ -11,7 +11,6 @@ import {
IconGlobe,
IconHome,
IconMagnifyingGlass,
- IconChat,
IconPlusMedium,
IconSettingsGear1,
IconSidebarLeftArrow,
@@ -35,7 +34,6 @@ const NAV_ITEMS: { key: string; label: string; icon: ReactNode; count?: string }
{ key: "home", label: "Home", icon: <IconHome size={18} /> },
{ key: "projects", label: "Projects", icon: <IconFolder size={18} /> },
{ key: "agents", label: "Agents", icon: <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" aria-hidden><circle cx="9" cy="8" r="3"/><circle cx="16" cy="9" r="2.4"/><path d="M4 19c.5-2.6 2.6-4.5 5-4.5s4.5 1.9 5 4.5M13.5 19c.4-1.7 1.8-3 3.5-3s3.1 1.3 3.5 3"/></svg> },
- { key: "conversations", label: "Conversations", icon: <IconChat size={18} /> },
{ key: "workspace", label: "Files", icon: <IconFolder size={18} /> },
{ key: "changes", label: "Changes", icon: <IconEditBig size={18} /> },
{ key: "browser", label: "Browser", icon: <IconGlobe size={18} /> },
@@ -84,6 +82,7 @@ type SidebarNavProps = {
/** How many saved sessions exist (sidebar only shows a preview). */
recentsTotal?: number;
onSeeAll?: () => void;
+ agentsCount?: number;
variant?: string;
/** The active workspace (the folder graff runs in); the demo shows a placeholder. */
workspace?: SidebarWorkspace;
@@ -198,6 +197,7 @@ export default function SidebarNav({
onDeleteRecent,
recentsTotal,
onSeeAll,
+ agentsCount = 0,
}: SidebarNavProps) {
const [collapsed, setCollapsed] = useState(false);
useEffect(() => { onCollapsedChange?.(collapsed); }, [collapsed, onCollapsedChange]);
@@ -269,7 +269,7 @@ export default function SidebarNav({
} as CSSProperties}
>
<div className="flex min-h-0 w-[248px] shrink-0 flex-col">
- <div className="relative mb-2.5 h-10 shrink-0">
+ <div className="relative mb-2.5 flex h-10 shrink-0 items-center gap-1 px-2">
<button
ref={workspaceButtonRef}
data-workspace-trigger
@@ -284,7 +284,7 @@ export default function SidebarNav({
}
setWorkspaceOpen((open) => !open);
}}
- className="sidebar-workspace-control absolute left-2 top-1 flex h-8 w-[188px] items-center rounded-[8px] px-2 text-left transition-[background-color,transform] duration-100 hover:bg-hover-2 active:scale-[0.99]"
+ className="sidebar-workspace-control flex h-8 min-w-0 flex-1 items-center rounded-[8px] px-2 text-left transition-[background-color,transform] duration-100 hover:bg-hover-2 active:scale-[0.99]"
>
<span className="sidebar-logo flex size-5 shrink-0 items-center justify-center text-ink">
<CodeGraffMark size={20} />
@@ -316,7 +316,7 @@ export default function SidebarNav({
aria-hidden={collapsed}
tabIndex={collapsed ? -1 : 0}
onClick={collapse}
- className="sidebar-collapse-control absolute right-2 top-1 flex size-8 items-center justify-center rounded-[8px] text-ink-3 transition-[opacity,background-color,color] duration-150 hover:bg-hover-2 hover:text-ink"
+ className="sidebar-collapse-control flex size-8 shrink-0 items-center justify-center rounded-[8px] text-ink-3 transition-[opacity,background-color,color] duration-150 hover:bg-hover-2 hover:text-ink"
>
<IconSidebarLeftArrow size={18} />
</button>
@@ -327,7 +327,7 @@ export default function SidebarNav({
aria-hidden={!collapsed}
tabIndex={collapsed ? 0 : -1}
onClick={() => { setCollapsed(false); requestAnimationFrame(() => collapseButtonRef.current?.focus()); }}
- className="sidebar-expand-control absolute left-2 top-0.5 flex size-9 items-center justify-center rounded-[8px] text-ink-3 transition-[opacity,background-color,color] duration-150 hover:bg-hover-2 hover:text-ink"
+ className="sidebar-expand-control absolute left-2 top-0.5 z-10 flex size-9 items-center justify-center rounded-[8px] text-ink-3 transition-[opacity,background-color,color] duration-150 hover:bg-hover-2 hover:text-ink"
>
<IconSidebarLeftOpen size={18} />
</button>
@@ -349,7 +349,7 @@ export default function SidebarNav({
key={item.key}
icon={item.icon}
label={item.label}
- count={item.key === "conversations" && recentsTotal ? String(recentsTotal) : item.count}
+ count={item.key === "agents" && agentsCount > 0 ? String(agentsCount) : item.count}
active={currentNav === item.key}
onClick={() => selectNav(item.key)}
/>
@@ -373,7 +373,7 @@ export default function SidebarNav({
<span className={`flex transition-transform duration-150 ${chatsOpen ? "" : "-rotate-90"}`}>
<IconChevronDownSmall size={16} />
</span>
- <span>{openSessions ? "History" : "Chats"}</span>
+ <span>History</span>
{visibleRecents.length > 0 && <span className="tabular-nums text-ink-3">{visibleRecents.length}</span>}
</button>
diff --git a/apps/native/components/site/GraffHarness.tsx b/apps/native/components/site/GraffHarness.tsx
index d7d87ff3..83ba871e 100644
--- a/apps/native/components/site/GraffHarness.tsx
+++ b/apps/native/components/site/GraffHarness.tsx
@@ -492,6 +492,7 @@ export default function GraffHarness() {
fill
recents={recents.filter(recent => !chats.some(chat => chat.session === recent.id))}
recentsTotal={storedTotal}
+ agentsCount={workingAgents}
activeTitle={chatThread.title}
activeId={chatThread.session ?? null}
onPick={pickRecent}
diff --git a/apps/native/components/site/HarnessChrome.tsx b/apps/native/components/site/HarnessChrome.tsx
index 5289a4d6..092c0fe5 100644
--- a/apps/native/components/site/HarnessChrome.tsx
+++ b/apps/native/components/site/HarnessChrome.tsx
@@ -2,7 +2,6 @@ import SessionTabs from "./SessionTabs";
import type {SplitTree} from "@/lib/split-tree";
import ActionMenu from "@/components/primitives/ActionMenu";
import AppSettings from "./AppSettings";
-import WorkspacePaneMenu from "./WorkspacePaneMenu";
import type { PointerEvent, MouseEvent, ReactNode } from "react";
import type { Chat } from "./harness-types";
import reviewStyles from "./ChangesPane.module.css";
@@ -24,52 +23,56 @@ function paneBtn(pressed: boolean) {
return `h-7 shrink-0 rounded-[7px] px-2.5 text-[12.5px] font-medium ${pressed ? "bg-hover-2 text-ink" : "text-ink-2 hover:bg-hover"}`;
}
+function PaneGroup({ filesOpen, changesOpen, browserOpen, terminalVisible, pinCount, onFiles, openChanges, onBrowser, toggleTerminal, taskCount, tasksOpen, onTasks }: {
+ filesOpen: boolean; changesOpen: boolean; browserOpen: boolean; terminalVisible: boolean; pinCount: number;
+ onFiles(): void; openChanges(): void; onBrowser(): void; toggleTerminal(): void;
+ taskCount: number; tasksOpen: boolean; onTasks?: () => void;
+}) {
+ return <>
+ <button type="button" aria-label="Files" aria-pressed={filesOpen && !changesOpen} onClick={onFiles} className={paneBtn(filesOpen && !changesOpen)}>Files</button>
+ <button type="button" aria-label="Review workspace changes" aria-pressed={changesOpen} onClick={openChanges} className={paneBtn(changesOpen)}>Changes</button>
+ <button type="button" aria-label="Browser" aria-pressed={browserOpen} onClick={onBrowser} className={paneBtn(browserOpen)}>Browser{pinCount > 0 ? ` (${pinCount})` : ""}</button>
+ <button type="button" aria-label="Toggle terminal" aria-pressed={terminalVisible} onClick={toggleTerminal} className={paneBtn(terminalVisible)}>Terminal</button>
+ {(taskCount > 0 || tasksOpen) && onTasks && <button type="button" aria-label="Show tasks" aria-pressed={tasksOpen} onClick={onTasks} className={paneBtn(tasksOpen)}>Tasks{taskCount ? ` (${taskCount})` : ""}</button>}
+ </>;
+}
+
export default function HarnessChrome({navigationToggle, sidebarVisible = false, unreadIds, chats, activeId, busyIds, focusChat, closeChat, newChat,
conversationsOpen, openConversations, split, toggleSplit, filesOpen, onFiles, chatCwd,
workspaceName, onFolder, openChanges, changesOpen = false, browserOpen, onBrowser, pinCount, terminalVisible,
toggleTerminal, agentsOpen, onAgents, workingAgents = 0, tasksOpen = false, taskCount = 0, onTasks, splitNotice, onTabPointerDown, onTabClickCapture}: Props) {
+ const panes = <PaneGroup filesOpen={filesOpen} changesOpen={changesOpen} browserOpen={browserOpen} terminalVisible={terminalVisible} pinCount={pinCount} onFiles={onFiles} openChanges={openChanges} onBrowser={onBrowser} toggleTerminal={toggleTerminal} taskCount={taskCount} tasksOpen={tasksOpen} onTasks={onTasks} />;
+ const more = <ActionMenu label="Chat actions" text="More" className="shrink-0">
+ {!sidebarVisible && <button type="button" onClick={newChat}>New chat <span className="ml-auto text-ink-3">⌘T</span></button>}
+ <button type="button" aria-pressed={split} onClick={toggleSplit}>{split ? "Close splits" : "Split view"} <span className="ml-auto text-ink-3">⌘\</span></button>
+ <button type="button" aria-pressed={conversationsOpen} onClick={openConversations}>All conversations</button>
+ <button type="button" onClick={onFolder}>Open a folder…</button>
+ </ActionMenu>;
return (
<div data-workspace-toolbar className={`${reviewStyles.chatbar} flex shrink-0 flex-col ${sidebarVisible ? "overflow-visible bg-transparent" : "overflow-hidden rounded-[14px] border border-line bg-page"}`}>
- {/* One workspace-level tab strip above every split; never owned by a pane. */}
<div data-session-tab-strip hidden={sidebarVisible} className={sidebarVisible ? "hidden" : "flex h-10 min-w-0 shrink-0 items-center gap-1 px-2"}>
<div className="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
<button type="button" aria-label="Show agents" aria-pressed={agentsOpen} onClick={onAgents}
className={paneBtn(agentsOpen)}>Agents{workingAgents > 0 ? ` (${workingAgents})` : ""}</button>
<span aria-hidden="true" className="mx-1 h-4 w-px shrink-0 bg-line" />
- {!sidebarVisible && <SessionTabs chats={chats} activeId={activeId} busyIds={busyIds} unreadIds={unreadIds}
+ <SessionTabs chats={chats} activeId={activeId} busyIds={busyIds} unreadIds={unreadIds}
agentsOpen={agentsOpen} focusChat={focusChat} closeChat={closeChat}
- onTabPointerDown={onTabPointerDown} onTabClickCapture={onTabClickCapture} />}
- <button
- type="button"
- aria-label="New chat"
- title="New chat (⌘T)"
- onClick={newChat}
- className="ml-0.5 flex size-7 shrink-0 items-center justify-center rounded-[7px] text-ink-3 transition-colors duration-100 hover:bg-hover hover:text-ink"
- >
+ onTabPointerDown={onTabPointerDown} onTabClickCapture={onTabClickCapture} />
+ <button type="button" aria-label="New chat" title="New chat (⌘T)" onClick={newChat}
+ className="ml-0.5 flex size-7 shrink-0 items-center justify-center rounded-[7px] text-ink-3 transition-colors duration-100 hover:bg-hover hover:text-ink">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" aria-hidden>
<path d="M12 5v14M5 12h14" />
</svg>
</button>
</div>
- {!sidebarVisible && <WorkspacePaneMenu className="ml-1 shrink-0" filesOpen={filesOpen} changesOpen={changesOpen} browserOpen={browserOpen} terminalVisible={terminalVisible} pinCount={pinCount} onFiles={onFiles} openChanges={openChanges} onBrowser={onBrowser} toggleTerminal={toggleTerminal} />}
</div>
- <div className={`${reviewStyles.actions} flex min-h-10 shrink-0 items-center gap-1 ${sidebarVisible ? "justify-end px-1" : "border-t border-line px-2"} py-1`}>
+ <div className={`${reviewStyles.actions} flex shrink-0 items-center gap-1 ${sidebarVisible ? "justify-end" : "min-h-10 border-t border-line px-2 py-1"}`}>
{navigationToggle}
<button type="button" aria-pressed={filesOpen && !changesOpen} onClick={onFiles} title={`${chatCwd ?? "Workspace"}\nShow this chat's files`}
className={`max-w-48 truncate lg:hidden ${paneBtn(filesOpen && !changesOpen)}`}>{workspaceName}</button>
<div className={`flex items-center gap-1 ${sidebarVisible ? "rounded-[14px] border border-line bg-page px-2 py-0.5" : ""}`}>
- {sidebarVisible && <WorkspacePaneMenu filesOpen={filesOpen} changesOpen={changesOpen} browserOpen={browserOpen} terminalVisible={terminalVisible} pinCount={pinCount} onFiles={onFiles} openChanges={openChanges} onBrowser={onBrowser} toggleTerminal={toggleTerminal} />}
- <button type="button" aria-label="Files" aria-pressed={filesOpen && !changesOpen} onClick={onFiles} className={`hidden lg:inline-flex ${paneBtn(filesOpen && !changesOpen)}`}>Files</button>
- <button type="button" aria-label="Review workspace changes" aria-pressed={changesOpen} onClick={openChanges} className={paneBtn(changesOpen)}>Changes</button>
- <button type="button" aria-label="Browser" aria-pressed={browserOpen} onClick={onBrowser} className={paneBtn(browserOpen)}>Browser{pinCount > 0 ? ` (${pinCount})` : ""}</button>
- <button type="button" aria-label="Toggle terminal" aria-pressed={terminalVisible} onClick={toggleTerminal} className={paneBtn(terminalVisible)}>Terminal</button>
- {(taskCount > 0 || tasksOpen) && onTasks && <button type="button" aria-label="Show tasks" aria-pressed={tasksOpen} onClick={onTasks} className={paneBtn(tasksOpen)}>Tasks{taskCount ? ` (${taskCount})` : ""}</button>}
- <ActionMenu label="Chat actions" text="More" className="shrink-0">
- <button type="button" onClick={newChat}>New chat <span className="ml-auto text-ink-3">⌘T</span></button>
- <button type="button" aria-pressed={split} onClick={toggleSplit}>{split ? "Close splits" : "Split view"} <span className="ml-auto text-ink-3">⌘\</span></button>
- <button type="button" aria-pressed={conversationsOpen} onClick={openConversations}>All conversations</button>
- <button type="button" onClick={onFolder}>Open a folder…</button>
- </ActionMenu>
+ <div role="group" aria-label="Workspace panes" className="flex flex-wrap items-center gap-1">{panes}</div>
+ {more}
{!sidebarVisible && <AppSettings />}
<div data-desktop-update-slot className="shrink-0" />
</div>
diff --git a/apps/native/components/site/SessionTabs.tsx b/apps/native/components/site/SessionTabs.tsx
index ed7a1c23..81640a7f 100644
--- a/apps/native/components/site/SessionTabs.tsx
+++ b/apps/native/components/site/SessionTabs.tsx
@@ -47,10 +47,10 @@ export default function SessionTabs({ chats, activeId, busyIds, unreadIds, agent
onClick={() => {
focusChat(c.id);
}}
- title={c.title ?? (chats.length > 1 ? `Chat ${c.id}` : "Chat")}
+ title={c.title ?? (chats.length > 1 ? `Chat ${c.id}` : "Untitled")}
className="min-w-0 flex-1 text-left"
>
- <span className="block truncate">{c.title ?? (chats.length > 1 ? `Chat ${c.id}` : "Chat")}</span>
+ <span className="block truncate">{c.title ?? (chats.length > 1 ? `Chat ${c.id}` : "Untitled")}</span>
</button>
<button
type="button"