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): ship the app mark as a fingerprinted bundle asset

rubenluetke10-beep70979836b811
diff --git a/jarvis/ui/web/frontend/src/assets/jarvis-mark.png b/jarvis/ui/web/frontend/src/assets/jarvis-mark.png
new file mode 100644
index 0000000000..98d8d008c4
Binary files /dev/null and b/jarvis/ui/web/frontend/src/assets/jarvis-mark.png differ
diff --git a/jarvis/ui/web/frontend/src/components/GigiMark.tsx b/jarvis/ui/web/frontend/src/components/GigiMark.tsx
index 3a67be5a3d..de48f1d8d7 100644
--- a/jarvis/ui/web/frontend/src/components/GigiMark.tsx
+++ b/jarvis/ui/web/frontend/src/components/GigiMark.tsx
@@ -1,19 +1,18 @@
-import { useState } from "react";
-
+import gigiMark from "@/assets/jarvis-mark.png";
import { cn } from "@/lib/utils";
-const LOGO_RETRY_MAX = 5;
-const LOGO_RETRY_BASE_MS = 1500;
-const MARK_SRC = "/jarvis-gigi-256.png";
-
/**
* The Gigi app mark: the desktop app icon itself, at any size.
*
- * The tile — ink squircle, paper ghost, hairline edge — is baked into the PNG
- * by `scripts/make_gigi_app_icon.py`, so this renders no background, no radius
- * and no shadow of its own. Anything drawn here would sit behind an already
- * masked shape and show as a square. Do not swap this for the live SVG mascot
- * in chrome; that one moves, this one identifies the app.
+ * The tile — pool of light, ink Gigi, hairline edge — is baked into the PNG by
+ * `scripts/make_gigi_app_icon.py`, so this renders no background, no radius and
+ * no shadow of its own. Anything drawn here would sit behind an already masked
+ * shape and show as a square.
+ *
+ * The image is imported rather than referenced as `/jarvis-gigi-256.png`, so
+ * Vite fingerprints it: a public/ file keeps its name across every redraw and
+ * browsers go on serving the cached one. Do not swap this for the live SVG
+ * mascot in chrome; that one moves, this one identifies the app.
*/
export function GigiMark({
size,
@@ -24,21 +23,15 @@ export function GigiMark({
className?: string;
alt?: string;
}) {
- const [retry, setRetry] = useState(0);
return (
<img
- src={retry === 0 ? MARK_SRC : `${MARK_SRC}?retry=${retry}`}
+ src={gigiMark}
width={size}
height={size}
alt={alt}
className={cn("shrink-0 select-none", className)}
style={{ width: size, height: size }}
draggable={false}
- onError={() => {
- if (retry < LOGO_RETRY_MAX) {
- window.setTimeout(() => setRetry((n) => n + 1), (retry + 1) * LOGO_RETRY_BASE_MS);
- }
- }}
/>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
index 99030cc53a..84e5022e97 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.test.tsx
@@ -233,33 +233,18 @@ describe("Sidebar header avatar", () => {
overlayMock.style = "jarvis_bar";
});
- test("renders the Gigi app mark", () => {
+ // The mark is a bundled import, so its URL carries a build hash and there is
+ // nothing stable to assert. What matters is that the avatar shows the mark
+ // and not a stale public/ path a browser would serve from cache.
+ test("renders the Gigi app mark from the bundle, not a public path", () => {
const { container } = renderSidebar();
const avatar = container.querySelector('[data-testid="sidebar-style-avatar"]');
expect(avatar).not.toBeNull();
expect(avatar?.getAttribute("data-variant")).toBe("logo");
const logo = avatar?.querySelector("img") as HTMLImageElement;
- expect(logo.getAttribute("src")).toBe("/jarvis-gigi-256.png");
- });
-
- test("retries a failed logo load with a cache-busted URL (self-healing)", () => {
- vi.useFakeTimers();
- try {
- const { container } = renderSidebar();
- const logo = container.querySelector(
- '[data-testid="sidebar-style-avatar"] img',
- ) as HTMLImageElement;
- expect(logo.getAttribute("src")).toBe("/jarvis-gigi-256.png");
-
- act(() => {
- logo.dispatchEvent(new Event("error"));
- vi.advanceTimersByTime(2_000);
- });
-
- expect(logo.getAttribute("src")).toBe("/jarvis-gigi-256.png?retry=1");
- } finally {
- vi.useRealTimers();
- }
+ const src = logo.getAttribute("src") ?? "";
+ expect(src).toContain("jarvis-mark");
+ expect(src.startsWith("/jarvis-")).toBe(false);
});
});
diff --git a/scripts/make_gigi_app_icon.py b/scripts/make_gigi_app_icon.py
index 80dce3cb99..7ffdb4ef8f 100644
--- a/scripts/make_gigi_app_icon.py
+++ b/scripts/make_gigi_app_icon.py
@@ -321,6 +321,10 @@ def main() -> None:
ROOT / "jarvis" / "assets" / "icons" / "jarvis.png",
ROOT / "assets" / "icons" / "jarvis-gigi-256.png",
ROOT / "jarvis" / "ui" / "web" / "frontend" / "public" / "jarvis-gigi-256.png",
+ # Bundled copy: imported by GigiMark so Vite gives it a content hash.
+ # A public/ file keeps its name forever, and browsers keep serving the
+ # cached one — the reason a redrawn icon does not show up in the app.
+ ROOT / "jarvis" / "ui" / "web" / "frontend" / "src" / "assets" / "jarvis-mark.png",
):
write_png(path, tile_256)
write_png(