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): make the agent brand marks and the restore manifest survive light mode

rubenluetke10-beep4689a2e74064
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx
index 9e9803ab5f..80f38c442a 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentAllocation.test.tsx
@@ -150,15 +150,14 @@ describe("AgentAllocation", () => {
it("uses local product marks and keeps the selected agent logo visible", () => {
render(<Harness />);
+ // `data-logo` rather than the <img>: a single-colour mark is drawn as a
+ // CSS mask so it can follow the theme, and jsdom does not model masks.
const claudeMark = screen.getByTestId("agent-mark-claude");
- expect(claudeMark.querySelector("img")?.getAttribute("src")).toBe(
+ expect(claudeMark.getAttribute("data-logo")).toBe(
"/provider-logos/claude.svg",
);
expect(
- screen
- .getByTestId("agent-mark-codex")
- .querySelector("img")
- ?.getAttribute("src"),
+ screen.getByTestId("agent-mark-codex").getAttribute("data-logo"),
).toBe("/provider-logos/openai.svg");
expect(
screen
@@ -180,7 +179,9 @@ describe("AgentAllocation", () => {
).toBe("/agent-logos/zai.svg");
fireEvent.click(screen.getAllByRole("button", { name: "All" })[0]);
- expect(claudeMark.querySelector("img")).toBeTruthy();
+ expect(claudeMark.getAttribute("data-logo")).toBe(
+ "/provider-logos/claude.svg",
+ );
});
it("presents a wide keyboard-friendly count field without native spinners", () => {
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentMark.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentMark.test.tsx
new file mode 100644
index 0000000000..e8491f881f
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentMark.test.tsx
@@ -0,0 +1,90 @@
+import { cleanup, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it } from "vitest";
+
+import { AgentMark } from "./AgentMark";
+
+afterEach(cleanup);
+
+/**
+ * How a brand mark survives BOTH themes.
+ *
+ * Every logo that ships with the app was drawn for the dark product this
+ * started as, and on the light theme the restore screen showed seven terminals
+ * with no sign of which CLI each was running (maintainer, 2026-08-11). The
+ * marks are not all broken the same way, so what is pinned here is the routing:
+ * which file gets redrawn in the theme's ink, which one keeps its colours and
+ * gets the dark ground it was painted against, and which one is left alone.
+ *
+ * `data-ground` and `data-logo` are asserted rather than the DOM shape, because
+ * an ink mark is a CSS mask and jsdom does not model mask properties — a test
+ * that looked for an <img> would call the working marks broken.
+ */
+function mark(agent: string): HTMLElement {
+ return screen.getByTestId(`agent-mark-${agent}`);
+}
+
+describe("AgentMark", () => {
+ it("redraws a single-colour silhouette in the theme's own ink", () => {
+ // Claude and OpenAI ship as one near-white fill. Nothing about that colour
+ // is brand, so the mark is a mask and follows light/dark by itself.
+ render(<AgentMark agent="claude" label="Claude Code" />);
+ expect(mark("claude").getAttribute("data-ground")).toBe("ink");
+ expect(mark("claude").getAttribute("data-logo")).toBe(
+ "/provider-logos/claude.svg",
+ );
+ // The <img> is what made it invisible on paper; it must be gone.
+ expect(mark("claude").querySelector("img")).toBeNull();
+ });
+
+ it("gives a lockup with a white background the dark ground it was drawn on", () => {
+ // OpenCode is a white square with a dark inner shape. On paper the square
+ // IS the paper and the mark collapsed to an unlabelled grey dot.
+ render(<AgentMark agent="opencode" label="OpenCode" />);
+ expect(mark("opencode").getAttribute("data-ground")).toBe("dark");
+ expect(mark("opencode").querySelector("img")?.getAttribute("src")).toBe(
+ "/agent-logos/opencode.svg",
+ );
+ expect(mark("opencode").className).toContain("bg-scrim");
+ });
+
+ it("leaves a lockup that carries its own ground untouched", () => {
+ // Z.ai is already a dark tile with a white glyph, so it reads on either
+ // theme — a canvas behind it would only be a box inside a box.
+ render(<AgentMark agent="glm" label="GLM" />);
+ expect(mark("glm").getAttribute("data-ground")).toBe("any");
+ expect(mark("glm").querySelector("img")?.getAttribute("src")).toBe(
+ "/agent-logos/zai.svg",
+ );
+ expect(mark("glm").className).not.toContain("bg-scrim");
+ });
+
+ it("does not guess a ground for a logo the user uploaded", () => {
+ // We know nothing about the file; a canvas added on a guess could hide a
+ // mark that was perfectly legible on its own.
+ render(
+ <AgentMark agent="mycli" label="My CLI" logoUrl="/uploads/mine.svg" />,
+ );
+ expect(mark("mycli").getAttribute("data-ground")).toBe("any");
+ expect(mark("mycli").querySelector("img")?.getAttribute("src")).toBe(
+ "/uploads/mine.svg",
+ );
+ });
+
+ it("falls back to a monogram for a CLI with no mark at all", () => {
+ render(<AgentMark agent="mystery" label="Mystery CLI" />);
+ expect(mark("mystery").getAttribute("data-ground")).toBe("none");
+ expect(mark("mystery").querySelector("img")).toBeNull();
+ expect(mark("mystery").textContent).toBe("MY");
+ });
+
+ it("keeps the plain variant tile-free unless the mark needs a canvas", () => {
+ const { unmount } = render(
+ <AgentMark agent="claude" label="Claude Code" variant="plain" />,
+ );
+ expect(mark("claude").className).not.toContain("bg-scrim");
+ unmount();
+
+ render(<AgentMark agent="kimi" label="Kimi" variant="plain" />);
+ expect(mark("kimi").className).toContain("bg-scrim");
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgentMark.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgentMark.tsx
index 18087f32cb..9ad8dcadec 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgentMark.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgentMark.tsx
@@ -3,12 +3,41 @@ import { SquareTerminal } from "lucide-react";
import { cn } from "@/lib/utils";
-const AGENT_LOGOS: Record<string, string> = {
- claude: "/provider-logos/claude.svg",
- codex: "/provider-logos/openai.svg",
- glm: "/agent-logos/zai.svg",
- kimi: "/agent-logos/kimi.svg",
- opencode: "/agent-logos/opencode.svg",
+/**
+ * What ground a brand file needs in order to be legible.
+ *
+ * Every mark that ships with the app was drawn for the dark product this
+ * started as, and they are not all broken in the same way on paper — so one
+ * blanket treatment cannot fix them (maintainer, 2026-08-11: a light-mode
+ * restore screen showed seven terminals with no sign of which CLI each was
+ * running).
+ *
+ * * `ink` — a single-colour silhouette; the file is one `fill="#F4F4F5"` and
+ * nothing about that colour is brand. It is drawn as a MASK over the current
+ * text ink, so it follows the theme by itself: the same near-white on the
+ * dark app, near-black on paper, from one asset and with no theme prop
+ * threaded through the tree.
+ * * `dark` — a full-colour lockup whose own background is white or near-white
+ * (OpenCode's outer square; the body of the Kimi glyph). On paper those
+ * shapes ARE the paper, and the mark collapses to whichever fragment happens
+ * to be dark — OpenCode became an unlabelled grey dot. These keep their
+ * colours and get a constant dark canvas: the ground they were drawn on.
+ * * `any` — a lockup that already carries its own ground (Z.ai is a dark tile
+ * with a white glyph) and reads on either theme untouched.
+ */
+type LogoGround = "ink" | "dark" | "any";
+
+interface LogoAsset {
+ url: string;
+ ground: LogoGround;
+}
+
+const AGENT_LOGOS: Record<string, LogoAsset> = {
+ claude: { url: "/provider-logos/claude.svg", ground: "ink" },
+ codex: { url: "/provider-logos/openai.svg", ground: "ink" },
+ glm: { url: "/agent-logos/zai.svg", ground: "any" },
+ kimi: { url: "/agent-logos/kimi.svg", ground: "dark" },
+ opencode: { url: "/agent-logos/opencode.svg", ground: "dark" },
};
interface AgentMarkProps {
@@ -21,9 +50,12 @@ interface AgentMarkProps {
* for a CLI of their own.
*
* Passed in rather than looked up, because this component cannot know it: the
- * table below is a fixed list of brands that ship with the app, and an entry
+ * table above is a fixed list of brands that ship with the app, and an entry
* added at runtime has no place in it. An entry with no logo (and every
* shipped one) leaves this undefined and the table decides as before.
+ *
+ * An upload is treated as `any`: we know nothing about the file, and a canvas
+ * added on a guess could hide a mark that was perfectly fine on its own.
*/
logoUrl?: string;
/**
@@ -34,6 +66,10 @@ interface AgentMarkProps {
* glyph with the tile taken away, for a list of conversations, where the mark
* is a hint beside a title rather than the subject of the row. A framed tile
* repeated down forty rows turns a reading list into a grid of boxes.
+ *
+ * A `dark`-ground lockup is the one exception: it cannot be shown without
+ * something to sit on, so it keeps a small canvas even when plain. Better a
+ * chip in a list than a mark nobody can identify.
*/
variant?: "boxed" | "plain";
}
@@ -63,10 +99,20 @@ export function AgentMark({
* fresh attempt without an effect to keep in step.
*/
const [failedLogo, setFailedLogo] = useState<string | null>(null);
- const logo = logoUrl || AGENT_LOGOS[agent];
- const failed = failedLogo != null && failedLogo === logo;
+ const asset: LogoAsset | undefined = logoUrl
+ ? { url: logoUrl, ground: "any" }
+ : AGENT_LOGOS[agent];
+ const failed = failedLogo != null && failedLogo === asset?.url;
const monogram = label.trim().slice(0, 2).toUpperCase() || "?";
const plain = variant === "plain";
+ const drawn = agent !== "shell" && asset && !failed;
+ /*
+ * A mask has no load event, so the failure path above cannot cover it. That
+ * is not a gap: `ink` is only ever an asset that ships inside the bundle,
+ * while the uploads the fallback exists for are always drawn as an image.
+ */
+ const inked = drawn && asset.ground === "ink";
+ const canvased = drawn && asset.ground === "dark";
const sizeClass = plain
? size === "sm"
? "h-4 w-4"
@@ -76,17 +122,36 @@ export function AgentMark({
: size === "lg"
? "h-11 w-11 rounded-control"
: "h-9 w-9 rounded-control";
+ const glyphClass = plain
+ ? "h-full w-full"
+ : size === "sm"
+ ? "h-3.5 w-3.5"
+ : size === "lg"
+ ? "h-6 w-6"
+ : "h-5 w-5";
return (
<span
data-testid={`agent-mark-${agent}`}
+ /* Which file is being drawn and on what, stated on the element rather
+ than inferred from it: an `ink` mark is a CSS mask, and a mask lives in
+ a style property jsdom does not model, so a test that reached for the
+ <img> would report "no logo" for the marks that work best. */
+ data-logo={drawn ? asset.url : undefined}
+ data-ground={asset?.ground ?? "none"}
aria-hidden="true"
className={cn(
"inline-flex shrink-0 items-center justify-center overflow-hidden text-[9px] font-bold tracking-tight text-muted-foreground",
// The tile, and the brightness that goes with being one. Without it the
// glyph sits at the weight of the text it accompanies, which is the
// point of `plain`.
- plain ? "opacity-70" : "border border-border/80 bg-background/80",
+ plain
+ ? canvased
+ ? "rounded-[4px] bg-scrim/95 p-px"
+ : "opacity-70"
+ : canvased
+ ? "border border-border/80 bg-scrim/95"
+ : "border border-border/80 bg-background/80",
sizeClass,
className,
)}
@@ -95,23 +160,35 @@ export function AgentMark({
<SquareTerminal
className={plain || size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4"}
/>
- ) : logo && !failed ? (
+ ) : inked ? (
+ /*
+ * `bg-foreground` rather than `bg-current`: the wrapper's ink is the
+ * muted channel, which is right for the monogram beside a title and
+ * wrong for a brand mark. Foreground is #F4F4F5 on the dark theme —
+ * the exact colour the file was authored in, so the dark app is
+ * pixel-identical to before this split existed.
+ */
+ <span
+ className={cn("block bg-foreground", glyphClass)}
+ style={{
+ WebkitMaskImage: `url("${asset.url}")`,
+ maskImage: `url("${asset.url}")`,
+ WebkitMaskRepeat: "no-repeat",
+ maskRepeat: "no-repeat",
+ WebkitMaskPosition: "center",
+ maskPosition: "center",
+ WebkitMaskSize: "contain",
+ maskSize: "contain",
+ }}
+ />
+ ) : drawn ? (
<img
- src={logo}
+ src={asset.url}
alt=""
- className={cn(
- "block object-contain",
- // Plain fills its box: there is no tile to sit inside, so the glyph
- // IS the mark and shrinking it further would leave a speck.
- plain
- ? "h-full w-full"
- : size === "sm"
- ? "h-3.5 w-3.5"
- : size === "lg"
- ? "h-6 w-6"
- : "h-5 w-5",
- )}
- onError={() => setFailedLogo(logo)}
+ // Plain fills its box: there is no tile to sit inside, so the glyph
+ // IS the mark and shrinking it further would leave a speck.
+ className={cn("block object-contain", glyphClass)}
+ onError={() => setFailedLogo(asset.url)}
/>
) : (
<span className="font-mono">{monogram}</span>
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 82d5f94588..40d4032cb5 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticGrid.test.tsx
@@ -2821,9 +2821,9 @@ describe("chat view", () => {
// the ANCHOR's previous sibling.
const mark = title.parentElement?.previousElementSibling;
expect(mark?.getAttribute("data-testid")).toBe("agent-mark-codex");
- expect(mark?.querySelector("img")?.getAttribute("src")).toBe(
- "/provider-logos/openai.svg",
- );
+ // `data-logo` rather than the <img>: a single-colour mark is drawn as a
+ // CSS mask so it follows the theme's ink, and jsdom does not model masks.
+ expect(mark?.getAttribute("data-logo")).toBe("/provider-logos/openai.svg");
});
it("uses the last prompt as the title while a recap is not available", () => {
diff --git a/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.test.tsx
index 27e9274640..6fcb0dae8f 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.test.tsx
@@ -199,12 +199,14 @@ describe("ResumeCard", () => {
onDismiss={vi.fn()}
/>,
);
+ // `data-logo` rather than the <img>: both of these are single-colour marks
+ // and are drawn as a CSS mask so they follow the theme's ink.
const codexMark = screen.getAllByTestId("agent-mark-codex")[0];
- expect(codexMark.querySelector("img")?.getAttribute("src")).toBe(
+ expect(codexMark.getAttribute("data-logo")).toBe(
"/provider-logos/openai.svg",
);
const claudeMark = screen.getAllByTestId("agent-mark-claude")[0];
- expect(claudeMark.querySelector("img")?.getAttribute("src")).toBe(
+ expect(claudeMark.getAttribute("data-logo")).toBe(
"/provider-logos/claude.svg",
);
});
diff --git a/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.tsx b/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.tsx
index 98d67bb510..037a1f0ec4 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/ResumeCard.tsx
@@ -5,6 +5,20 @@
* asymmetric decision header, one strip of real recovery facts, then dense
* workspace and agent detail. A large fleet stays readable because terminals
* collapse into a short preview and expand inside a bounded scroll region.
+ *
+ * ## Every amber here is a pair
+ *
+ * "Cannot reopen" was written as `amber-200`/`amber-300` throughout — the pale
+ * end of the ramp, which is a warning on the dark app and very nearly paper on
+ * the light one. On the light theme this screen therefore reported its one
+ * genuinely bad outcome in ink the reader could not see (maintainer,
+ * 2026-08-11).
+ *
+ * Each of those now carries a light partner in the pairing the rest of the app
+ * already uses (`text-amber-800 dark:text-amber-200`, and the equivalents for
+ * fills and borders). The gold "continues" cue lost its `/85` for the same
+ * reason: `--primary` is tuned to 5.1:1 on paper, and the alpha was spending
+ * a fifth of that on nothing.
*/
import { useState } from "react";
import {
@@ -248,14 +262,14 @@ function TerminalTile({
className={cn(
"group relative grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-2.5 border border-border/60 bg-background/35 p-2.5 transition-colors hover:border-border hover:bg-background/70",
pane.resumable && pane.available && "border-primary/25",
- !pane.available && "border-amber-400/25",
+ !pane.available && "border-amber-600/45 dark:border-amber-400/25",
)}
>
<span
className={cn(
"absolute inset-y-0 left-0 w-0.5",
!pane.available
- ? "bg-amber-300/70"
+ ? "bg-amber-600/80 dark:bg-amber-300/70"
: pane.resumable
? "bg-primary/80"
: "bg-muted-foreground/35",
@@ -271,9 +285,9 @@ function TerminalTile({
className={cn(
"shrink-0 text-[9px] font-medium uppercase tracking-[0.12em]",
!pane.available
- ? "text-amber-200"
+ ? "text-amber-800 dark:text-amber-200"
: pane.resumable
- ? "text-primary/85"
+ ? "text-primary"
: "text-muted-foreground",
)}
>
@@ -360,7 +374,7 @@ function WorkspaceRow({
))}
</div>
{!space.folder_exists && (
- <p className="mt-2 flex items-center gap-1.5 text-xs leading-relaxed text-amber-200">
+ <p className="mt-2 flex items-center gap-1.5 text-xs leading-relaxed text-amber-800 dark:text-amber-200">
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
{t("workspace_launcher.resume.folder_missing")}
</p>
@@ -390,7 +404,7 @@ function WorkspaceRow({
</span>
)}
{unavailable > 0 && (
- <span className="text-amber-200">
+ <span className="text-amber-800 dark:text-amber-200">
{fill(t("workspace_launcher.resume.unavailable_count"), {
count: unavailable,
})}
@@ -414,7 +428,7 @@ function WorkspaceRow({
style={{ width: `${(fresh / total) * 100}%` }}
/>
<span
- className="bg-amber-300/70"
+ className="bg-amber-600/80 dark:bg-amber-300/70"
style={{ width: `${(unavailable / total) * 100}%` }}
/>
</div>
@@ -491,7 +505,7 @@ function FleetManifest({
prompts: item.prompts,
})}
{item.unavailable > 0 && (
- <span className="text-amber-200">
+ <span className="text-amber-800 dark:text-amber-200">
{` · ${fill(
t("workspace_launcher.resume.fleet_unavailable"),
{ count: item.unavailable },
@@ -511,7 +525,7 @@ function FleetManifest({
style={{ width: `${(item.fresh / total) * 100}%` }}
/>
<span
- className="bg-amber-300/70"
+ className="bg-amber-600/80 dark:bg-amber-300/70"
style={{ width: `${(item.unavailable / total) * 100}%` }}
/>
</div>
@@ -533,7 +547,7 @@ function FleetManifest({
<span>{t("workspace_launcher.resume.conversation_fact")}</span>
</li>
<li className="flex gap-2.5">
- <AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-200" />
+ <AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-800 dark:text-amber-200" />
<span>{t("workspace_launcher.resume.availability_fact")}</span>
</li>
</ul>
@@ -659,7 +673,7 @@ export function ResumeCard({
{t("workspace_launcher.resume.legend_fresh")}
</span>
<span className="inline-flex items-center gap-1.5">
- <span className="h-1.5 w-1.5 bg-amber-300/80" />
+ <span className="h-1.5 w-1.5 bg-amber-600/90 dark:bg-amber-300/80" />
{t("workspace_launcher.resume.legend_unavailable")}
</span>
</div>
@@ -747,7 +761,7 @@ export function ResumeCard({
</dl>
{unavailable > 0 && (
- <p className="mt-3 flex items-center gap-2 border-l-2 border-amber-300/70 bg-amber-300/[0.04] px-3 py-2 text-xs text-amber-100">
+ <p className="mt-3 flex items-center gap-2 border-l-2 border-amber-600/70 bg-amber-600/[0.07] px-3 py-2 text-xs text-amber-900 dark:border-amber-300/70 dark:bg-amber-300/[0.04] dark:text-amber-100">
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
{fill(t("workspace_launcher.resume.unavailable_warning"), {
count: unavailable,