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): expose terminal text size in toolbar

Ruben Lütkee0f35c971dfa
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
index 52700acb94..aff9ec82d6 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
@@ -2600,10 +2600,7 @@ describe("terminal text size", () => {
window.localStorage.removeItem(FONT_KEY);
});
- const openViewMenu = () =>
- fireEvent.click(screen.getByTestId("agentic-view-menu"));
-
- it("opens the panes at the size the backend remembers", async () => {
+ it("keeps the remembered size visible in the toolbar", async () => {
// The reason this comes from the backend and not from localStorage: the
// desktop window is a WebView that starts every run with empty browser
// storage, so a size kept only in the page is gone after each restart.
@@ -2619,16 +2616,15 @@ describe("terminal text size", () => {
await waitFor(() =>
expect(screen.getByTestId("pane-Mika").getAttribute("data-font-size")).toBe("17"),
);
- openViewMenu();
- expect(screen.getByTestId("agentic-view-menu-panel").textContent).toContain("17");
+ expect(screen.getByTestId("agentic-font-size-value").textContent).toBe("17");
+ expect(screen.queryByTestId("agentic-view-menu-panel")).toBeNull();
});
it("hands a newly chosen size to the backend", async () => {
renderGrid();
await waitFor(() => expect(api.fetchTerminalUiPreferences).toHaveBeenCalled());
- openViewMenu();
- fireEvent.click(screen.getByLabelText("Larger text"));
+ fireEvent.click(screen.getByLabelText("Larger terminal text"));
await waitFor(() => expect(api.saveTerminalFontSize).toHaveBeenCalledWith(14));
expect(screen.getByTestId("pane-Mika").getAttribute("data-font-size")).toBe("14");
@@ -2647,15 +2643,31 @@ describe("terminal text size", () => {
it("keeps working when the size cannot be read", async () => {
// An older backend, or a request that failed. The panes still open and the
- // buttons still resize them — only the memory is missing.
+ // buttons still resize them — only the memory is missing.
vi.mocked(api.fetchTerminalUiPreferences).mockRejectedValue(new Error("404"));
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
renderGrid();
await waitFor(() => expect(warn).toHaveBeenCalled());
- openViewMenu();
- fireEvent.click(screen.getByLabelText("Smaller text"));
+ fireEvent.click(screen.getByLabelText("Smaller terminal text"));
expect(screen.getByTestId("pane-Mika").getAttribute("data-font-size")).toBe("12");
warn.mockRestore();
});
+
+ it("disables the visible control at the supported maximum", async () => {
+ vi.mocked(api.fetchTerminalUiPreferences).mockResolvedValue({
+ terminal_font_size: 20,
+ stored: true,
+ min: 10,
+ max: 20,
+ default: 13,
+ });
+ renderGrid();
+
+ const larger = await screen.findByLabelText("Larger terminal text");
+ await waitFor(() => expect((larger as HTMLButtonElement).disabled).toBe(true));
+ expect((screen.getByLabelText("Smaller terminal text") as HTMLButtonElement).disabled).toBe(
+ false,
+ );
+ });
});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
index 3eae890aea..f071af6812 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.tsx
@@ -1797,13 +1797,15 @@ export function AgenticGrid({
)}
</button>
- {/* Terminal appearance and text size, one quiet button away. They are
- set-and-forget preferences, not moment-to-moment controls — kept
- permanently on the bar they cost seven bordered buttons of noise
- for something touched once a week. */}
+ {/* Appearance stays behind one quiet menu; text size is deliberately
+ exposed beside it. Somebody opening this workspace because the
+ terminal is too small must be able to find the remedy without
+ already knowing which anonymous glyph hides it. */}
<ViewMenu
appearance={appearance}
onAppearance={setAppearance}
+ />
+ <TerminalFontSizeControl
fontSize={fontSize}
onFontSize={setFontSize}
/>
@@ -2611,33 +2613,28 @@ export function AgenticGrid({
}
/**
- * Terminal appearance and text size, behind one quiet toolbar button.
+ * Terminal appearance, behind one quiet toolbar button.
*
- * Both are remembered per browser profile and touched about once a week, so
- * they earn a menu rather than seven permanent buttons on the bar. The controls
- * inside keep the exact labels the standalone buttons had — a screen reader and
- * a muscle memory both find the same names one click deeper.
+ * Theme is a set-and-forget preference, unlike text size: the latter is an
+ * accessibility control and remains visible beside this menu.
*/
function ViewMenu({
appearance,
onAppearance,
- fontSize,
- onFontSize,
}: {
appearance: TerminalAppearance;
onAppearance: (next: TerminalAppearance) => void;
- fontSize: number;
- onFontSize: (next: number) => void;
}) {
+ const t = useT();
const [open, setOpen] = useState(false);
return (
<div className="relative shrink-0">
<button
type="button"
- aria-label="Terminal appearance and text size"
+ aria-label={t("agentic_grid.display.appearance")}
aria-expanded={open}
data-testid="agentic-view-menu"
- title="Terminal appearance and text size"
+ title={t("agentic_grid.display.appearance")}
onClick={() => setOpen((value) => !value)}
className={cn(TOOLBAR_BTN, open && "bg-secondary text-foreground")}
>
@@ -2652,11 +2649,13 @@ function ViewMenu({
className="absolute right-0 top-full z-50 mt-1 w-60 rounded-xl border border-border bg-card p-3 shadow-xl"
>
<div className="flex items-center justify-between gap-3">
- <span className="text-xs text-muted-foreground">Terminals</span>
+ <span className="text-xs text-muted-foreground">
+ {t("agentic_grid.display.appearance")}
+ </span>
<div className="flex items-center gap-0.5 rounded-md border border-border p-0.5">
<button
type="button"
- aria-label="Light terminals"
+ aria-label={t("agentic_grid.display.light")}
aria-pressed={appearance === "light"}
onClick={() => onAppearance("light")}
className={cn(
@@ -2670,7 +2669,7 @@ function ViewMenu({
</button>
<button
type="button"
- aria-label="Dark terminals"
+ aria-label={t("agentic_grid.display.dark")}
aria-pressed={appearance === "dark"}
onClick={() => onAppearance("dark")}
className={cn(
@@ -2684,33 +2683,6 @@ function ViewMenu({
</button>
</div>
</div>
- <div className="mt-2 flex items-center justify-between gap-3">
- <span className="flex items-center gap-1.5 text-xs text-muted-foreground">
- <Type className="h-3.5 w-3.5" />
- Text size
- </span>
- <div className="flex items-center gap-0.5 rounded-md border border-border p-0.5">
- <button
- type="button"
- aria-label="Smaller text"
- onClick={() => onFontSize(Math.max(FONT_MIN, fontSize - 1))}
- className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground"
- >
- <Minus className="h-3.5 w-3.5" />
- </button>
- <span className="w-8 text-center font-mono text-[11px] text-foreground">
- {fontSize}
- </span>
- <button
- type="button"
- aria-label="Larger text"
- onClick={() => onFontSize(Math.min(FONT_MAX, fontSize + 1))}
- className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground"
- >
- <Plus className="h-3.5 w-3.5" />
- </button>
- </div>
- </div>
</div>
</>
)}
@@ -2718,6 +2690,56 @@ function ViewMenu({
);
}
+/** Always-visible terminal text sizing for the active workspace. */
+function TerminalFontSizeControl({
+ fontSize,
+ onFontSize,
+}: {
+ fontSize: number;
+ onFontSize: (next: number) => void;
+}) {
+ const t = useT();
+ const smaller = fontSize <= FONT_MIN;
+ const larger = fontSize >= FONT_MAX;
+
+ 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")}
+ 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" />
+ <button
+ type="button"
+ aria-label={t("agentic_grid.display.smaller")}
+ disabled={smaller}
+ onClick={() => onFontSize(Math.max(FONT_MIN, fontSize - 1))}
+ className="flex h-7 w-6 items-center justify-center text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 disabled:cursor-not-allowed disabled:opacity-35"
+ >
+ <Minus className="h-3.5 w-3.5" />
+ </button>
+ <span
+ aria-live="polite"
+ data-testid="agentic-font-size-value"
+ className="w-7 text-center font-mono text-[11px] tabular-nums text-foreground"
+ >
+ {fontSize}
+ </span>
+ <button
+ type="button"
+ aria-label={t("agentic_grid.display.larger")}
+ disabled={larger}
+ onClick={() => onFontSize(Math.min(FONT_MAX, fontSize + 1))}
+ className="flex h-7 w-6 items-center justify-center rounded-r-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 disabled:cursor-not-allowed disabled:opacity-35"
+ >
+ <Plus className="h-3.5 w-3.5" />
+ </button>
+ </div>
+ );
+}
+
/**
* The files waiting to go in with the next prompt.
*
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 2d29f42fc1..7031261ca2 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -3695,6 +3695,14 @@
"confirm": "Ausgewählte schließen",
"close_failed": "Diese Terminals konnten nicht geschlossen werden: {0}"
},
+ "display": {
+ "appearance": "Terminal-Darstellung",
+ "light": "Helle Terminals",
+ "dark": "Dunkle Terminals",
+ "text_size": "Terminal-Schriftgröße",
+ "smaller": "Terminal-Schrift verkleinern",
+ "larger": "Terminal-Schrift vergrößern"
+ },
"notifications": {
"title": "Benachrichtigungen",
"hint": "Terminals, die fertig sind, etwas fragen oder gestoppt haben.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 8411273120..855697ce72 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -3696,6 +3696,14 @@
"confirm": "Close selected",
"close_failed": "These terminals could not be closed: {0}"
},
+ "display": {
+ "appearance": "Terminal appearance",
+ "light": "Light terminals",
+ "dark": "Dark terminals",
+ "text_size": "Terminal text size",
+ "smaller": "Smaller terminal text",
+ "larger": "Larger terminal text"
+ },
"notifications": {
"title": "Notifications",
"hint": "Terminals that finished, asked something, or stopped.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 9bec1d647d..43c394fd15 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -3695,6 +3695,14 @@
"confirm": "Cerrar seleccionados",
"close_failed": "No se pudieron cerrar estos terminales: {0}"
},
+ "display": {
+ "appearance": "Apariencia del terminal",
+ "light": "Terminales claros",
+ "dark": "Terminales oscuros",
+ "text_size": "Tamaño del texto del terminal",
+ "smaller": "Reducir el texto del terminal",
+ "larger": "Ampliar el texto del terminal"
+ },
"notifications": {
"title": "Notificaciones",
"hint": "Terminales que han terminado, preguntan algo o se han detenido.",