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(ide): give threads the grid pane's title bar controls (#1105)

Ruben Lütkeaf70ed2084a5
diff --git a/docs/agentic-ide-threads.md b/docs/agentic-ide-threads.md
index 84303e1ca8..9e93e9dbf5 100644
--- a/docs/agentic-ide-threads.md
+++ b/docs/agentic-ide-threads.md
@@ -34,6 +34,12 @@ for an approval and a blue dot for news since it was last opened.
- **New thread:** the small plus on a project row. The empty thread asks what
to build in the project; the project name is a picker.
+- **Title bar:** an open thread has the same controls as a grid pane's
+ header: review the changes in the thread's folder, show them in the Git
+ tab, more actions (rename, new thread, archive), fold the app sidebar to
+ its rail for more room, a new thread in the project, and close — which
+ moves the thread to the archive (not while it works or waits for an
+ approval).
- **Conversation:** the person's messages on the right, the agent's answer as
reading text, the work in between as folded rows ("Ran 3 commands, read 2
files") that open to each call, its diff or its output. A running turn ends
diff --git a/dodaios/ui/web/frontend/src/App.tsx b/dodaios/ui/web/frontend/src/App.tsx
index 8090607105..f72d2edf5c 100644
--- a/dodaios/ui/web/frontend/src/App.tsx
+++ b/dodaios/ui/web/frontend/src/App.tsx
@@ -64,9 +64,7 @@ import { SubscriptionRealtimeTransportBroker } from "@/components/voice/Subscrip
import { BrowserRealtimeControl } from "@/components/voice/BrowserRealtimeControl";
import { cn } from "@/lib/utils";
import { useTilingStore } from "@/store/tiling";
-
-/** Where the collapsed/expanded choice for the nav sidebar is remembered. */
-const NAV_COLLAPSED_KEY = "jarvis.sidebar.collapsed.v1";
+import { useNavSidebarStore } from "@/store/navSidebar";
/** Sections that fill the whole window instead of sitting beside the nav. */
const FULLSCREEN_SECTIONS: readonly SectionId[] = ["agents", "docs", "memory"];
@@ -236,26 +234,13 @@ export default function App() {
* (private-mode WebView, storage disabled) degrades to the expanded default
* rather than taking the shell down with it.
*/
- const [navCollapsed, setNavCollapsed] = useState<boolean>(() => {
- try {
- return window.localStorage.getItem(NAV_COLLAPSED_KEY) === "true";
- } catch {
- return false;
- }
- });
+ const navCollapsed = useNavSidebarStore((state) => state.collapsed);
// Dragging the seam is itself an "I want the sidebar" gesture: a drag that
// left the rail state behind would snap straight back to icons and read as a
// broken handle.
const startSidebarResize = useCallback(
(event: React.PointerEvent) => {
- if (navCollapsed) {
- setNavCollapsed(false);
- try {
- window.localStorage.setItem(NAV_COLLAPSED_KEY, "false");
- } catch {
- /* storage unavailable — the choice simply does not survive a restart */
- }
- }
+ if (navCollapsed) useNavSidebarStore.getState().setCollapsed(false);
sidebar.startResize(event);
},
[navCollapsed, sidebar],
diff --git a/dodaios/ui/web/frontend/src/components/agentic/PaneChangesDialog.tsx b/dodaios/ui/web/frontend/src/components/agentic/PaneChangesDialog.tsx
index c79f88d7e9..57a4c2ece7 100644
--- a/dodaios/ui/web/frontend/src/components/agentic/PaneChangesDialog.tsx
+++ b/dodaios/ui/web/frontend/src/components/agentic/PaneChangesDialog.tsx
@@ -82,20 +82,24 @@ export function PaneChangesDialog({
pane,
folder,
branch,
+ title: titleOverride,
}: {
open: boolean;
onOpenChange: (open: boolean) => void;
workspaceId: string;
- /** The pane's call-sign. */
+ /** The pane's call-sign; empty for a thread, which is read by its `folder`. */
pane: string;
- /** Set only for a pane on its own git worktree. */
+ /** Set only for a pane on its own git worktree, or for a thread's folder. */
folder?: string;
branch?: string;
+ /** The name in the dialog's title, in place of the pane's (a thread's title). */
+ title?: string;
}): JSX.Element {
const t = useT();
// Until the strings land, `t()` answers with keys; the dialog waits for them.
const stringsReady = useLocaleChunk("pane_review");
- const title = usePaneTitle(workspaceId, pane) || pane;
+ const paneTitle = usePaneTitle(workspaceId, pane) || pane;
+ const title = titleOverride || paneTitle;
const openFile = useCodeEditorStore((state) => state.openFile);
const [scope, setScope] = useState<ChangeScope>("pane");
const [revision, setRevision] = useState(0);
@@ -210,8 +214,8 @@ export function PaneChangesDialog({
>
{!stringsReady ? (
<div className="flex flex-1 items-center justify-center">
- <Dialog.Title className="sr-only">{pane}</Dialog.Title>
- <Dialog.Description className="sr-only">{pane}</Dialog.Description>
+ <Dialog.Title className="sr-only">{title}</Dialog.Title>
+ <Dialog.Description className="sr-only">{title}</Dialog.Description>
<Loader2 className="h-4 w-4 animate-spin text-muted-foreground" aria-hidden="true" />
</div>
) : (<>
diff --git a/dodaios/ui/web/frontend/src/components/agentic/paneChangesApi.ts b/dodaios/ui/web/frontend/src/components/agentic/paneChangesApi.ts
index 909ed8a5f3..f84fc248a2 100644
--- a/dodaios/ui/web/frontend/src/components/agentic/paneChangesApi.ts
+++ b/dodaios/ui/web/frontend/src/components/agentic/paneChangesApi.ts
@@ -71,6 +71,7 @@ export interface PaneChanges {
/** Where a pane's work lives: its own worktree folder, else the workspace's shared one. */
export interface PaneChangesTarget {
workspaceId: string;
+ /** The pane's call-sign; empty for a thread, which is read by its `folder` alone. */
pane: string;
/** Set only for a pane on its own git worktree. */
folder?: string;
@@ -146,7 +147,8 @@ function reading(body: ChangesBody, extra: Pick<PaneChanges, "folderTotal" | "ow
export async function fetchPaneChanges(target: PaneChangesTarget, scope: ChangeScope): Promise<PaneChanges> {
const ownCheckout = Boolean(target.folder);
- if (scope === "pane" || ownCheckout) {
+ // A thread has no pane: its folder's uncommitted work is what it changed.
+ if ((scope === "pane" || ownCheckout) && target.pane) {
try {
return reading(await read<ChangesBody>(paneUrl(target, "changes")), { folderTotal: null, ownCheckout });
} catch (error) {
diff --git a/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.test.tsx b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.test.tsx
new file mode 100644
index 0000000000..372eca56f1
--- /dev/null
+++ b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.test.tsx
@@ -0,0 +1,70 @@
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import type { AgentChatSession } from "@/lib/agentChatApi";
+import { useIdeSidePanelStore } from "@/store/ideSidePanel";
+import { useIdeThreadsStore } from "@/store/ideThreads";
+import { useNavSidebarStore } from "@/store/navSidebar";
+
+vi.mock("../PaneChangesDialog", () => ({
+ PaneChangesDialog: ({ open, folder, title }: { open: boolean; folder: string; title: string }) =>
+ open ? <div data-testid="thread-changes" data-folder={folder}>{title}</div> : null,
+}));
+
+import { ThreadHeader } from "./ThreadHeader";
+
+const SESSION = {
+ session_id: "s1",
+ title: "Fix the login",
+ cli_title: "",
+ provider: "claude-api",
+ cwd: "/repo",
+ running: false,
+ pending_approvals: [],
+} as unknown as AgentChatSession;
+
+describe("ThreadHeader", () => {
+ beforeEach(() => {
+ useNavSidebarStore.setState({ collapsed: false });
+ });
+ afterEach(cleanup);
+
+ it("offers the grid pane's controls for the open thread", () => {
+ render(<ThreadHeader session={SESSION} projectId="p1" folder="/repo" workspaceId="w1" />);
+ expect(screen.getByTestId("thread-header-title").textContent).toBe("Fix the login");
+ for (const id of ["review-changes", "show-in-git", "more", "maximize", "new", "close"]) {
+ expect(screen.getByTestId(`thread-header-${id}`)).toBeTruthy();
+ }
+ });
+
+ it("reviews the changes in the thread's folder", () => {
+ render(<ThreadHeader session={SESSION} projectId="p1" folder="/repo/wt" workspaceId="w1" />);
+ fireEvent.click(screen.getByTestId("thread-header-review-changes"));
+ expect(screen.getByTestId("thread-changes").getAttribute("data-folder")).toBe("/repo/wt");
+ });
+
+ it("opens the Git tab, folds the sidebar, starts and closes threads", () => {
+ const openTab = vi.spyOn(useIdeSidePanelStore.getState(), "openTab").mockImplementation(() => {});
+ const newThread = vi.spyOn(useIdeThreadsStore.getState(), "newThread").mockImplementation(() => {});
+ const archive = vi.spyOn(useIdeThreadsStore.getState(), "archiveThread").mockImplementation(() => {});
+ render(<ThreadHeader session={SESSION} projectId="p1" folder="/repo" workspaceId="w1" />);
+
+ fireEvent.click(screen.getByTestId("thread-header-show-in-git"));
+ expect(openTab).toHaveBeenCalledWith("git");
+
+ fireEvent.click(screen.getByTestId("thread-header-maximize"));
+ expect(useNavSidebarStore.getState().collapsed).toBe(true);
+ fireEvent.click(screen.getByTestId("thread-header-maximize"));
+ expect(useNavSidebarStore.getState().collapsed).toBe(false);
+
+ fireEvent.click(screen.getByTestId("thread-header-new"));
+ expect(newThread).toHaveBeenCalledWith("p1");
+
+ fireEvent.click(screen.getByTestId("thread-header-close"));
+ expect(archive).toHaveBeenCalledWith("s1");
+ });
+
+ it("does not close a thread that is still working", () => {
+ render(<ThreadHeader session={{ ...SESSION, running: true } as AgentChatSession} projectId="p1" folder="/repo" workspaceId="w1" />);
+ expect((screen.getByTestId("thread-header-close") as HTMLButtonElement).disabled).toBe(true);
+ });
+});
diff --git a/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.tsx b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.tsx
new file mode 100644
index 0000000000..d8e6f1fb08
--- /dev/null
+++ b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadHeader.tsx
@@ -0,0 +1,151 @@
+import { useMemo, useRef, useState, type ReactNode } from "react";
+import { Archive, Check, FileDiff, FolderGit2, Maximize2, Minimize2, MoreHorizontal, Pencil, Plus, SquarePlus, X } from "lucide-react";
+import { AgentMark } from "@/components/agentic/AgentMark";
+import { patchAgentChatSession, type AgentChatSession } from "@/lib/agentChatApi";
+import { cn } from "@/lib/utils";
+import { fill, loadLocaleChunk, useT } from "@/i18n";
+import { useEventStore } from "@/store/events";
+import { useIdeSidePanelStore } from "@/store/ideSidePanel";
+import { useIdeThreadsStore } from "@/store/ideThreads";
+import { useNavSidebarStore } from "@/store/navSidebar";
+import { PaneChangesDialog } from "../PaneChangesDialog";
+import { prefetchPaneChanges } from "../paneChangesApi";
+import { ThreadMenuItem, ThreadMenuSeparator, ThreadPopover } from "./ThreadPopover";
+import { threadTitle, useThreadChatStore } from "./threadModel";
+
+const ACTION = cn(
+ "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors",
+ "hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent",
+);
+
+function Action({ label, onClick, disabled, pressed, testId, onPointerEnter, children }: {
+ label: string;
+ onClick: () => void;
+ disabled?: boolean;
+ pressed?: boolean;
+ testId: string;
+ onPointerEnter?: () => void;
+ children: ReactNode;
+}) {
+ return <button type="button" aria-label={label} title={label} onClick={onClick} disabled={disabled} aria-pressed={pressed}
+ data-testid={testId} onPointerEnter={onPointerEnter} className={cn(ACTION, pressed && "bg-secondary text-foreground")}>
+ {children}
+ </button>;
+}
+
+/**
+ * The open thread's title bar: the same controls a grid pane's header has,
+ * for a conversation instead of a terminal. Review the changes in the
+ * thread's folder, show them in the Git tab, more actions, make room by
+ * folding the sidebar, start another thread, and close this one (it moves to
+ * the archive, where the sidebar can bring it back).
+ */
+export function ThreadHeader({ session, projectId, folder, workspaceId }: {
+ session: AgentChatSession;
+ projectId: string;
+ /** Where the thread's agent works: the project's checkout or the thread's worktree. */
+ folder: string;
+ /** The IDE's active workspace, which the Git tab shows. */
+ workspaceId: string | null;
+}) {
+ const t = useT();
+ const pushToast = useEventStore((state) => state.pushToast);
+ const catalog = useThreadChatStore((state) => state.catalog);
+ const navCollapsed = useNavSidebarStore((state) => state.collapsed);
+ const [menuOpen, setMenuOpen] = useState(false);
+ const [renaming, setRenaming] = useState<string | null>(null);
+ const [changesOpen, setChangesOpen] = useState(false);
+ const moreRef = useRef<HTMLButtonElement | null>(null);
+ const title = threadTitle(session);
+ const mark = useMemo(() => {
+ const provider = catalog?.providers.find((row) => row.id === session.provider);
+ return provider?.agent ? { agent: provider.agent, label: provider.label } : null;
+ }, [catalog, session.provider]);
+ // Archiving a thread mid-turn or mid-approval would hide work that needs the person.
+ const busy = Boolean(session.running) || Boolean(session.pending_approvals?.length);
+ const target = { workspaceId: workspaceId ?? "", pane: "", folder };
+
+ const rename = async (wanted: string) => {
+ const clean = wanted.trim();
+ setRenaming(null);
+ if (!clean || clean === title) return;
+ try {
+ await patchAgentChatSession(session.session_id, { title: clean });
+ await useThreadChatStore.getState().loadSessions();
+ } catch (error) {
+ pushToast("error", error instanceof Error ? error.message : String(error));
+ }
+ };
+ const reviewChanges = () => setChangesOpen(true);
+ const prefetchReview = () => {
+ void loadLocaleChunk("pane_review");
+ if (folder) prefetchPaneChanges(target);
+ };
+ const showInGit = () => useIdeSidePanelStore.getState().openTab("git");
+ const newThread = () => useIdeThreadsStore.getState().newThread(projectId);
+ const close = () => useIdeThreadsStore.getState().archiveThread(session.session_id);
+ const toggleRoom = () => useNavSidebarStore.getState().setCollapsed(!navCollapsed);
+
+ return <>
+ <header data-testid="thread-header" aria-label={fill(t("ide_threads.header.label"), { thread: title })}
+ className="flex h-9 shrink-0 select-none items-center gap-1 border-b border-border pl-3 pr-1.5">
+ {renaming === null
+ ? <div className="flex min-w-0 flex-1 items-center gap-2" onDoubleClick={() => setRenaming(title)}>
+ {mark && <AgentMark agent={mark.agent} label={mark.label} variant="plain" size="sm" />}
+ <span data-testid="thread-header-title" className="truncate text-sm font-medium text-foreground" title={title}>{title}</span>
+ </div>
+ : <form className="flex min-w-0 flex-1 items-center gap-1" onSubmit={(event) => { event.preventDefault(); void rename(renaming); }}>
+ <input autoFocus aria-label={fill(t("ide_projects.rename_named"), { target: title })} value={renaming} maxLength={120}
+ onChange={(event) => setRenaming(event.target.value)}
+ onKeyDown={(event) => { if (event.key === "Escape") { event.stopPropagation(); setRenaming(null); } }}
+ onBlur={() => void rename(renaming)}
+ className="min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-0.5 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring" />
+ <button type="submit" aria-label={t("ide_threads.save_name")} className="rounded p-1 text-muted-foreground hover:text-foreground"><Check className="h-4 w-4" /></button>
+ </form>}
+ <div className="flex shrink-0 items-center gap-0.5">
+ <Action label={t("ide_threads.header.review_changes")} onClick={reviewChanges} disabled={!folder}
+ testId="thread-header-review-changes" onPointerEnter={prefetchReview}>
+ <FileDiff className="h-[15px] w-[15px]" />
+ </Action>
+ <Action label={t("ide_threads.header.show_in_git")} onClick={showInGit} testId="thread-header-show-in-git">
+ <FolderGit2 className="h-[15px] w-[15px]" />
+ </Action>
+ <button ref={moreRef} type="button" aria-label={fill(t("ide_threads.header.more"), { thread: title })} title={fill(t("ide_threads.header.more"), { thread: title })}
+ aria-haspopup="menu" aria-expanded={menuOpen} onClick={() => setMenuOpen(!menuOpen)} data-testid="thread-header-more" className={ACTION}>
+ <MoreHorizontal className="h-4 w-4" />
+ </button>
+ <Action label={t(navCollapsed ? "ide_threads.header.restore" : "ide_threads.header.maximize")} onClick={toggleRoom}
+ pressed={navCollapsed} testId="thread-header-maximize">
+ {navCollapsed ? <Minimize2 className="h-3.5 w-3.5" /> : <Maximize2 className="h-3.5 w-3.5" />}
+ </Action>
+ <Action label={t("ide_threads.new_thread_here")} onClick={newThread} testId="thread-header-new">
+ <Plus className="h-4 w-4" />
+ </Action>
+ <Action label={t("ide_threads.header.close")} onClick={close} disabled={busy} testId="thread-header-close">
+ <X className="h-4 w-4" />
+ </Action>
+ </div>
+ </header>
+ <ThreadPopover anchor={moreRef} open={menuOpen} onClose={() => setMenuOpen(false)} align="end"
+ label={fill(t("ide_threads.header.more"), { thread: title })} width={240}>
+ <div role="menu">
+ <ThreadMenuItem icon={<Pencil className="h-3.5 w-3.5" />} label={t("ide_threads.rename")}
+ onSelect={() => { setMenuOpen(false); setRenaming(title); }} />
+ <ThreadMenuItem icon={<SquarePlus className="h-3.5 w-3.5" />} label={t("ide_threads.new_thread_here")}
+ onSelect={() => { setMenuOpen(false); newThread(); }} />
+ <ThreadMenuSeparator />
+ <ThreadMenuItem icon={<FileDiff className="h-3.5 w-3.5" />} label={t("ide_threads.header.review_changes")} disabled={!folder}
+ onSelect={() => { setMenuOpen(false); reviewChanges(); }} />
+ <ThreadMenuItem icon={<FolderGit2 className="h-3.5 w-3.5" />} label={t("ide_threads.header.show_in_git")}
+ onSelect={() => { setMenuOpen(false); showInGit(); }} />
+ <ThreadMenuSeparator />
+ <ThreadMenuItem icon={<Archive className="h-3.5 w-3.5" />} label={t("ide_threads.archive")} disabled={busy}
+ onSelect={() => { setMenuOpen(false); close(); }} />
+ </div>
+ </ThreadPopover>
+ {folder && <PaneChangesDialog open={changesOpen} onOpenChange={setChangesOpen} workspaceId={workspaceId ?? ""} pane=""
+ folder={folder} title={title} />}
+ </>;
+}
+
diff --git a/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadView.tsx b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadView.tsx
index 1dc9426a72..9061499653 100644
--- a/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadView.tsx
+++ b/dodaios/ui/web/frontend/src/components/agentic/threads/ThreadView.tsx
@@ -11,6 +11,7 @@ import { useThreadTerminalsStore } from "@/store/threadTerminals";
import { openSubagentOf, useThreadSubagentsStore, type SubagentRow } from "@/store/threadSubagents";
import { ThreadBranchBar, type ThreadCheckout } from "./ThreadBranchBar";
import { ThreadComposer } from "./ThreadComposer";
+import { ThreadHeader } from "./ThreadHeader";
import { ThreadMenuItem, ThreadPopover } from "./ThreadPopover";
import { ThreadTimeline } from "./ThreadTimeline";
import { OpenSubagent, SubagentHeader, SubagentSwitcher } from "./ThreadSubagents";
@@ -271,6 +272,7 @@ export function ThreadView({ onScreen }: { onScreen: boolean }) {
return <div className="relative flex h-full min-h-0 flex-col" data-testid="thread-view">
{memberOf && <BackToTeam teamId={memberOf} projectId={project.id} />}
+ {session && !empty && <ThreadHeader session={session} projectId={project.id} folder={folder} workspaceId={activeWorkspaceId} />}
{empty
? <div className="flex min-h-0 flex-1 flex-col items-center justify-center px-5 pb-10">
<h2 className="text-center text-2xl font-normal tracking-tight text-foreground sm:text-3xl">
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/de.json b/dodaios/ui/web/frontend/src/i18n/locales/de.json
index d8d22f803b..03bcdf1e12 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/de.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/de.json
@@ -10229,6 +10229,15 @@
"signin_not_yet": "— die Installation verbindet noch nichts."
},
"ide_threads": {
+ "header": {
+ "label": "Thread: {thread}",
+ "review_changes": "Änderungen prüfen",
+ "show_in_git": "Änderungen in Git zeigen",
+ "more": "Weitere Aktionen für {thread}",
+ "maximize": "Seitenleiste ausblenden",
+ "restore": "Seitenleiste einblenden",
+ "close": "Thread schließen (kommt ins Archiv)"
+ },
"layout_aria": "IDE-Layout",
"layout_grid": "Terminal-Raster",
"layout_threads": "Threads",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/en.json b/dodaios/ui/web/frontend/src/i18n/locales/en.json
index f8afa8f850..4e2cf3a400 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/en.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/en.json
@@ -10229,6 +10229,15 @@
"signin_not_yet": "— installing does not connect anything yet."
},
"ide_threads": {
+ "header": {
+ "label": "Thread: {thread}",
+ "review_changes": "Review changes",
+ "show_in_git": "Show changes in Git",
+ "more": "More actions for {thread}",
+ "maximize": "Hide the sidebar",
+ "restore": "Show the sidebar",
+ "close": "Close thread (moves it to the archive)"
+ },
"layout_aria": "IDE layout",
"layout_grid": "Terminal grid",
"layout_threads": "Threads",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/es.json b/dodaios/ui/web/frontend/src/i18n/locales/es.json
index 8048345ece..de20134cfe 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/es.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/es.json
@@ -10229,6 +10229,15 @@
"signin_not_yet": "— instalarlo todavía no conecta nada."
},
"ide_threads": {
+ "header": {
+ "label": "Hilo: {thread}",
+ "review_changes": "Revisar cambios",
+ "show_in_git": "Mostrar cambios en Git",
+ "more": "Más acciones para {thread}",
+ "maximize": "Ocultar la barra lateral",
+ "restore": "Mostrar la barra lateral",
+ "close": "Cerrar hilo (pasa al archivo)"
+ },
"layout_aria": "Diseño del IDE",
"layout_grid": "Cuadrícula de terminales",
"layout_threads": "Hilos",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/pt.json b/dodaios/ui/web/frontend/src/i18n/locales/pt.json
index 1cb7f8f854..c622d2a7e5 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/pt.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/pt.json
@@ -10229,6 +10229,15 @@
"signin_not_yet": "— instalar ainda não liga nada."
},
"ide_threads": {
+ "header": {
+ "label": "Thread: {thread}",
+ "review_changes": "Revisar alterações",
+ "show_in_git": "Mostrar alterações no Git",
+ "more": "Mais ações para {thread}",
+ "maximize": "Ocultar a barra lateral",
+ "restore": "Mostrar a barra lateral",
+ "close": "Fechar thread (vai para o arquivo)"
+ },
"layout_aria": "Disposição do IDE",
"layout_grid": "Grelha de terminais",
"layout_threads": "Threads",
diff --git a/dodaios/ui/web/frontend/src/i18n/locales/zh.json b/dodaios/ui/web/frontend/src/i18n/locales/zh.json
index a7caefd011..59524e692b 100644
--- a/dodaios/ui/web/frontend/src/i18n/locales/zh.json
+++ b/dodaios/ui/web/frontend/src/i18n/locales/zh.json
@@ -10229,6 +10229,15 @@
"signin_not_yet": "——安装后尚不会连接任何内容。"
},
"ide_threads": {
+ "header": {
+ "label": "线程:{thread}",
+ "review_changes": "查看更改",
+ "show_in_git": "在 Git 中显示更改",
+ "more": "{thread} 的更多操作",
+ "maximize": "隐藏侧边栏",
+ "restore": "显示侧边栏",
+ "close": "关闭线程(移入归档)"
+ },
"layout_aria": "IDE 布局",
"layout_grid": "终端网格",
"layout_threads": "线程",
diff --git a/dodaios/ui/web/frontend/src/store/navSidebar.ts b/dodaios/ui/web/frontend/src/store/navSidebar.ts
new file mode 100644
index 0000000000..d1db7de71a
--- /dev/null
+++ b/dodaios/ui/web/frontend/src/store/navSidebar.ts
@@ -0,0 +1,35 @@
+import { create } from "zustand";
+
+/** Where the collapsed/expanded choice for the nav sidebar is remembered. */
+export const NAV_COLLAPSED_KEY = "jarvis.sidebar.collapsed.v1";
+
+function readCollapsed(): boolean {
+ try {
+ return window.localStorage.getItem(NAV_COLLAPSED_KEY) === "true";
+ } catch {
+ return false;
+ }
+}
+
+interface NavSidebarStore {
+ /** The sidebar is deliberately collapsed to its icon rail. */
+ collapsed: boolean;
+ setCollapsed: (collapsed: boolean) => void;
+}
+
+/**
+ * The app sidebar's rail state, shared so a view can make room for itself:
+ * the thread layout's maximize button folds the sidebar to its rail and back.
+ * A storage write that throws only means the choice does not survive a restart.
+ */
+export const useNavSidebarStore = create<NavSidebarStore>((set) => ({
+ collapsed: readCollapsed(),
+ setCollapsed: (collapsed) => {
+ try {
+ window.localStorage.setItem(NAV_COLLAPSED_KEY, String(collapsed));
+ } catch {
+ /* storage unavailable */
+ }
+ set({ collapsed });
+ },
+}));