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(shell): give the coding surfaces the window, and one way back

rubenluetke10-beepb17075d2e92a
diff --git a/jarvis/ui/web/frontend/src/App.tsx b/jarvis/ui/web/frontend/src/App.tsx
index 447041b04d..17335d8715 100644
--- a/jarvis/ui/web/frontend/src/App.tsx
+++ b/jarvis/ui/web/frontend/src/App.tsx
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useState } from "react";
+import { useEventStore } from "@/store/events";
import { useWebSocket } from "@/hooks/useWebSocket";
import { useBrainStatus } from "@/hooks/useBrainStatus";
import { useVoiceStatus } from "@/hooks/useVoiceStatus";
@@ -28,6 +29,18 @@ import { SubscriptionRealtimeTransportBroker } from "@/components/voice/Subscrip
/** Where the collapsed/expanded choice for the nav sidebar is remembered. */
const NAV_COLLAPSED_KEY = "jarvis.sidebar.collapsed.v1";
+/**
+ * The sections that open WITHOUT the app's module rail — and without the
+ * decorative backdrop behind them.
+ *
+ * These screens are a workspace, not a page of the app: what is on them is the
+ * user's own project and a coding agent working in it. A column of twenty
+ * section icons beside that is the app talking about itself, and the grid and
+ * glow washing over it are decoration competing with content that changes every
+ * second. Both step aside here and stay exactly as they are everywhere else.
+ */
+const CODING_SECTIONS = new Set(["agentic-ide", "chat-workspace", "agentic-ide-classic"]);
+
export default function App() {
useWebSocket();
useBrainStatus();
@@ -117,29 +130,50 @@ export default function App() {
[navCollapsed, sidebar],
);
+ /*
+ * On a coding surface the rail is gone until it is asked for.
+ *
+ * Not merely narrower — absent, along with the seam beside it. The button
+ * that brings it back sits inside the coding surface itself (see
+ * `NavRevealButton`), where the eye already is; parking it on the app chrome
+ * would mean looking away from the work to find the way back to it.
+ */
+ const activeSection = useEventStore((s) => s.activeSection);
+ const navRevealed = useEventStore((s) => s.navRevealed);
+ const codingSurface = CODING_SECTIONS.has(activeSection);
+ const railHidden = codingSurface && !navRevealed;
+
return (
<div className="relative flex h-screen w-screen overflow-hidden bg-background text-foreground">
<SubscriptionRealtimeTransportBroker />
- <div className="pointer-events-none fixed inset-0 jarvis-grid opacity-40" aria-hidden />
- <div
- className="pointer-events-none fixed right-[-10%] top-[-20%] h-[600px] w-[600px] jarvis-glow"
- aria-hidden
- />
+ {!codingSurface && (
+ <>
+ <div className="pointer-events-none fixed inset-0 jarvis-grid opacity-40" aria-hidden />
+ <div
+ className="pointer-events-none fixed right-[-10%] top-[-20%] h-[600px] w-[600px] jarvis-glow"
+ aria-hidden
+ />
+ </>
+ )}
- <Sidebar
- width={sidebar.size}
- collapsed={navCollapsed}
- onToggleCollapsed={toggleNav}
- />
+ {!railHidden && (
+ <>
+ <Sidebar
+ width={sidebar.size}
+ collapsed={navCollapsed}
+ onToggleCollapsed={toggleNav}
+ />
- <PaneResizer
- orientation="vertical"
- onPointerDown={startSidebarResize}
- onDoubleClick={sidebar.reset}
- onNudge={sidebar.nudge}
- active={sidebar.isResizing}
- title="Drag to resize the sidebar — double-click to reset"
- />
+ <PaneResizer
+ orientation="vertical"
+ onPointerDown={startSidebarResize}
+ onDoubleClick={sidebar.reset}
+ onNudge={sidebar.nudge}
+ active={sidebar.isResizing}
+ title="Drag to resize the sidebar — double-click to reset"
+ />
+ </>
+ )}
<main className="relative z-10 flex min-w-0 flex-1 flex-col">
{/* App-wide macOS permission alert — topmost so a missing grant is
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index 861b216898..62b17740b9 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -47,6 +47,7 @@ import { AgentMark } from "./AgentMark";
import { PaneActivityPill } from "./PaneActivityPill";
import { AgentPickerMenu, offersAgentChoice, type SplitAgentChoice } from "./AgentPicker";
import type { TerminalAppearance } from "./terminalThemes";
+import { installZoomKeyBridge, type ZoomIntent } from "./terminalZoom";
import {
evenWeights,
isEvenLayout,
@@ -62,6 +63,7 @@ import {
} from "./paneLayout";
import { loadStoredArrangement, saveStoredArrangement, usePaneWeights } from "./usePaneWeights";
import { ContinueInterrupted } from "./ContinueInterrupted";
+import { NavRevealButton } from "@/components/layout/NavRevealButton";
import { PaneNotifications } from "./PaneNotifications";
import { isVoiceActive } from "./VoiceBubble";
import { PromptPreview } from "./PromptPreview";
@@ -196,8 +198,21 @@ interface AgenticGridProps {
onToggleVoice?: () => void;
}
+/*
+ * Terminal text size, in pixels — the same three numbers as
+ * `jarvis/agentic_ide/ui_prefs.py`, which is what the backend clamps a saved
+ * size to. `FONT_DEFAULT` is also where Ctrl/Cmd+0 lands.
+ */
const FONT_MIN = 10;
const FONT_MAX = 20;
+const FONT_DEFAULT = 13;
+
+/** The size one zoom step away from `from`, kept inside the bounds. */
+export function zoomedFontSize(from: number, intent: ZoomIntent): number {
+ if (intent === "reset") return FONT_DEFAULT;
+ const next = from + (intent === "in" ? 1 : -1);
+ return Math.min(FONT_MAX, Math.max(FONT_MIN, next));
+}
/*
* The one button style of the workspace toolbar.
@@ -552,7 +567,7 @@ export function AgenticGrid({
const [appearance, setAppearanceState] = useState<TerminalAppearance>(
() => storedAppearance() ?? theme,
);
- const [fontSize, setFontSizeState] = useState(() => storedFontSize() ?? 13);
+ const [fontSize, setFontSizeState] = useState(() => storedFontSize() ?? FONT_DEFAULT);
// Track the app theme while the user has expressed no preference of their own,
// so flipping the whole app to light does not leave black panes behind.
@@ -576,6 +591,34 @@ export function AgenticGrid({
});
}, []);
+ /*
+ * Ctrl/Cmd + `+` / `-` / `0`, the chord every other application binds to
+ * "make this text bigger" — see ./terminalZoom for the chord table and for
+ * why this app has to claim the keystroke rather than let the WebView zoom
+ * the entire window.
+ *
+ * The listener is installed ONCE and reads the current size out of a ref: it
+ * captures keystrokes for every pane in the workspace, and re-registering it
+ * on each step would drop a chord held down to zoom repeatedly.
+ */
+ const zoomStateRef = useRef({ fontSize, onScreen });
+ zoomStateRef.current = { fontSize, onScreen };
+ useEffect(
+ () =>
+ installZoomKeyBridge(window, {
+ isMac: /mac|iphone|ipad/i.test(navigator.userAgent),
+ // Hidden rather than unmounted when another section is open, so the
+ // grid has to be asked whether anyone is looking at it.
+ enabled: () => zoomStateRef.current.onScreen,
+ apply: (intent) => {
+ const current = zoomStateRef.current.fontSize;
+ const next = zoomedFontSize(current, intent);
+ if (next !== current) setFontSize(next);
+ },
+ }),
+ [setFontSize],
+ );
+
// Pick the remembered size back up. Runs once per mounted workspace: the size
// is one person's reading preference, not a property of a project, so it is
// the same in every workspace and never re-read on a switch.
@@ -1743,6 +1786,12 @@ export function AgenticGrid({
data-testid="agentic-toolbar"
className="flex shrink-0 flex-nowrap items-center gap-2 border-b border-border px-2 py-1"
>
+ {/* This section hides the app's module rail (see `CODING_SECTIONS` in
+ App.tsx), so the way back has to be ON this row — otherwise the
+ workspace is a place you can enter and not leave. First in the line,
+ where every editor puts it. */}
+ <NavRevealButton />
+
{workspaceBar ?? (
<div className="flex min-w-0 flex-1 items-center gap-2">
<FolderGit2 className="h-4 w-4 shrink-0 text-primary" />
@@ -2849,13 +2898,21 @@ function TerminalFontSizeControl({
const t = useT();
const smaller = fontSize <= FONT_MIN;
const larger = fontSize >= FONT_MAX;
+ // The keyboard is how this actually gets used (see ./terminalZoom); the
+ // stepper's job is to make the chord discoverable. Symbols rather than a
+ // translated sentence, because "⌘ + − 0" reads the same in every locale.
+ const isMac = /mac|iphone|ipad/i.test(navigator.userAgent);
+ const chordHint = isMac ? "⌘ + / − / 0" : "Ctrl + / − / 0";
return (
<div
role="group"
aria-label={t("agentic_grid.display.text_size")}
data-testid="agentic-font-size-control"
- title={t("agentic_grid.display.text_size")}
+ aria-keyshortcuts={
+ isMac ? "Meta+Plus Meta+Minus Meta+0" : "Control+Plus Control+Minus Control+0"
+ }
+ title={`${t("agentic_grid.display.text_size")} — ${chordHint}`}
className="flex h-7 shrink-0 items-center rounded-md border border-border/70 bg-background/30"
>
<Type aria-hidden="true" className="mx-1 h-3.5 w-3.5 text-muted-foreground" />
diff --git a/jarvis/ui/web/frontend/src/components/layout/NavRevealButton.tsx b/jarvis/ui/web/frontend/src/components/layout/NavRevealButton.tsx
new file mode 100644
index 0000000000..92c7688a98
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/layout/NavRevealButton.tsx
@@ -0,0 +1,50 @@
+/**
+ * The way back to the app, from a surface that hid it.
+ *
+ * The coding sections open without the module rail (see `CODING_SECTIONS` in
+ * `App.tsx`) — so something on those screens has to say where it went. This is
+ * that something: the panel glyph every editor uses for exactly this, in the
+ * top-left corner where exactly this button lives in every editor. Familiar
+ * shape, familiar place, one click each way.
+ *
+ * It renders only where the rail is actually hidden. On a screen that has its
+ * navigation it would be a button that toggles something already visible, which
+ * is how a control stops meaning anything.
+ */
+import { PanelLeft, PanelLeftClose } from "lucide-react";
+
+import { useEventStore } from "@/store/events";
+import { cn } from "@/lib/utils";
+
+export interface NavRevealButtonProps {
+ className?: string;
+}
+
+export function NavRevealButton({ className }: NavRevealButtonProps) {
+ const revealed = useEventStore((s) => s.navRevealed);
+ const setRevealed = useEventStore((s) => s.setNavRevealed);
+ const label = revealed ? "Hide the app menu" : "Show the app menu";
+
+ return (
+ <button
+ type="button"
+ data-testid="nav-reveal"
+ onClick={() => setRevealed(!revealed)}
+ title={label}
+ aria-label={label}
+ aria-expanded={revealed}
+ className={cn(
+ "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground",
+ "transition-colors hover:bg-foreground/[0.06] hover:text-foreground",
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
+ className,
+ )}
+ >
+ {revealed ? (
+ <PanelLeftClose className="h-4 w-4" aria-hidden />
+ ) : (
+ <PanelLeft className="h-4 w-4" aria-hidden />
+ )}
+ </button>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/store/events.ts b/jarvis/ui/web/frontend/src/store/events.ts
index 02b9e56b6f..ce899df9ff 100644
--- a/jarvis/ui/web/frontend/src/store/events.ts
+++ b/jarvis/ui/web/frontend/src/store/events.ts
@@ -283,6 +283,19 @@ interface EventStore {
// first paint after a restart never flashes "OFFLINE".
wsWarming: boolean;
activeSection: SectionId;
+ /**
+ * Has the user pulled the app's module rail back out over a coding surface?
+ *
+ * The coding sections open WITHOUT it — a wall of agent output is what those
+ * screens are for, and a column of twenty section icons beside it is the app
+ * talking about itself. One button brings it back, and leaving the section
+ * puts it away again, so "open the chat and the rail is gone" stays true
+ * every time rather than only the first time.
+ *
+ * Shell state kept in the store rather than in `App` because the button that
+ * flips it lives inside the coding surface, several lazy boundaries down.
+ */
+ navRevealed: boolean;
transcription: string;
transcriptionFinal: boolean;
toasts: Toast[];
@@ -352,6 +365,7 @@ interface EventStore {
setWarming: (warming: boolean) => void;
clearEvents: () => void;
setActiveSection: (s: SectionId) => void;
+ setNavRevealed: (revealed: boolean) => void;
setTranscription: (text: string, isFinal: boolean) => void;
pushToast: (
kind: Toast["kind"],
@@ -423,6 +437,7 @@ export const useEventStore = create<EventStore>((set, get) => ({
activeSection: initialSectionFromSearch(
typeof window === "undefined" ? "" : window.location.search,
),
+ navRevealed: false,
transcription: "",
transcriptionFinal: true,
toasts: [],
@@ -458,7 +473,10 @@ export const useEventStore = create<EventStore>((set, get) => ({
setConnected: (c) => set({ connected: c }),
setWarming: (warming) => set({ wsWarming: warming }),
clearEvents: () => set({ events: [] }),
- setActiveSection: (s) => set({ activeSection: s }),
+ // Leaving a section puts the rail away again, so a coding surface is entered
+ // without it EVERY time rather than only the first time.
+ setActiveSection: (s) => set({ activeSection: s, navRevealed: false }),
+ setNavRevealed: (revealed) => set({ navRevealed: revealed }),
setTranscription: (text, isFinal) =>
set({ transcription: text, transcriptionFinal: isFinal }),
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
index de30305c25..037bb0e3f4 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.tsx
@@ -40,6 +40,7 @@ import {
fetchAgentAccounts,
groupFor,
} from "@/lib/agentAccountsApi";
+import { NavRevealButton } from "@/components/layout/NavRevealButton";
import { TopBarActions } from "@/components/layout/TopBar";
import { WorkspaceBar } from "@/components/agentic/WorkspaceBar";
import {
@@ -852,6 +853,12 @@ export function AgenticIdeView({ onScreen = true }: AgenticIdeViewProps) {
// ---------------------------------------------------------------- launcher
return (
<div className="flex h-full min-h-0 flex-col" ref={shellRef}>
+ {/* The grid puts this in its own toolbar; the launcher has no such row,
+ and this section hides the app's module rail — so without it the
+ screen a user lands on with nothing open has no way back to the app. */}
+ <div className="flex shrink-0 items-center px-2 pt-2">
+ <NavRevealButton />
+ </div>
{renderBar(false)}
<div className="min-h-0 flex-1">
<WorkspaceLauncher