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.

fix(ui): repair broken interactive controls

rubenluetke10-beep14e9208e389d
diff --git a/jarvis/ui/web/frontend/src/__tests__/i18nNameInterpolation.test.tsx b/jarvis/ui/web/frontend/src/__tests__/i18nNameInterpolation.test.tsx
index dc350aa268..29c91cb7bc 100644
--- a/jarvis/ui/web/frontend/src/__tests__/i18nNameInterpolation.test.tsx
+++ b/jarvis/ui/web/frontend/src/__tests__/i18nNameInterpolation.test.tsx
@@ -7,7 +7,7 @@
import { act, cleanup, render, screen } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
-import { interpolateName, useT } from "@/i18n";
+import { interpolateName, useI18nStore, useT } from "@/i18n";
import { useEventStore } from "@/store/events";
describe("interpolateName (pure)", () => {
@@ -31,9 +31,19 @@ function RestartHintProbe() {
return <span data-testid="hint">{t("topbar.restart_hint")}</span>;
}
+function CommandDeckProbe() {
+ const t = useT();
+ return (
+ <span data-testid="command-deck-copy">
+ {t("workspace_launcher.wizard.views.deck.description")}
+ </span>
+ );
+}
+
describe("useT name substitution", () => {
beforeEach(() => {
useEventStore.setState({ assistantName: "Assistant" });
+ useI18nStore.getState().setUi("en", { push: false });
});
afterEach(() => cleanup());
@@ -63,4 +73,18 @@ describe("useT name substitution", () => {
expect(screen.getByTestId("hint").textContent).toBe("Restart Athena");
});
+
+ it.each(["en", "de", "es"] as const)(
+ "brands the %s Command Deck wizard with a nonstandard assistant name",
+ (language) => {
+ useI18nStore.getState().setUi(language, { push: false });
+ useEventStore.setState({ assistantName: "Athena" });
+ render(<CommandDeckProbe />);
+
+ const text = screen.getByTestId("command-deck-copy").textContent ?? "";
+ expect(text).toContain("Athena");
+ expect(text).not.toContain("{name}");
+ expect(text).not.toContain("Jarvis");
+ },
+ );
});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
index a945b1cbb0..8cde1992b7 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/WorkspaceLauncher.tsx
@@ -81,32 +81,41 @@ type LauncherStep = 0 | 1 | 2 | 3 | 4;
const STEPS = [
{
- label: "Folder",
- title: "Choose the project folder",
- hint: "Everything the agents do stays inside this folder.",
+ id: "folder",
+ label: "workspace_launcher.wizard.steps.folder.label",
+ title: "workspace_launcher.wizard.steps.folder.title",
+ hint: "workspace_launcher.wizard.steps.folder.hint",
},
{
- label: "Layout",
- title: "Shape the workspace",
- hint: "Choose how many independent terminal panes should open.",
+ id: "layout",
+ label: "workspace_launcher.wizard.steps.layout.label",
+ title: "workspace_launcher.wizard.steps.layout.title",
+ hint: "workspace_launcher.wizard.steps.layout.hint",
},
{
- label: "Agents",
- title: "Choose the coding agents",
- hint: "Distribute all terminal slots at once instead of editing every pane.",
+ id: "agents",
+ label: "workspace_launcher.wizard.steps.agents.label",
+ title: "workspace_launcher.agents.step_title",
+ hint: "workspace_launcher.agents.step_hint",
},
{
- label: "View",
- title: "Choose how to read the workspace",
- hint: "The same agents either way — the toolbar switches between the two at any time.",
+ id: "view",
+ label: "workspace_launcher.wizard.steps.view.label",
+ title: "workspace_launcher.wizard.steps.view.title",
+ hint: "workspace_launcher.wizard.steps.view.hint",
},
{
- label: "Review",
- title: "Review before opening",
- hint: "Nothing starts until you open the workspace.",
+ id: "review",
+ label: "workspace_launcher.wizard.steps.review.label",
+ title: "workspace_launcher.wizard.steps.review.title",
+ hint: "workspace_launcher.wizard.steps.review.hint",
},
] as const;
+export function workspaceLaunchShortcut(platform = navigator.platform): string {
+ return /mac/i.test(platform) ? "⌘↵" : "Ctrl+↵";
+}
+
export function WorkspaceLauncher({
addingNew,
busy,
@@ -166,10 +175,8 @@ export function WorkspaceLauncher({
}, [busy, onStart, ready, step]);
const active = STEPS[step];
- const activeTitle =
- step === 2 ? t("workspace_launcher.agents.step_title") : active.title;
- const activeHint =
- step === 2 ? t("workspace_launcher.agents.step_hint") : active.hint;
+ const activeTitle = t(active.title);
+ const activeHint = t(active.hint);
return (
<div
@@ -180,9 +187,15 @@ export function WorkspaceLauncher({
<div className="mx-auto flex w-full max-w-6xl items-start justify-between gap-6">
<div className="min-w-0">
<p className="text-[11px] font-semibold uppercase tracking-[0.16em] text-primary/80">
- {addingNew ? "Additional workspace" : "New workspace"}
+ {t(
+ addingNew
+ ? "workspace_launcher.wizard.additional_workspace"
+ : "workspace_launcher.wizard.new_workspace",
+ )}
<span className="px-2 text-muted-foreground/50">/</span>
- Step {step + 1} of {STEPS.length}
+ {t("workspace_launcher.wizard.step_progress")
+ .replace("{0}", String(step + 1))
+ .replace("{1}", String(STEPS.length))}
</p>
<h2
id="workspace-launcher-title"
@@ -193,7 +206,7 @@ export function WorkspaceLauncher({
<p className="mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground">
{activeHint}
{addingNew && step === 0
- ? " Your open workspaces keep running."
+ ? ` ${t("workspace_launcher.wizard.running_notice")}`
: ""}
</p>
</div>
@@ -215,11 +228,10 @@ export function WorkspaceLauncher({
{!terminalAvailable && (
<Notice tone="error">
<span>
- This machine has no usable terminal backend, so agent panes
- cannot run here —{" "}
- <code className="font-mono">pywinpty</code> on Windows,{" "}
- <code className="font-mono">ptyprocess</code> on macOS and
- Linux. Both ship with the desktop extra.
+ {t("workspace_launcher.wizard.terminal_unavailable_before")} {" "}
+ <code className="font-mono">pywinpty</code> (Windows),{" "}
+ <code className="font-mono">ptyprocess</code> (macOS/Linux).{" "}
+ {t("workspace_launcher.wizard.terminal_unavailable_after")}
</span>
</Notice>
)}
@@ -227,15 +239,14 @@ export function WorkspaceLauncher({
{nothingInstalled && (
<Notice tone="warning">
<span>
- No coding-agent CLI was found on this machine’s PATH.
- Install one and it is picked up automatically.
+ {t("workspace_launcher.wizard.no_cli")}
</span>
<Button
variant="subtle"
className="h-6 px-2 text-amber-200/90"
onClick={onOpenClis}
>
- Open CLIs
+ {t("workspace_launcher.wizard.open_clis")}
</Button>
</Notice>
)}
@@ -280,7 +291,9 @@ export function WorkspaceLauncher({
<div>
<div className="flex items-end justify-between gap-5 border-b border-border/70 pb-5">
<div>
- <SectionLabel>Terminal panes</SectionLabel>
+ <SectionLabel>
+ {t("workspace_launcher.wizard.terminal_panes")}
+ </SectionLabel>
<p className="mt-2 font-mono text-4xl font-medium tabular-nums text-foreground">
{count.toString().padStart(2, "0")}
</p>
@@ -331,7 +344,7 @@ export function WorkspaceLauncher({
onClick={() => setStep((step - 1) as LauncherStep)}
>
<ArrowLeft className="h-3.5 w-3.5" />
- Back
+ {t("workspace_launcher.wizard.back")}
</Button>
) : (
<span />
@@ -345,12 +358,12 @@ export function WorkspaceLauncher({
className="px-4"
>
{step === 0
- ? "Continue to layout"
+ ? t("workspace_launcher.wizard.continue_layout")
: step === 1
- ? "Continue to agents"
+ ? t("workspace_launcher.wizard.continue_agents")
: step === 2
- ? "Choose the view"
- : "Review workspace"}
+ ? t("workspace_launcher.wizard.choose_view")
+ : t("workspace_launcher.wizard.review_workspace")}
<ArrowRight className="h-3.5 w-3.5" />
</Button>
) : (
@@ -361,10 +374,12 @@ export function WorkspaceLauncher({
className="min-w-40 px-4"
>
{busy && <Loader2 className="h-3.5 w-3.5 animate-spin" />}
- {busy ? "Opening…" : "Open workspace"}
+ {busy
+ ? t("workspace_launcher.wizard.opening")
+ : t("workspace_launcher.wizard.open_workspace")}
{!busy && (
<kbd className="ml-1 hidden font-mono text-[10px] font-normal opacity-60 sm:inline">
- ⌘↵
+ {workspaceLaunchShortcut()}
</kbd>
)}
</Button>
@@ -399,29 +414,36 @@ function StepNavigation({
const assigned = planned.filter((pane) => Boolean(pane.agent)).length;
const summaries = useMemo(
() => [
- folder ? leafName(folder) : "Not chosen",
- `${count} terminal${count === 1 ? "" : "s"}`,
+ folder ? leafName(folder) : t("workspace_launcher.wizard.not_chosen"),
+ t(
+ count === 1
+ ? "workspace_launcher.wizard.one_terminal"
+ : "workspace_launcher.wizard.many_terminals",
+ ).replace("{0}", String(count)),
t("workspace_launcher.agents.nav_summary")
.replace("{0}", String(assigned))
.replace("{1}", String(planned.length)),
- VIEW_NAMES[view],
- "Check and open",
+ t(`workspace_launcher.wizard.views.${view}.title`),
+ t("workspace_launcher.wizard.check_and_open"),
],
[assigned, count, folder, planned.length, t, view],
);
return (
- <nav aria-label="Workspace setup" className="min-w-0">
+ <nav
+ aria-label={t("workspace_launcher.wizard.setup_label")}
+ className="min-w-0"
+ >
<ol className="grid grid-cols-5 border-b border-border/70 lg:flex lg:flex-col lg:border-b-0 lg:border-r lg:pr-6">
{STEPS.map((item, index) => {
const target = index as LauncherStep;
const selected = target === step;
const enabled = canVisit(target);
return (
- <li key={item.label}>
+ <li key={item.id}>
<button
type="button"
- data-testid={`launcher-step-${item.label.toLowerCase()}`}
+ data-testid={`launcher-step-${item.id}`}
aria-current={selected ? "step" : undefined}
disabled={!enabled}
onClick={() => onStep(target)}
@@ -441,7 +463,7 @@ function StepNavigation({
0{index + 1}
</span>
<span className="mt-1 block truncate text-sm font-medium">
- {item.label}
+ {t(item.label)}
</span>
<span className="mt-0.5 hidden truncate text-[11px] text-muted-foreground lg:block">
{summaries[index]}
@@ -455,13 +477,6 @@ function StepNavigation({
);
}
-/** The user-facing names of the three reading modes, shared by every step. */
-const VIEW_NAMES: Record<WorkspaceView, string> = {
- grid: "Terminal grid",
- chat: "Chat view",
- deck: "Command Deck",
-};
-
/**
* The last decision before review: how the workspace is read.
*
@@ -482,12 +497,13 @@ function ViewChoice({
view: WorkspaceView;
onView: (next: WorkspaceView) => void;
}) {
+ const t = useT();
return (
<div>
- <SectionLabel>Reading mode</SectionLabel>
+ <SectionLabel>{t("workspace_launcher.wizard.reading_mode")}</SectionLabel>
<div
role="radiogroup"
- aria-label="How the workspace opens"
+ aria-label={t("workspace_launcher.wizard.reading_mode_label")}
className="mt-4 grid gap-4 sm:grid-cols-3"
>
<ViewOption
@@ -495,8 +511,8 @@ function ViewChoice({
onSelect={() => onView("grid")}
testId="view-choice-grid"
icon={<LayoutGrid className="h-4 w-4 shrink-0" />}
- title={VIEW_NAMES.grid}
- description="Every pane on screen at once, side by side — the full wall of terminals."
+ title={t("workspace_launcher.wizard.views.grid.title")}
+ description={t("workspace_launcher.wizard.views.grid.description")}
preview={<GridPreview />}
/>
<ViewOption
@@ -504,8 +520,8 @@ function ViewChoice({
onSelect={() => onView("chat")}
testId="view-choice-chat"
icon={<MessagesSquare className="h-4 w-4 shrink-0" />}
- title={VIEW_NAMES.chat}
- description="One agent at a time on a calm stage, the rest on a rail — read like a conversation."
+ title={t("workspace_launcher.wizard.views.chat.title")}
+ description={t("workspace_launcher.wizard.views.chat.description")}
preview={<ChatPreview />}
/>
<ViewOption
@@ -513,16 +529,13 @@ function ViewChoice({
onSelect={() => onView("deck")}
testId="view-choice-deck"
icon={<AudioLines className="h-4 w-4 shrink-0" />}
- title={VIEW_NAMES.deck}
- description="You brief by voice, Jarvis runs the floor — and tells you when an agent is done."
+ title={t("workspace_launcher.wizard.views.deck.title")}
+ description={t("workspace_launcher.wizard.views.deck.description")}
preview={<DeckPreview />}
/>
</div>
<p className="mt-5 max-w-2xl text-xs leading-relaxed text-muted-foreground">
- Only how the workspace is read changes — the agents, panes and
- conversations are the same in all three, and the workspace toolbar
- switches between them whenever you like. The Command Deck also speaks:
- it reports a finished agent out loud, one at a time.
+ {t("workspace_launcher.wizard.view_hint")}
</p>
</div>
);
@@ -545,6 +558,7 @@ function ViewOption({
description: string;
preview: ReactNode;
}) {
+ const t = useT();
return (
<button
type="button"
@@ -570,7 +584,7 @@ function ViewOption({
{title}
{selected && (
<span className="ml-auto text-[10px] font-semibold uppercase tracking-[0.14em] text-primary">
- Selected
+ {t("workspace_launcher.wizard.selected")}
</span>
)}
</span>
@@ -655,13 +669,14 @@ function WorkspaceReview({
agents: AgentStatus[];
view: WorkspaceView;
}) {
+ const t = useT();
const displayName = (agentId: string) =>
agents.find((agent) => agent.name === agentId)?.display_name ?? agentId;
return (
<div className="grid gap-8 lg:grid-cols-[minmax(0,1.1fr)_minmax(18rem,0.9fr)]">
<div className="min-w-0">
- <SectionLabel>Workspace</SectionLabel>
+ <SectionLabel>{t("workspace_launcher.wizard.workspace")}</SectionLabel>
<h4 className="mt-3 truncate text-2xl font-semibold tracking-tight text-foreground">
{leafName(folder)}
</h4>
@@ -671,26 +686,34 @@ function WorkspaceReview({
<dl className="mt-7 border-y border-border/70">
<div className="flex items-center justify-between gap-5 border-b border-border/50 py-3 text-sm">
- <dt className="text-muted-foreground">Terminal panes</dt>
+ <dt className="text-muted-foreground">
+ {t("workspace_launcher.wizard.terminal_panes")}
+ </dt>
<dd className="font-mono tabular-nums text-foreground">
{planned.length}
</dd>
</div>
<div className="flex items-center justify-between gap-5 border-b border-border/50 py-3 text-sm">
- <dt className="text-muted-foreground">Opens as</dt>
+ <dt className="text-muted-foreground">
+ {t("workspace_launcher.wizard.opens_as")}
+ </dt>
<dd className="text-foreground" data-testid="review-view-mode">
- {VIEW_NAMES[view]}
+ {t(`workspace_launcher.wizard.views.${view}.title`)}
</dd>
</div>
<div className="flex items-center justify-between gap-5 py-3 text-sm">
- <dt className="text-muted-foreground">Coding mode</dt>
- <dd className="text-foreground">Turns on when opened</dd>
+ <dt className="text-muted-foreground">
+ {t("workspace_launcher.wizard.coding_mode")}
+ </dt>
+ <dd className="text-foreground">
+ {t("workspace_launcher.wizard.coding_mode_on_open")}
+ </dd>
</div>
</dl>
</div>
<div className="min-w-0">
- <SectionLabel>Terminal plan</SectionLabel>
+ <SectionLabel>{t("workspace_launcher.wizard.terminal_plan")}</SectionLabel>
<ol className="mt-3 border-t border-border/70">
{planned.map((pane, index) => (
<li
diff --git a/jarvis/ui/web/frontend/src/components/board/ShareDialog.test.tsx b/jarvis/ui/web/frontend/src/components/board/ShareDialog.test.tsx
index fdd28117d4..e11e95aeb2 100644
--- a/jarvis/ui/web/frontend/src/components/board/ShareDialog.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/board/ShareDialog.test.tsx
@@ -19,6 +19,8 @@ import {
} from "@testing-library/react";
import { ShareDialog } from "@/components/board/ShareDialog";
+import { shareToX } from "@/lib/shareImage";
+import { toBlob } from "html-to-image";
vi.mock("html-to-image", () => ({
toBlob: vi.fn(async () => new Blob(["png"], { type: "image/png" })),
@@ -32,9 +34,42 @@ const STATS = {
longestStreak: 23,
};
+function installImageClipboard(): ReturnType<typeof vi.fn> {
+ const write = vi.fn(async () => {});
+ (globalThis as unknown as { ClipboardItem: unknown }).ClipboardItem = class {
+ constructor(public items: unknown) {}
+ };
+ Object.defineProperty(navigator, "clipboard", {
+ configurable: true,
+ value: { write },
+ });
+ return write;
+}
+
+function installComposerWindow() {
+ const handle = {
+ opener: globalThis,
+ location: { replace: vi.fn() },
+ close: vi.fn(),
+ } as unknown as Window;
+ const replace = vi.mocked(handle.location.replace);
+ replace.mockImplementation(() => {
+ expect(handle.opener).toBeNull();
+ });
+ const open = vi.spyOn(globalThis, "open").mockReturnValue(handle);
+ return { handle, open, replace };
+}
+
afterEach(() => {
cleanup();
vi.restoreAllMocks();
+ (globalThis as unknown as { ClipboardItem: unknown }).ClipboardItem = undefined;
+ for (const property of ["clipboard", "canShare", "share"] as const) {
+ Object.defineProperty(navigator, property, {
+ configurable: true,
+ value: undefined,
+ });
+ }
try {
localStorage.clear();
} catch {
@@ -60,15 +95,7 @@ describe("ShareDialog", () => {
});
it("Copy Image writes a PNG to the clipboard and shows a status", async () => {
- const write = vi.fn(async () => {});
- // jsdom lacks ClipboardItem — provide a minimal stand-in.
- (globalThis as unknown as { ClipboardItem: unknown }).ClipboardItem = class {
- constructor(public items: unknown) {}
- };
- Object.defineProperty(navigator, "clipboard", {
- configurable: true,
- value: { write },
- });
+ const write = installImageClipboard();
render(<ShareDialog open onOpenChange={() => {}} stats={STATS} />);
fireEvent.click(screen.getByTestId("share-copy"));
@@ -86,4 +113,86 @@ describe("ShareDialog", () => {
expect(localStorage.getItem("board.share.handle")).toBe("ruben");
expect(screen.getAllByText(/@ruben/).length).toBeGreaterThan(0);
});
+
+ it("opens the X composer before a pending image render resolves", async () => {
+ installImageClipboard();
+ let finishRender: ((blob: Blob) => void) | undefined;
+ vi.mocked(toBlob).mockReturnValueOnce(
+ new Promise<Blob>((resolve) => {
+ finishRender = resolve;
+ }),
+ );
+ const { handle, open, replace } = installComposerWindow();
+
+ render(<ShareDialog open onOpenChange={() => {}} stats={STATS} />);
+ fireEvent.click(screen.getByTestId("share-x"));
+
+ expect(open).toHaveBeenCalledWith("", "_blank");
+ expect(handle.opener).toBeNull();
+ expect(String(replace.mock.calls[0][0])).toContain("twitter.com/intent/tweet");
+ expect(screen.getByTestId("share-status").textContent).toContain("Generating");
+
+ finishRender?.(new Blob(["png"], { type: "image/png" }));
+ await waitFor(() => {
+ expect(screen.getByTestId("share-status").textContent).toContain(
+ "Image copied",
+ );
+ });
+ });
+
+ it("reports when X opens but the clipboard image is unavailable", async () => {
+ const { open } = installComposerWindow();
+
+ render(<ShareDialog open onOpenChange={() => {}} stats={STATS} />);
+ fireEvent.click(screen.getByTestId("share-x"));
+
+ await waitFor(() => {
+ expect(screen.getByTestId("share-status").textContent).toContain(
+ "image could not be copied",
+ );
+ });
+ expect(open).toHaveBeenCalledTimes(1);
+ expect(screen.getByTestId("share-status").textContent).not.toContain(
+ "Image copied",
+ );
+ });
+
+ it("starts native Web Share synchronously for an existing Blob", async () => {
+ let finishShare: (() => void) | undefined;
+ const share = vi.fn(
+ () =>
+ new Promise<void>((resolve) => {
+ finishShare = resolve;
+ }),
+ );
+ Object.defineProperty(navigator, "canShare", {
+ configurable: true,
+ value: vi.fn(() => true),
+ });
+ Object.defineProperty(navigator, "share", {
+ configurable: true,
+ value: share,
+ });
+ const open = vi.spyOn(globalThis, "open");
+
+ const result = shareToX(new Blob(["png"], { type: "image/png" }), "stats");
+
+ expect(share).toHaveBeenCalledTimes(1);
+ expect(open).not.toHaveBeenCalled();
+ finishShare?.();
+ await expect(result).resolves.toBe("shared");
+ });
+
+ it("reports blocked only when the synchronous blank-window handle is null", async () => {
+ installImageClipboard();
+ const open = vi.spyOn(globalThis, "open").mockReturnValue(null);
+
+ const result = shareToX(
+ Promise.resolve(new Blob(["png"], { type: "image/png" })),
+ "stats",
+ );
+
+ expect(open).toHaveBeenCalledWith("", "_blank");
+ await expect(result).resolves.toBe("blocked");
+ });
});
diff --git a/jarvis/ui/web/frontend/src/components/board/ShareDialog.tsx b/jarvis/ui/web/frontend/src/components/board/ShareDialog.tsx
index 0fa82a82fe..a41453b945 100644
--- a/jarvis/ui/web/frontend/src/components/board/ShareDialog.tsx
+++ b/jarvis/ui/web/frontend/src/components/board/ShareDialog.tsx
@@ -143,20 +143,38 @@ export function ShareDialog({ open, onOpenChange, stats }: Props) {
const onShareX = () =>
run(async () => {
- const res = await shareToX(await ensureBlob(), buildShareText(stats));
+ // Pass the pending render through without awaiting it here. shareToX
+ // opens the composer synchronously while this click still owns a browser
+ // user gesture, then finishes staging the image on the clipboard.
+ const res = await shareToX(
+ blobRef.current ?? ensureBlob(),
+ buildShareText(stats),
+ );
switch (res) {
case "shared":
setStatus({ kind: "ok", msgKey: "board_view.share.status_shared" });
break;
case "dismissed":
- setStatus({ kind: "idle" }); // user cancelled — clear the spinner, stay quiet
+ setStatus({ kind: "idle" });
break;
case "composer":
setStatus({ kind: "ok", msgKey: "board_view.share.status_composer" });
break;
+ case "composer_without_image":
+ setStatus({
+ kind: "error",
+ msgKey: "board_view.share.status_composer_without_image",
+ });
+ break;
case "blocked":
setStatus({ kind: "error", msgKey: "board_view.share.status_blocked" });
break;
+ case "blocked_without_image":
+ setStatus({
+ kind: "error",
+ msgKey: "board_view.share.status_blocked_without_image",
+ });
+ break;
default:
setStatus({ kind: "error", msgKey: "board_view.share.status_error" });
}
diff --git a/jarvis/ui/web/frontend/src/components/board/ToolBarChart.tsx b/jarvis/ui/web/frontend/src/components/board/ToolBarChart.tsx
index 165b6890e0..787c0f5ed9 100644
--- a/jarvis/ui/web/frontend/src/components/board/ToolBarChart.tsx
+++ b/jarvis/ui/web/frontend/src/components/board/ToolBarChart.tsx
@@ -40,7 +40,10 @@ export function ToolBarChart({ histogram, limit = 15 }: ToolBarChartProps) {
return (
<div style={{ width: "100%", height }}>
- <ResponsiveContainer>
+ <ResponsiveContainer
+ minWidth={0}
+ initialDimension={{ width: 640, height }}
+ >
<BarChart
data={data}
layout="vertical"
diff --git a/jarvis/ui/web/frontend/src/components/board/WordsTrendChart.tsx b/jarvis/ui/web/frontend/src/components/board/WordsTrendChart.tsx
index 9e52a21590..92b0c9a18c 100644
--- a/jarvis/ui/web/frontend/src/components/board/WordsTrendChart.tsx
+++ b/jarvis/ui/web/frontend/src/components/board/WordsTrendChart.tsx
@@ -56,7 +56,13 @@ export function WordsTrendChart({ cells, days = 45 }: WordsTrendChartProps) {
// grid/flex parent: without a positive floor the first measure is 0×0, the
// Area paths bake in a collapsed scale, and the ResizeObserver re-measure
// recovers the axes but not the (animated) fills — leaving an empty chart.
- <ResponsiveContainer width="100%" height="100%" minHeight={176}>
+ <ResponsiveContainer
+ width="100%"
+ height="100%"
+ minHeight={176}
+ minWidth={0}
+ initialDimension={{ width: 640, height: 176 }}
+ >
<AreaChart data={data} margin={{ top: 6, right: 2, bottom: 0, left: 2 }}>
<defs>
<linearGradient id="board-grad-you" x1="0" y1="0" x2="0" y2="1">
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 9adb02a34d..1e56c42ac7 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -843,9 +843,11 @@
"status_saved": "jarvis-stats.png gespeichert.",
"status_copy_unsupported": "Kopieren wird hier nicht unterstützt — PNG stattdessen gespeichert.",
"status_composer": "Bild kopiert — im X-Editor einfügen.",
+ "status_composer_without_image": "X wurde geöffnet, aber das Bild konnte nicht kopiert werden. Speichere das PNG und hänge es manuell an.",
"status_error": "Bild konnte nicht erstellt werden. Versuch es nochmal.",
"status_shared": "Geteilt.",
"status_blocked": "X ließ sich nicht öffnen — das Bild ist in der Zwischenablage, öffne x.com und füge es ein.",
+ "status_blocked_without_image": "X ließ sich nicht öffnen und das Bild konnte nicht kopiert werden. Speichere das PNG und hänge es auf x.com manuell an.",
"card": {
"brand": "PERSONAL JARVIS",
"hero_label": "Wörter gesprochen",
@@ -2922,6 +2924,8 @@
"capture_in_progress": "In Arbeit",
"capture_session_sweeps": "Sitzungsprüfungen",
"capture_store_unavailable": "Erfassungsdatenbank nicht verfügbar",
+ "capture_store_error": "Erfassungsdatenbank nicht verfügbar: {0}",
+ "capture_failed_detail": "{0} Erfassungsvorgänge sind in diesem Zeitraum fehlgeschlagen.",
"checking": "Wiki-Zustand wird geprüft…",
"unavailable": "Wiki-Zustandsprüfung nicht verfügbar",
"vault_prefix": "Vault: {0}",
@@ -2935,6 +2939,7 @@
"reindex": "Index neu aufbauen",
"reindexing": "Index wird aufgebaut...",
"reindex_failed": "Der Wiki-Suchindex konnte nicht neu aufgebaut werden.",
+ "reindex_failed_detail": "Indexaufbau fehlgeschlagen: {0}",
"bootstrap_failed": "Bootstrap fehlgeschlagen: {0}",
"bootstrap_failed_unknown": "Bootstrap fehlgeschlagen",
"chain_failure": "Kettenfehler: {0}",
@@ -3397,6 +3402,11 @@
"title": "Fähigkeits-Slots",
"storage_title": "Speicher",
"storage_desc": "Wo der Wissensspeicher liegt.",
+ "storage_sqlite": "SQLite (lokal, empfohlen)",
+ "storage_postgres": "PostgreSQL",
+ "storage_postgres_hint": "Hinterlege die PostgreSQL-Verbindungszeichenfolge unter API-Schlüssel, bevor du dieses Backend aktivierst.",
+ "open_api_keys": "API-Schlüssel öffnen",
+ "not_ready_suffix": "nicht bereit",
"in_use": "In Benutzung: {0}",
"embedding_title": "Embedding-Modell",
"embedding_desc": "Wandelt Text in Vektoren für die semantische Suche um. Ein Wechsel bettet alles neu ein.",
@@ -3719,6 +3729,50 @@
"paste_failed": "Hier kann nicht eingefügt werden."
},
"workspace_launcher": {
+ "wizard": {
+ "new_workspace": "Neuer Arbeitsbereich",
+ "additional_workspace": "Zusätzlicher Arbeitsbereich",
+ "step_progress": "Schritt {0} von {1}",
+ "running_notice": "Deine offenen Arbeitsbereiche laufen weiter.",
+ "terminal_unavailable_before": "Auf diesem Rechner fehlt ein nutzbares Terminal-Backend. Erforderlich:",
+ "terminal_unavailable_after": "Beide sind im Desktop-Extra enthalten.",
+ "no_cli": "Im PATH dieses Rechners wurde keine Coding-Agent-CLI gefunden. Nach der Installation wird sie automatisch erkannt.",
+ "open_clis": "CLIs öffnen",
+ "terminal_panes": "Terminal-Fenster",
+ "back": "Zurück",
+ "continue_layout": "Weiter zum Layout",
+ "continue_agents": "Weiter zu den Agents",
+ "choose_view": "Ansicht auswählen",
+ "review_workspace": "Arbeitsbereich prüfen",
+ "opening": "Wird geöffnet…",
+ "open_workspace": "Arbeitsbereich öffnen",
+ "not_chosen": "Nicht ausgewählt",
+ "one_terminal": "1 Terminal",
+ "many_terminals": "{0} Terminals",
+ "check_and_open": "Prüfen und öffnen",
+ "setup_label": "Arbeitsbereich einrichten",
+ "reading_mode": "Darstellung",
+ "reading_mode_label": "Darstellung des Arbeitsbereichs",
+ "view_hint": "Nur die Darstellung ändert sich — Agents, Fenster und Unterhaltungen bleiben gleich, und die Toolbar kann jederzeit wechseln. Das Command Deck meldet abgeschlossene Agents außerdem laut.",
+ "selected": "Ausgewählt",
+ "workspace": "Arbeitsbereich",
+ "opens_as": "Wird geöffnet als",
+ "coding_mode": "Coding-Modus",
+ "coding_mode_on_open": "Wird beim Öffnen aktiviert",
+ "terminal_plan": "Terminal-Plan",
+ "steps": {
+ "folder": { "label": "Ordner", "title": "Projektordner auswählen", "hint": "Alles, was die Agents tun, bleibt in diesem Ordner." },
+ "layout": { "label": "Layout", "title": "Arbeitsbereich aufteilen", "hint": "Lege fest, wie viele unabhängige Terminal-Fenster geöffnet werden." },
+ "agents": { "label": "Agents" },
+ "view": { "label": "Ansicht", "title": "Darstellung des Arbeitsbereichs auswählen", "hint": "Die Agents bleiben gleich — die Toolbar kann jederzeit umschalten." },
+ "review": { "label": "Prüfen", "title": "Vor dem Öffnen prüfen", "hint": "Nichts startet, bevor du den Arbeitsbereich öffnest." }
+ },
+ "views": {
+ "grid": { "title": "Terminal-Raster", "description": "Alle Fenster gleichzeitig nebeneinander — die vollständige Terminal-Wand." },
+ "chat": { "title": "Chat-Ansicht", "description": "Ein Agent im Mittelpunkt, die anderen in einer Leiste — lesbar wie eine Unterhaltung." },
+ "deck": { "title": "Command Deck", "description": "Du gibst den Auftrag per Sprache, {name} koordiniert und meldet fertige Agents." }
+ }
+ },
"resume": {
"eyebrow": "Vorheriger Arbeitsstand",
"title": "Den Arbeitsraum wiederherstellen, nicht nur die Fenster",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 1165f6676d..ec4b544349 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -843,9 +843,11 @@
"status_saved": "Saved jarvis-stats.png.",
"status_copy_unsupported": "Copy isn't supported here — saved the PNG instead.",
"status_composer": "Image copied — paste it into the X composer.",
+ "status_composer_without_image": "X opened, but the image could not be copied. Save the PNG and attach it manually.",
"status_error": "Couldn't generate the image. Try again.",
"status_shared": "Shared.",
"status_blocked": "Couldn't open X — the image is on your clipboard, open x.com and paste it.",
+ "status_blocked_without_image": "Couldn't open X or copy the image. Save the PNG, then open x.com and attach it manually.",
"card": {
"brand": "PERSONAL JARVIS",
"hero_label": "Words spoken",
@@ -2922,6 +2924,8 @@
"capture_in_progress": "In progress",
"capture_session_sweeps": "Session sweeps",
"capture_store_unavailable": "Capture store unavailable",
+ "capture_store_error": "Capture store unavailable: {0}",
+ "capture_failed_detail": "{0} capture operations failed in this window.",
"checking": "Checking wiki health…",
"unavailable": "Wiki health check unavailable",
"vault_prefix": "Vault: {0}",
@@ -2935,6 +2939,7 @@
"reindex": "Rebuild index",
"reindexing": "Rebuilding...",
"reindex_failed": "The wiki search index could not be rebuilt.",
+ "reindex_failed_detail": "Index rebuild failed: {0}",
"bootstrap_failed": "Bootstrap failed: {0}",
"bootstrap_failed_unknown": "Bootstrap failed",
"chain_failure": "Chain failure: {0}",
@@ -3397,6 +3402,11 @@
"title": "Capability slots",
"storage_title": "Storage",
"storage_desc": "Where the knowledge store lives.",
+ "storage_sqlite": "SQLite (local, recommended)",
+ "storage_postgres": "PostgreSQL",
+ "storage_postgres_hint": "Add the PostgreSQL connection string in API Keys before activating this backend.",
+ "open_api_keys": "Open API Keys",
+ "not_ready_suffix": "not ready",
"in_use": "In use: {0}",
"embedding_title": "Embedding model",
"embedding_desc": "Turns text into vectors for semantic search. Changing it re-embeds everything.",
@@ -3719,6 +3729,50 @@
"paste_failed": "Cannot paste here."
},
"workspace_launcher": {
+ "wizard": {
+ "new_workspace": "New workspace",
+ "additional_workspace": "Additional workspace",
+ "step_progress": "Step {0} of {1}",
+ "running_notice": "Your open workspaces keep running.",
+ "terminal_unavailable_before": "This machine has no usable terminal backend. Required:",
+ "terminal_unavailable_after": "Both ship with the desktop extra.",
+ "no_cli": "No coding-agent CLI was found on this machine's PATH. Install one and it is picked up automatically.",
+ "open_clis": "Open CLIs",
+ "terminal_panes": "Terminal panes",
+ "back": "Back",
+ "continue_layout": "Continue to layout",
+ "continue_agents": "Continue to agents",
+ "choose_view": "Choose the view",
+ "review_workspace": "Review workspace",
+ "opening": "Opening…",
+ "open_workspace": "Open workspace",
+ "not_chosen": "Not chosen",
+ "one_terminal": "1 terminal",
+ "many_terminals": "{0} terminals",
+ "check_and_open": "Check and open",
+ "setup_label": "Workspace setup",
+ "reading_mode": "Reading mode",
+ "reading_mode_label": "How the workspace opens",
+ "view_hint": "Only how the workspace is read changes — the agents, panes and conversations stay the same, and the toolbar can switch at any time. Command Deck also reports completed agents aloud.",
+ "selected": "Selected",
+ "workspace": "Workspace",
+ "opens_as": "Opens as",
+ "coding_mode": "Coding mode",
+ "coding_mode_on_open": "Turns on when opened",
+ "terminal_plan": "Terminal plan",
+ "steps": {
+ "folder": { "label": "Folder", "title": "Choose the project folder", "hint": "Everything the agents do stays inside this folder." },
+ "layout": { "label": "Layout", "title": "Shape the workspace", "hint": "Choose how many independent terminal panes should open." },
+ "agents": { "label": "Agents" },
+ "view": { "label": "View", "title": "Choose how to read the workspace", "hint": "The same agents either way — the toolbar can switch at any time." },
+ "review": { "label": "Review", "title": "Review before opening", "hint": "Nothing starts until you open the workspace." }
+ },
+ "views": {
+ "grid": { "title": "Terminal grid", "description": "Every pane on screen at once, side by side — the full wall of terminals." },
+ "chat": { "title": "Chat view", "description": "One agent at a time on a calm stage, the rest on a rail — read like a conversation." },
+ "deck": { "title": "Command Deck", "description": "You brief by voice, {name} runs the floor — and tells you when an agent is done." }
+ }
+ },
"resume": {
"eyebrow": "Previous working set",
"title": "Restore the room, not just the windows",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index e559ae3bd2..43ebfdab66 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -843,9 +843,11 @@
"status_saved": "jarvis-stats.png guardado.",
"status_copy_unsupported": "Copiar no es compatible aquí — se guardó el PNG.",
"status_composer": "Imagen copiada — pégala en el editor de X.",
+ "status_composer_without_image": "X se abrió, pero no se pudo copiar la imagen. Guarda el PNG y adjúntalo manualmente.",
"status_error": "No se pudo generar la imagen. Inténtalo de nuevo.",
"status_shared": "Compartido.",
"status_blocked": "No se pudo abrir X — la imagen está en tu portapapeles, abre x.com y pégala.",
+ "status_blocked_without_image": "No se pudo abrir X ni copiar la imagen. Guarda el PNG, abre x.com y adjúntalo manualmente.",
"card": {
"brand": "PERSONAL JARVIS",
"hero_label": "Palabras dichas",
@@ -2922,6 +2924,8 @@
"capture_in_progress": "En curso",
"capture_session_sweeps": "Revisiones de sesión",
"capture_store_unavailable": "Almacén de captura no disponible",
+ "capture_store_error": "Almacén de captura no disponible: {0}",
+ "capture_failed_detail": "{0} operaciones de captura fallaron en este intervalo.",
"checking": "Comprobando el estado del wiki…",
"unavailable": "Comprobación del estado del wiki no disponible",
"vault_prefix": "Bóveda: {0}",
@@ -2935,6 +2939,7 @@
"reindex": "Reconstruir índice",
"reindexing": "Reconstruyendo...",
"reindex_failed": "No se pudo reconstruir el índice de búsqueda del wiki.",
+ "reindex_failed_detail": "Falló la reconstrucción del índice: {0}",
"bootstrap_failed": "Bootstrap fallido: {0}",
"bootstrap_failed_unknown": "Bootstrap fallido",
"chain_failure": "Fallo en la cadena: {0}",
@@ -3397,6 +3402,11 @@
"title": "Ranuras de capacidades",
"storage_title": "Almacenamiento",
"storage_desc": "Dónde vive el almacén de conocimiento.",
+ "storage_sqlite": "SQLite (local, recomendado)",
+ "storage_postgres": "PostgreSQL",
+ "storage_postgres_hint": "Añade la cadena de conexión de PostgreSQL en Claves de API antes de activar este backend.",
+ "open_api_keys": "Abrir Claves de API",
+ "not_ready_suffix": "no listo",
"in_use": "En uso: {0}",
"embedding_title": "Modelo de embeddings",
"embedding_desc": "Convierte el texto en vectores para la búsqueda semántica. Cambiarlo vuelve a incrustar todo.",
@@ -3719,6 +3729,50 @@
"paste_failed": "Aquí no se puede pegar."
},
"workspace_launcher": {
+ "wizard": {
+ "new_workspace": "Nuevo espacio de trabajo",
+ "additional_workspace": "Espacio de trabajo adicional",
+ "step_progress": "Paso {0} de {1}",
+ "running_notice": "Tus espacios abiertos siguen funcionando.",
+ "terminal_unavailable_before": "Este equipo no tiene un backend de terminal utilizable. Se necesita:",
+ "terminal_unavailable_after": "Ambos se incluyen con el extra de escritorio.",
+ "no_cli": "No se encontró ninguna CLI de agente de programación en el PATH de este equipo. Se detectará automáticamente después de instalarla.",
+ "open_clis": "Abrir CLIs",
+ "terminal_panes": "Paneles de terminal",
+ "back": "Atrás",
+ "continue_layout": "Continuar al diseño",
+ "continue_agents": "Continuar a los agentes",
+ "choose_view": "Elegir la vista",
+ "review_workspace": "Revisar el espacio",
+ "opening": "Abriendo…",
+ "open_workspace": "Abrir espacio de trabajo",
+ "not_chosen": "Sin elegir",
+ "one_terminal": "1 terminal",
+ "many_terminals": "{0} terminales",
+ "check_and_open": "Revisar y abrir",
+ "setup_label": "Configurar espacio de trabajo",
+ "reading_mode": "Modo de lectura",
+ "reading_mode_label": "Cómo se abre el espacio de trabajo",
+ "view_hint": "Solo cambia la presentación: los agentes, paneles y conversaciones siguen iguales, y la barra permite cambiar en cualquier momento. Command Deck también anuncia los agentes que terminan.",
+ "selected": "Seleccionado",
+ "workspace": "Espacio de trabajo",
+ "opens_as": "Se abre como",
+ "coding_mode": "Modo de programación",
+ "coding_mode_on_open": "Se activa al abrir",
+ "terminal_plan": "Plan de terminales",
+ "steps": {
+ "folder": { "label": "Carpeta", "title": "Elige la carpeta del proyecto", "hint": "Todo lo que hagan los agentes permanece dentro de esta carpeta." },
+ "layout": { "label": "Diseño", "title": "Diseña el espacio de trabajo", "hint": "Elige cuántos paneles de terminal independientes deben abrirse." },
+ "agents": { "label": "Agentes" },
+ "view": { "label": "Vista", "title": "Elige cómo leer el espacio", "hint": "Los agentes son los mismos y la barra permite cambiar en cualquier momento." },
+ "review": { "label": "Revisar", "title": "Revisa antes de abrir", "hint": "Nada empieza hasta que abras el espacio de trabajo." }
+ },
+ "views": {
+ "grid": { "title": "Cuadrícula de terminales", "description": "Todos los paneles a la vez, uno junto a otro: la pared completa de terminales." },
+ "chat": { "title": "Vista de chat", "description": "Un agente en el centro y los demás en una barra, como una conversación." },
+ "deck": { "title": "Command Deck", "description": "Tú das las instrucciones por voz, {name} coordina y avisa cuando termina un agente." }
+ }
+ },
"resume": {
"eyebrow": "Espacio de trabajo anterior",
"title": "Recupera el espacio de trabajo, no solo las ventanas",
diff --git a/jarvis/ui/web/frontend/src/lib/clipboard.test.ts b/jarvis/ui/web/frontend/src/lib/clipboard.test.ts
index 3494d3ec66..094c52a6fd 100644
--- a/jarvis/ui/web/frontend/src/lib/clipboard.test.ts
+++ b/jarvis/ui/web/frontend/src/lib/clipboard.test.ts
@@ -53,9 +53,9 @@ describe("saveOrDownload", () => {
});
describe("robustCopy", () => {
- it("uses the browser clipboard when it succeeds", async () => {
+ it("keeps browser success when independent fallbacks are unavailable", async () => {
const writeText = vi.fn(async () => undefined);
- const fetchMock = vi.fn();
+ const fetchMock = vi.fn(async () => ({ ok: false }));
stubClipboard(writeText);
stubExecCommand(() => false);
vi.stubGlobal("fetch", fetchMock);
@@ -63,7 +63,24 @@ describe("saveOrDownload", () => {
await expect(robustCopy("short text")).resolves.toBe(true);
expect(writeText).toHaveBeenCalledWith("short text");
- expect(fetchMock).not.toHaveBeenCalled();
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ });
+
+ it("also writes short commands through the desktop fallback", async () => {
+ stubClipboard(vi.fn(async () => undefined));
+ stubExecCommand(() => false);
+ const fetchMock = vi.fn(async () => ({ ok: true }));
+ vi.stubGlobal("fetch", fetchMock);
+
+ await expect(robustCopy("jarvis setup telephony")).resolves.toBe(true);
+
+ expect(fetchMock).toHaveBeenCalledWith(
+ "/api/clipboard/text",
+ expect.objectContaining({
+ method: "POST",
+ body: JSON.stringify({ text: "jarvis setup telephony" }),
+ }),
+ );
});
it("falls back to the desktop backend when WKWebView blocks DOM copy", async () => {
diff --git a/jarvis/ui/web/frontend/src/lib/clipboard.ts b/jarvis/ui/web/frontend/src/lib/clipboard.ts
index 6cbed1a46b..7a030c062d 100644
--- a/jarvis/ui/web/frontend/src/lib/clipboard.ts
+++ b/jarvis/ui/web/frontend/src/lib/clipboard.ts
@@ -18,7 +18,11 @@
* Returns true if any path succeeded, false if all paths failed.
*/
export async function robustCopy(text: string): Promise<boolean> {
- // Path A — modern clipboard API. Fast and reliable for short texts.
+ let browserCopySucceeded = false;
+
+ // Path A — modern clipboard API. Some Chromium/WebView builds resolve the
+ // promise without updating the OS clipboard, so success here is remembered
+ // but no longer prevents the independently verifiable fallbacks below.
try {
if (
typeof navigator !== "undefined" &&
@@ -26,17 +30,7 @@ export async function robustCopy(text: string): Promise<boolean> {
typeof navigator.clipboard.writeText === "function"
) {
await navigator.clipboard.writeText(text);
- // WebView2 quirk: writeText() resolves even when only a partial
- // string was applied. We can't reliably read the result back
- // (readText needs permissions that pywebview doesn't grant by
- // default). So for multi-line content, always run the fallback
- // too — it overwrites the corrupted entry with the full text
- // if needed.
- if (text.includes("\n")) {
- if (execCommandCopy(text)) return true;
- return nativeBackendCopy(text);
- }
- return true;
+ browserCopySucceeded = true;
}
} catch {
// Path A failed — fall through to the fallback.
@@ -45,7 +39,8 @@ export async function robustCopy(text: string): Promise<boolean> {
if (execCommandCopy(text)) return true;
// Path C — local desktop backend. It is intentionally unavailable on a
// browser/headless server, where writing would target the wrong machine.
- return nativeBackendCopy(text);
+ if (await nativeBackendCopy(text)) return true;
+ return browserCopySucceeded;
}
/** Hard cap on the browser clipboard read (see robustPaste). */
diff --git a/jarvis/ui/web/frontend/src/lib/shareImage.ts b/jarvis/ui/web/frontend/src/lib/shareImage.ts
index 7499d4daaf..8686dc9978 100644
--- a/jarvis/ui/web/frontend/src/lib/shareImage.ts
+++ b/jarvis/ui/web/frontend/src/lib/shareImage.ts
@@ -101,54 +101,76 @@ export function buildShareText(stats: ShareStats): string {
export type ShareToXResult =
| "shared" // native share sheet completed (image included)
- | "dismissed" // user cancelled the native sheet — no further action
+ | "dismissed" // user cancelled the native sheet
| "composer" // intent composer opened; image is on the clipboard to paste
+ | "composer_without_image" // composer opened, clipboard image unavailable
| "blocked" // popup blocked (e.g. WebView2 default) — image still copied
- | "error"; // image render failed
+ | "blocked_without_image"; // popup and clipboard image both unavailable
/**
- * Share to X with the best path each platform allows:
- * 1. Mobile / capable browsers → Web Share API WITH the image file.
- * 2. Desktop → copy the image to the clipboard, then open the prefilled
- * ``/intent/tweet`` composer; the user pastes the image (Ctrl/Cmd+V).
- * X intent URLs cannot attach an image, so (2) is the only desktop option.
+ * Share to X by opening the prefilled intent composer synchronously, then
+ * staging the image on the clipboard for the user to paste (Ctrl/Cmd+V).
+ * X intent URLs cannot attach an image directly.
+ *
+ * Opening the composer MUST happen before the first ``await``. Otherwise the
+ * browser no longer considers it part of the click gesture and blocks the
+ * popup while the share card is still rendering.
* If the popup is blocked (the pywebview/WebView2 shell does this), the image
* is still on the clipboard and we report ``"blocked"`` so the dialog can tell
* the user to open X manually — never a misleading image-error.
*/
export async function shareToX(
- blob: Blob,
+ image: Blob | Promise<Blob>,
text: string,
): Promise<ShareToXResult> {
- const file = new File([blob], "jarvis-stats.png", { type: "image/png" });
- const nav = navigator as Navigator & {
- canShare?: (data: { files?: File[] }) => boolean;
- };
- if (nav.canShare?.({ files: [file] }) && typeof navigator.share === "function") {
- try {
- await navigator.share({ files: [file], text: `${text} ${REPO_URL}` });
- return "shared";
- } catch (err) {
- // User dismissed the native sheet — stop, don't pop a second composer.
- if ((err as Error)?.name === "AbortError") return "dismissed";
- // Any other failure falls through to the intent composer below.
+ // A pre-rendered Blob lets the native share sheet start synchronously inside
+ // the click gesture while still including the image. A pending render cannot
+ // use this route because creating the File after awaiting it loses activation.
+ if (image instanceof Blob) {
+ const file = new File([image], "jarvis-stats.png", { type: "image/png" });
+ const nav = navigator as Navigator & {
+ canShare?: (data: { files?: File[] }) => boolean;
+ };
+ if (nav.canShare?.({ files: [file] }) && typeof navigator.share === "function") {
+ try {
+ await navigator.share({ files: [file], text: `${text} ${REPO_URL}` });
+ return "shared";
+ } catch (error) {
+ if ((error as Error)?.name === "AbortError") return "dismissed";
+ // A synchronous native-share refusal can still fall back to X.
+ }
}
}
- // Desktop fallback: stage the image on the clipboard for pasting.
- try {
- if (typeof ClipboardItem !== "undefined" && navigator.clipboard?.write) {
- await navigator.clipboard.write([new ClipboardItem({ "image/png": blob })]);
+ const params = new URLSearchParams({ text, url: REPO_URL });
+ const intentUrl = `https://twitter.com/intent/tweet?${params.toString()}`;
+ let win: Window | null = null;
+ const candidate = globalThis.open?.("", "_blank") ?? null;
+ if (candidate) {
+ try {
+ // Opening about:blank gives us a truthful popup-blocker signal. Sever
+ // the opener while it is still same-origin, then navigate only after the
+ // new page can no longer reach back into the Jarvis window.
+ candidate.opener = null;
+ candidate.location.replace(intentUrl);
+ win = candidate;
+ } catch {
+ // A handle that cannot be secured or navigated is not a usable composer.
+ try {
+ candidate.close();
+ } catch {
+ /* best-effort cleanup of the blank window */
+ }
}
- } catch {
- /* clipboard is best-effort here */
}
- const params = new URLSearchParams({ text, url: REPO_URL });
- const win = globalThis.open?.(
- `https://twitter.com/intent/tweet?${params.toString()}`,
- "_blank",
- "noopener,noreferrer",
- );
- return win ? "composer" : "blocked";
+ // The composer and ClipboardItem are both created before the first await so
+ // the browser still recognises them as consequences of the button click.
+ const copy = copyImageToClipboard(image);
+ await Promise.resolve(image);
+ const copyResult = await copy;
+ if (win) {
+ return copyResult === "copied" ? "composer" : "composer_without_image";
+ }
+ return copyResult === "copied" ? "blocked" : "blocked_without_image";
}
diff --git a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
index 486cf8de85..a108253fcc 100644
--- a/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/AgenticIdeView.test.tsx
@@ -19,8 +19,31 @@ if (typeof globalThis.ResizeObserver === "undefined") {
ResizeObserverPolyfill as unknown as typeof ResizeObserver;
}
-// Identity translator so rendered text equals the i18n key.
-vi.mock("@/i18n", () => ({ useT: () => (key: string) => key }));
+// Most component-specific copy remains an identity translation in this suite.
+// The launcher navigation uses real English labels so its accessible workflow
+// stays readable while the locale dictionaries are tested separately.
+const launcherEnglish = vi.hoisted<Record<string, string>>(() => ({
+ "workspace_launcher.wizard.steps.folder.title": "Choose the project folder",
+ "workspace_launcher.wizard.steps.layout.title": "Shape the workspace",
+ "workspace_launcher.wizard.steps.view.title": "Choose how to read the workspace",
+ "workspace_launcher.wizard.steps.review.title": "Review before opening",
+ "workspace_launcher.wizard.continue_layout": "Continue to layout",
+ "workspace_launcher.wizard.continue_agents": "Continue to agents",
+ "workspace_launcher.wizard.choose_view": "Choose the view",
+ "workspace_launcher.wizard.review_workspace": "Review workspace",
+ "workspace_launcher.wizard.open_workspace": "Open workspace",
+ "workspace_launcher.wizard.terminal_unavailable_before":
+ "This machine has no usable terminal backend. Required:",
+ "workspace_launcher.wizard.no_cli":
+ "No coding-agent CLI was found on this machine's PATH.",
+ "workspace_launcher.wizard.open_clis": "Open CLIs",
+ "workspace_launcher.wizard.views.grid.title": "Terminal grid",
+ "workspace_launcher.wizard.views.chat.title": "Chat view",
+ "workspace_launcher.wizard.views.deck.title": "Command Deck",
+}));
+vi.mock("@/i18n", () => ({
+ useT: () => (key: string) => launcherEnglish[key] ?? key,
+}));
// The workspace grid follows the app theme for its terminal colours; this test
// renders the view outside the provider, so the hook is stubbed.
@@ -111,6 +134,7 @@ vi.mock("@/lib/agenticIdeApi", () => ({
}));
import { AgenticIdeView } from "./AgenticIdeView";
+import { workspaceLaunchShortcut } from "@/components/agentic/WorkspaceLauncher";
import * as api from "@/lib/agenticIdeApi";
import { GRID_HORIZONTAL_PADDING_PX } from "@/components/agentic/layout";
@@ -369,6 +393,12 @@ describe("Agentic IDE — before the first read lands", () => {
});
describe("Agentic IDE launcher", () => {
+ it("shows the launch chord for the current operating system", () => {
+ expect(workspaceLaunchShortcut("Win32")).toBe("Ctrl+↵");
+ expect(workspaceLaunchShortcut("MacIntel")).toBe("⌘↵");
+ expect(workspaceLaunchShortcut("Linux x86_64")).toBe("Ctrl+↵");
+ });
+
async function chooseFolder(): Promise<void> {
fireEvent.click(await screen.findByRole("button", { name: /project/i }));
}
diff --git a/jarvis/ui/web/frontend/src/views/DictionaryView.test.tsx b/jarvis/ui/web/frontend/src/views/DictionaryView.test.tsx
new file mode 100644
index 0000000000..77f789eedf
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/DictionaryView.test.tsx
@@ -0,0 +1,47 @@
+import { fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+import { DictionaryView } from "./DictionaryView";
+
+afterEach(() => {
+ vi.unstubAllGlobals();
+});
+
+describe("DictionaryView editor", () => {
+ it("opens an existing correction immediately in a document-level dialog", async () => {
+ vi.stubGlobal(
+ "fetch",
+ vi.fn(async () =>
+ new Response(
+ JSON.stringify({
+ entries: [
+ {
+ id: "entry-1",
+ word: "CallPost",
+ misheard: ["call post"],
+ created_at: "2026-08-09T00:00:00Z",
+ updated_at: "2026-08-09T00:00:00Z",
+ },
+ ],
+ }),
+ { status: 200, headers: { "Content-Type": "application/json" } },
+ ),
+ ),
+ );
+
+ render(<DictionaryView hideHeader />);
+ const edit = await screen.findByTestId("dictionary-edit-entry-1");
+
+ fireEvent.click(edit);
+
+ const dialog = await screen.findByRole("dialog");
+ expect(dialog.parentElement).toBe(document.body.lastElementChild);
+ expect(
+ (screen.getByTestId("dictionary-misheard-input") as HTMLInputElement).value,
+ ).toBe("call post");
+ expect(
+ (screen.getByTestId("dictionary-word-input") as HTMLInputElement).value,
+ ).toBe("CallPost");
+ await waitFor(() => expect(dialog.isConnected).toBe(true));
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/DictionaryView.tsx b/jarvis/ui/web/frontend/src/views/DictionaryView.tsx
index 166f253062..02738349f9 100644
--- a/jarvis/ui/web/frontend/src/views/DictionaryView.tsx
+++ b/jarvis/ui/web/frontend/src/views/DictionaryView.tsx
@@ -1,4 +1,5 @@
import { useMemo, useState } from "react";
+import { createPortal } from "react-dom";
import {
ArrowRight,
BookA,
@@ -272,18 +273,30 @@ function DictionaryEntryDialog({
}
}
- return (
+ // Render at document level. The voice hub is an overflow-constrained flex
+ // pane; keeping a fixed, backdrop-filtered modal inside that stacking context
+ // made Chromium/WebView spend seconds repainting the whole pane and the Edit
+ // click appeared to hang. A plain scrim in a portal has the same modal
+ // boundary without trapping or blurring the hub.
+ return createPortal(
<div
- className="fixed inset-0 z-50 flex items-center justify-center bg-scrim/50 backdrop-blur-sm"
+ className="fixed inset-0 z-50 flex items-center justify-center bg-scrim/50"
onClick={onClose}
+ role="presentation"
>
<div
className="w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl"
onClick={(e) => e.stopPropagation()}
data-testid="dictionary-dialog"
+ role="dialog"
+ aria-modal="true"
+ aria-labelledby="dictionary-dialog-title"
>
<header className="mb-4 flex items-center gap-3">
- <h3 className="flex-1 font-display text-base font-semibold">
+ <h3
+ id="dictionary-dialog-title"
+ className="flex-1 font-display text-base font-semibold"
+ >
{initial
? t("dictionary.dialog_edit_title")
: t("dictionary.dialog_add_title")}
@@ -369,6 +382,7 @@ function DictionaryEntryDialog({
</Button>
</div>
</div>
- </div>
+ </div>,
+ document.body,
);
}
diff --git a/jarvis/ui/web/frontend/src/views/WikiView.test.tsx b/jarvis/ui/web/frontend/src/views/WikiView.test.tsx
index d067856519..0dd731238d 100644
--- a/jarvis/ui/web/frontend/src/views/WikiView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/WikiView.test.tsx
@@ -27,6 +27,14 @@ vi.mock("@/hooks/useWikiLive", () => ({
useWikiLive: useWikiLiveMock,
}));
+vi.mock("@/components/wiki/WikiGraph", () => ({
+ WikiGraph: ({ onNodeClick }: { onNodeClick: (slug: string) => void }) => (
+ <button type="button" onClick={() => onNodeClick("example-parent")}>
+ Example Parent graph node
+ </button>
+ ),
+}));
+
function freshClient(): QueryClient {
return new QueryClient({
defaultOptions: {
@@ -294,6 +302,21 @@ describe("WikiView — populated tree", () => {
});
expect(screen.getByTestId("wiki-page-title").textContent).toBe("Example Parent");
}, 10_000);
+
+ it("clicking the already-selected graph node returns to its page", async () => {
+ renderWithClient(<WikiView />);
+
+ fireEvent.click(await screen.findByText("example-parent.md"));
+ await screen.findByTestId("wiki-page-renderer");
+ fireEvent.click(screen.getByRole("button", { name: "Memory Map" }));
+ fireEvent.click(await screen.findByRole("button", {
+ name: "Example Parent graph node",
+ }));
+
+ await waitFor(() => {
+ expect(screen.getByTestId("wiki-page-renderer")).toBeDefined();
+ });
+ });
});
describe("WikiView — health strip", () => {
@@ -407,6 +430,9 @@ describe("WikiView — health strip", () => {
);
expect(screen.getByTestId("wiki-capture-writes").textContent).toContain("9");
expect(screen.getByTestId("wiki-capture-session-sweeps").textContent).toContain("3");
+ expect(screen.getByTestId("wiki-capture-failed-detail").textContent).toContain(
+ "2",
+ );
});
it("renders the error text for a failed last write, and the backlog count", async () => {
@@ -446,6 +472,82 @@ describe("WikiView — health strip", () => {
);
});
});
+
+ it("keeps the reindex failure detail visible beside the retry action", async () => {
+ const stale = { ...HEALTHY_HEALTH, indexed_pages: 0, index_state: "stale" as const };
+ installFetchMock({
+ "/api/wiki/tree": () => EMPTY_TREE,
+ "/api/wiki/health": () => ({ ok: true, health: stale }),
+ "/api/wiki/reindex": () => ({ ok: false, error: "FTS database is locked" }),
+ });
+ renderWithClient(<WikiView />);
+
+ fireEvent.click(await screen.findByTestId("wiki-health-reindex"));
+
+ await waitFor(() => {
+ expect(screen.getByTestId("wiki-health-reindex-error").textContent).toContain(
+ "FTS database is locked",
+ );
+ });
+ });
+
+ it("localises a reindex failure without a backend detail", async () => {
+ const stale = { ...HEALTHY_HEALTH, indexed_pages: 0, index_state: "stale" as const };
+ installFetchMock({
+ "/api/wiki/tree": () => EMPTY_TREE,
+ "/api/wiki/health": () => ({ ok: true, health: stale }),
+ "/api/wiki/reindex": () => ({ ok: false }),
+ });
+ renderWithClient(<WikiView />);
+
+ fireEvent.click(await screen.findByTestId("wiki-health-reindex"));
+
+ await waitFor(() => {
+ expect(screen.getByTestId("wiki-health-reindex-error").textContent).toContain(
+ "The wiki search index could not be rebuilt.",
+ );
+ });
+ expect(screen.getByTestId("wiki-health-reindex-error").textContent).not.toContain(
+ "index rebuild failed",
+ );
+ });
+
+ it("shows the capture-store error detail instead of a generic badge", async () => {
+ installFetchMock({
+ "/api/wiki/tree": () => EMPTY_TREE,
+ "/api/wiki/health": () => ({
+ ok: true,
+ health: { ...HEALTHY_HEALTH, capture_error: "capture database is locked" },
+ }),
+ });
+ renderWithClient(<WikiView />);
+
+ await waitFor(() => {
+ expect(screen.getByTestId("wiki-capture-error").textContent).toContain(
+ "capture database is locked",
+ );
+ });
+ });
+
+ it("localises the capture-store sentinel returned by the health API", async () => {
+ installFetchMock({
+ "/api/wiki/tree": () => EMPTY_TREE,
+ "/api/wiki/health": () => ({
+ ok: true,
+ health: { ...HEALTHY_HEALTH, capture_error: "capture_store_unavailable" },
+ }),
+ });
+ renderWithClient(<WikiView />);
+
+ await waitFor(() => {
+ expect(screen.getByTestId("wiki-capture-error").textContent).toBe(
+ "Capture store unavailable",
+ );
+ });
+ expect(screen.getByTestId("wiki-capture-error").textContent).not.toContain(
+ "capture_store_unavailable",
+ );
+ });
});
describe("PageRenderer — wikilink behaviour", () => {
diff --git a/jarvis/ui/web/frontend/src/views/WikiView.tsx b/jarvis/ui/web/frontend/src/views/WikiView.tsx
index 10183a2a7b..79114830fb 100644
--- a/jarvis/ui/web/frontend/src/views/WikiView.tsx
+++ b/jarvis/ui/web/frontend/src/views/WikiView.tsx
@@ -13,7 +13,7 @@
*
* Replaces the legacy `MemoryView` (`data/core_memory.json` flat memory).
*/
-import { Suspense, lazy, useCallback, useEffect, useState } from "react";
+import { Suspense, lazy, useCallback, useEffect, useMemo, useState } from "react";
import {
FileText,
Maximize2,
@@ -114,6 +114,7 @@ export function WikiView(): JSX.Element {
const [setupHint, setSetupHint] = useState<ObsidianStatusType | null>(null);
const [dialogOpen, setDialogOpen] = useState(false);
const [isReindexing, setIsReindexing] = useState(false);
+ const [reindexError, setReindexError] = useState<string | null>(null);
// Tree query lives both here (for header stats + empty-state detection)
// and inside TreeSidebar (for the list). React Query dedupes them.
@@ -262,11 +263,17 @@ export function WikiView(): JSX.Element {
const handleReindex = useCallback(async () => {
setIsReindexing(true);
+ setReindexError(null);
try {
const result = await rebuildWikiIndex();
- if (!result.ok) throw new Error(result.error ?? "index rebuild failed");
+ if (!result.ok) {
+ throw new Error(result.error ?? t("wiki_health.reindex_failed"));
+ }
await Promise.all([healthQuery.refetch(), treeQuery.refetch()]);
- } catch {
+ } catch (error) {
+ setReindexError(
+ error instanceof Error ? error.message : t("wiki_health.reindex_failed"),
+ );
showToast(t("wiki_health.reindex_failed"));
} finally {
setIsReindexing(false);
@@ -275,7 +282,10 @@ export function WikiView(): JSX.Element {
// Build the known-slug set lazily here too, so we can validate a wikilink
// click before changing the URL. Single source of truth: the tree response.
- const knownSlugs = collectSlugs(treeQuery.data?.folders ?? []);
+ const knownSlugs = useMemo(
+ () => collectSlugs(treeQuery.data?.folders ?? []),
+ [treeQuery.data?.folders],
+ );
const handleSelect = useCallback(
(slug: string) => {
@@ -284,11 +294,12 @@ export function WikiView(): JSX.Element {
return;
}
setIsGraphExpanded(false);
+ // Selecting the already-open page from the graph does not change the
+ // slug, so the selectedSlug effect cannot switch tabs in that case.
+ setCentreTab("page");
setSelectedSlug(slug);
},
- // knownSlugs is recomputed each render; intentional, the Set is small.
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [showToast, knownSlugs.size],
+ [knownSlugs, showToast, t],
);
// In Ultra mode the body below is the UltraWiki store, not the vault — so
@@ -364,6 +375,7 @@ export function WikiView(): JSX.Element {
health={healthQuery.data}
isLoading={healthQuery.isLoading}
isReindexing={isReindexing}
+ reindexError={reindexError}
onReindex={handleReindex}
/>
<WikiCaptureFunnelStrip
@@ -623,11 +635,13 @@ function WikiHealthStrip({
health,
isLoading,
isReindexing,
+ reindexError,
onReindex,
}: {
health: WikiHealthSnapshot | null | undefined;
isLoading: boolean;
isReindexing: boolean;
+ reindexError: string | null;
onReindex: () => void;
}): JSX.Element {
const t = useT();
@@ -724,6 +738,15 @@ function WikiHealthStrip({
<RefreshCw className={cn("h-3 w-3", isReindexing && "animate-spin")} />
{t(isReindexing ? "wiki_health.reindexing" : "wiki_health.reindex")}
</button>
+ {reindexError && (
+ <span
+ role="alert"
+ data-testid="wiki-health-reindex-error"
+ className="font-medium text-destructive"
+ >
+ {t("wiki_health.reindex_failed_detail").replace("{0}", reindexError)}
+ </span>
+ )}
</>
)}
{health.vault_legacy_conflict && (
@@ -768,6 +791,12 @@ function WikiCaptureFunnelStrip({
"{0}",
String(windowHours),
);
+ const errorText =
+ error === "capture_store_unavailable"
+ ? t("wiki_health.capture_store_unavailable")
+ : error
+ ? t("wiki_health.capture_store_error").replace("{0}", error)
+ : null;
return (
<section
@@ -776,9 +805,25 @@ function WikiCaptureFunnelStrip({
data-testid="wiki-capture-funnel"
>
<span className="font-medium text-foreground">{windowLabel}</span>
- {error && (
- <span className="font-medium text-destructive" data-testid="wiki-capture-error">
- {t("wiki_health.capture_store_unavailable")}
+ {errorText && (
+ <span
+ className="font-medium text-destructive"
+ data-testid="wiki-capture-error"
+ role="alert"
+ >
+ {errorText}
+ </span>
+ )}
+ {!error && funnel.failed > 0 && (
+ <span
+ className="font-medium text-destructive"
+ data-testid="wiki-capture-failed-detail"
+ role="status"
+ >
+ {t("wiki_health.capture_failed_detail").replace(
+ "{0}",
+ String(funnel.failed),
+ )}
</span>
)}
<dl className="flex flex-wrap items-center gap-x-3 gap-y-1 text-muted-foreground">