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): hand the app's actions to the header row the view already has

Ruben Lütkec0c352bc49f6
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
index 58c9957dcb..da352c8a14 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceBar.tsx
@@ -153,9 +153,23 @@ export function WorkspaceBar({
}
};
+ /*
+ * With nothing open there are no TABS — only the row that may carry actions.
+ *
+ * The distinction matters twice over. It is what the user sees: a tab strip
+ * offering "New workspace" above a wizard that IS the new workspace is a
+ * second button for the thing already on screen. And it is what the tests
+ * see: the tabs appear only once the workspace list has actually arrived, so
+ * nothing can be clicked or measured in the instant before the first fetch
+ * resolves — a bar that rendered its controls immediately handed those tests
+ * a "New workspace" button that was neither disabled nor still attached by
+ * the time the state landed.
+ */
+ const hasTabs = workspaces.length > 0;
+
// Nothing open, nothing to add to and no controls to carry: the wizard IS the
// screen, and an empty bar above it would be furniture.
- if (workspaces.length === 0 && !actions) return null;
+ if (!hasTabs && !actions) return null;
return (
<div
@@ -164,6 +178,8 @@ export function WorkspaceBar({
embedded ? "min-w-0 flex-1" : "border-b border-border px-2 py-1",
)}
>
+ {!hasTabs && <div className="min-w-0 flex-1" />}
+ {hasTabs && (
<div
data-testid="workspace-bar"
className="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-jarvis"
@@ -353,6 +369,7 @@ export function WorkspaceBar({
New workspace
</button>
</div>
+ )}
{actions && (
<div
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
index 979911c602..99efa7ebd6 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
@@ -41,6 +41,21 @@ vi.mock("@/views/ChatsView", () => ({
ViewHeader: ({ title }: { title: string }) => <header>{title}</header>,
}));
+/*
+ * The IDE carries the app's own Restart/Update actions in its header row, so
+ * this view now mounts the updater hook — which fetches `/api/update/status`
+ * the moment it appears. jsdom has no server behind that, so left real it is an
+ * unhandled request on every render in this file, and the button's visibility
+ * would depend on how that failure happened to land. "No update offered" is
+ * both the deterministic answer and the state of every dev tree.
+ */
+vi.mock("@/hooks/useUpdate", () => ({
+ useUpdate: () => ({
+ status: { managed: false, update_available: false },
+ refresh: vi.fn(),
+ }),
+}));
+
// xterm.js needs a real canvas, which jsdom has not got — stub the panes.
vi.mock("@/components/agentic/AgenticTerminal", () => ({
AgenticTerminal: ({ name }: { name: string }) => (
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
index c1724afcda..bcfbcbda36 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
@@ -43,6 +43,7 @@ import {
fetchAgentAccounts,
groupFor,
} from "@/lib/agentAccountsApi";
+import { TopBarActions } from "@/components/layout/TopBar";
import { FolderPicker } from "@/components/agentic/FolderPicker";
import { ResumeCard } from "@/components/agentic/ResumeCard";
import { WorkspaceBar } from "@/components/agentic/WorkspaceBar";
@@ -642,9 +643,18 @@ export function AgenticIdeView() {
? { ...workspace, terminals: session.terminals.length }
: workspace,
);
+ /*
+ * `actions` only in the standalone bar.
+ *
+ * With a workspace open the grid owns the row and puts the app's actions at
+ * its far right itself; the wizard has no grid, so the bar carries them — and
+ * carries them even with nothing open, which is why it renders at all in that
+ * case. Passing them here as well would put Restart on screen twice.
+ */
const renderBar = (embedded: boolean) => (
<WorkspaceBar
embedded={embedded}
+ actions={embedded ? undefined : <TopBarActions />}
workspaces={barWorkspaces}
activeId={session?.id ?? null}
addingNew={addingNew}
@@ -674,6 +684,7 @@ export function AgenticIdeView() {
key={session.id}
session={session}
workspaceBar={renderBar(true)}
+ appActions={<TopBarActions />}
focusMode={focusMode}
onToggleFocus={(v) => void toggleFocus(v)}
onClose={() => void close()}