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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(ui): repair the frontend suite and finish the auto-grow composer
rubenluetke10-beep664d660b8169
diff --git a/jarvis/ui/web/frontend/src/App.detached.test.tsx b/jarvis/ui/web/frontend/src/App.detached.test.tsxindex ddeae9d9d3..ff4e2c8f1f 100644--- a/jarvis/ui/web/frontend/src/App.detached.test.tsx+++ b/jarvis/ui/web/frontend/src/App.detached.test.tsx@@ -28,6 +28,9 @@ vi.mock("@/lib/dictationTarget", () => ({vi.mock("@/components/layout/Sidebar", () => ({SIDEBAR_DEFAULT_WIDTH: 280,SIDEBAR_RAIL_WIDTH: 56,+ // App.tsx remembers the sidebar width under this key, so the mock has to+ // carry it too or the shell throws before it renders anything.+ SIDEBAR_WIDTH_STORAGE_KEY: "jarvis.sidebar.width.v3",Sidebar: () => <aside data-testid="sidebar" />,}));vi.mock("@/components/layout/PaneResizer", () => ({diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsxindex 1ca3e7077d..77d34231b8 100644--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx@@ -30,10 +30,18 @@ const { paneRenders, paneActiveHistory } = vi.hoisted(() => ({}));const pushToast = vi.fn();-vi.mock("@/store/events", () => ({- useEventStore: (selector: (s: Record<string, unknown>) => unknown) =>- selector({ pushToast }),-}));+// `getState` is not optional: i18n's `translate()` reads the assistant name+// straight off the store rather than through a hook, so a mock without it+// throws on the first translated string this tree renders.+vi.mock("@/store/events", () => {+ // Built on each call, never at factory time: this factory is hoisted above+ // the `const pushToast` above it, so reading it eagerly is a TDZ error.+ const state = () => ({ pushToast, assistantName: "Jarvis" });+ const useEventStore = (selector: (s: Record<string, unknown>) => unknown) =>+ selector(state());+ useEventStore.getState = state;+ return { useEventStore };+});vi.mock("@/lib/agenticIdeApi", () => ({addTerminal: vi.fn(),diff --git a/jarvis/ui/web/frontend/src/hooks/useAutoGrowTextarea.ts b/jarvis/ui/web/frontend/src/hooks/useAutoGrowTextarea.tsindex e0a42446dd..ef356c8f25 100644--- a/jarvis/ui/web/frontend/src/hooks/useAutoGrowTextarea.ts+++ b/jarvis/ui/web/frontend/src/hooks/useAutoGrowTextarea.ts@@ -24,7 +24,16 @@ export function useAutoGrowTextarea(value: string): RefObject<HTMLTextAreaElemen// keep `scrollHeight` from reporting the shorter content.el.style.height = "auto";const content = el.scrollHeight;- if (content > 0) el.style.height = `${content}px`;+ if (content <= 0) return;+ // Read the cap off the element's own styling rather than hardcoding one,+ // so a composer can name its own max-height. Unset reads as "none", which+ // parses to NaN and leaves the box uncapped.+ const cap = Number.parseFloat(window.getComputedStyle(el).maxHeight);+ const capped = Number.isFinite(cap) && cap > 0;+ el.style.height = `${capped ? Math.min(content, cap) : content}px`;+ // Below the cap the box is exactly as tall as its text, so a scrollbar+ // would be a scrollbar over nothing. At the cap it has to scroll again.+ el.style.overflowY = capped && content > cap ? "auto" : "hidden";}, [value]);return ref;}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 6cebfd57e3..afebdd927b 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -134,7 +134,14 @@"group_label": "Anpassen","attention_dot": "Ein Plugin muss neu verbunden werden","tab_skills": "Skills",- "tab_tools": "Tools"+ "tab_tools": "Tools",+ "file_one": "1 Datei",+ "files": "{n} Dateien",+ "files_menu": "Dateien",+ "no_files": "Keine Dateien",+ "view_mode": "Ansicht",+ "view_preview": "Vorschau",+ "view_source": "Quelltext"},"taskbar_view": {"subtitle": "Bildschirm-Overlay-Aussehen und Diktier-Verhalten.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex b9eac16431..a73eb8bdcc 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -134,7 +134,14 @@"group_label": "Customize","attention_dot": "A plugin needs reconnecting","tab_skills": "Skills",- "tab_tools": "Tools"+ "tab_tools": "Tools",+ "file_one": "1 file",+ "files": "{n} files",+ "files_menu": "Files",+ "no_files": "No files",+ "view_mode": "View",+ "view_preview": "Preview",+ "view_source": "Source"},"taskbar_view": {"subtitle": "On-screen overlay appearance and dictation behaviour.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex d923d272d6..9c26eb9a90 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -134,7 +134,14 @@"group_label": "Personalizar","attention_dot": "Un plugin necesita reconectarse","tab_skills": "Habilidades",- "tab_tools": "Herramientas"+ "tab_tools": "Herramientas",+ "file_one": "1 archivo",+ "files": "{n} archivos",+ "files_menu": "Archivos",+ "no_files": "Sin archivos",+ "view_mode": "Vista",+ "view_preview": "Vista previa",+ "view_source": "Código"},"taskbar_view": {"subtitle": "Apariencia del overlay en pantalla y comportamiento al dictar.",diff --git a/jarvis/ui/web/frontend/src/reduced-motion.test.ts b/jarvis/ui/web/frontend/src/reduced-motion.test.tsindex 41ecdfd0ea..aad17a6b65 100644--- a/jarvis/ui/web/frontend/src/reduced-motion.test.ts+++ b/jarvis/ui/web/frontend/src/reduced-motion.test.ts@@ -20,12 +20,30 @@ import { describe, expect, it } from "vitest";const CSS = readFileSync(join(process.cwd(), "src", "index.css"), "utf8");-/** The last reduced-motion block in the file — the app-wide one. */+/**+ * The last reduced-motion block in the file, and only that block.+ *+ * Slicing to the end of the file instead would drag in whatever happens to be+ * written below it. That is not hypothetical: the "solid ground" rules were+ * appended after this block, and every unrelated declaration in them then+ * counted as a floor rule that had forgotten its `!important`. Match the+ * braces so the helper answers the question the tests actually ask.+ */function floorBlock(): string {const marker = "prefers-reduced-motion: reduce";const start = CSS.lastIndexOf(marker);expect(start).toBeGreaterThan(-1);- return CSS.slice(start);+ const open = CSS.indexOf("{", start);+ expect(open).toBeGreaterThan(-1);+ let depth = 0;+ for (let i = open; i < CSS.length; i += 1) {+ if (CSS[i] === "{") depth += 1;+ else if (CSS[i] === "}") {+ depth -= 1;+ if (depth === 0) return CSS.slice(start, i + 1);+ }+ }+ throw new Error("the reduced-motion block is not closed");}describe("the reduced-motion floor", () => {diff --git a/jarvis/ui/web/frontend/src/views/CliTestHubView.test.tsx b/jarvis/ui/web/frontend/src/views/CliTestHubView.test.tsxindex 71e6143202..fadb7e59fb 100644--- a/jarvis/ui/web/frontend/src/views/CliTestHubView.test.tsx+++ b/jarvis/ui/web/frontend/src/views/CliTestHubView.test.tsx@@ -207,10 +207,13 @@ describe("CliTestHubView — run flow (success)", () => {expect(screen.getByTestId("result-tool").textContent).toBe("cli_gcloud");// Risk badge reflects the tier.expect(screen.getByTestId("risk-badge").getAttribute("data-risk")).toBe("safe");- // Exit code 0 → green (data-exit "0").+ // Exit code 0 reads as a success. Since the Ink & Paper pass, success is+ // not a hue: the badge carries the code in `data-exit` and stays on the+ // muted token, and only a failure spends the destructive colour.const exit = screen.getByTestId("result-exit-code");expect(exit.getAttribute("data-exit")).toBe("0");- expect(exit.className).toContain("emerald");+ expect(exit.className).toContain("muted-foreground");+ expect(exit.className).not.toContain("destructive");// Duration.expect(screen.getByTestId("result-duration").textContent).toContain("1234");// stdout present, stderr absent.