Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(web): lead every run's gallery with its mission map

rubenluetke10-beep706b7cc6b633
diff --git a/jarvis/ui/web/frontend/src/hooks/useVisualArtifacts.ts b/jarvis/ui/web/frontend/src/hooks/useVisualArtifacts.ts
index 9f2e15db44..42ecae4160 100644
--- a/jarvis/ui/web/frontend/src/hooks/useVisualArtifacts.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useVisualArtifacts.ts
@@ -25,7 +25,7 @@ import {
} from "@/hooks/useOutputs";
/** How a visual is put on screen — one branch of the stage per kind. */
-export type VisualKind = "image" | "vector" | "page" | "document";
+export type VisualKind = "image" | "vector" | "page" | "document" | "map";
/**
* Extension → kind. Deliberately narrow: everything here must render inside the
@@ -99,8 +99,37 @@ export function visualId(artifact: Pick<VisualArtifact, "slug" | "path">): strin
return `${artifact.slug}::${artifact.path}`;
}
+/**
+ * The synthetic path of a run's mission map. Real deliverable paths always
+ * start with `tasks/`, so this can never collide with a listed file.
+ */
+export const MISSION_MAP_PATH = "::mission-map::";
+
+/** The server-rendered node-graph page for one run (no JS, brand-themed). */
+export function missionMapUrl(slug: string): string {
+ return `/api/outputs/${encodeURIComponent(slug)}/graph`;
+}
+
function toVisuals(run: OutputSummary, files: ArtifactSummary[]): VisualArtifact[] {
- const visuals: VisualArtifact[] = [];
+ // Every successfully listed run leads with its mission map — the n8n-style
+ // node graph of what ran and what came out. It shares the run's newest
+ // mtime, and the stable sort below keeps it AHEAD of that file, so opening
+ // the section stages the newest run's map: the overview first, then its
+ // pictures. A run whose deliverables are all text still gets a visual this
+ // way, which is precisely when "what happened" needs drawing the most.
+ const newest = files.reduce((max, file) => Math.max(max, file.mtime), 0);
+ const visuals: VisualArtifact[] = [
+ {
+ slug: run.slug,
+ utterance: run.utterance,
+ path: MISSION_MAP_PATH,
+ name: "Mission map", // display label is localized in the view
+ kind: "map",
+ size: 0,
+ mtime: newest,
+ url: missionMapUrl(run.slug),
+ },
+ ];
for (const file of files) {
const kind = classifyVisual(file.path);
if (kind === null) continue;
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 30d0ece438..5f3a3e2055 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -4153,6 +4153,7 @@
"reveal": "Im Ordner zeigen",
"reveal_failed": "Die Datei konnte nicht im Ordner gezeigt werden.",
"open_from_agent": "Visualisierungen",
- "open_from_agent_hint": "Zeigt die Bilder, Diagramme und Seiten der letzten Läufe an."
+ "open_from_agent_hint": "Zeigt die Bilder, Diagramme und Seiten der letzten Läufe an.",
+ "mission_map": "Missions-Karte"
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 27e1260841..bde7f1ebad 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -4153,6 +4153,7 @@
"reveal": "Show in folder",
"reveal_failed": "That file could not be shown in the folder.",
"open_from_agent": "Visuals",
- "open_from_agent_hint": "Show the images, diagrams and pages the latest runs produced."
+ "open_from_agent_hint": "Show the images, diagrams and pages the latest runs produced.",
+ "mission_map": "Mission map"
}
}
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index f76c3ac567..38b4a7063a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -4153,6 +4153,7 @@
"reveal": "Mostrar en la carpeta",
"reveal_failed": "No se pudo mostrar el archivo en la carpeta.",
"open_from_agent": "Visuales",
- "open_from_agent_hint": "Muestra las imágenes, diagramas y páginas de las últimas ejecuciones."
+ "open_from_agent_hint": "Muestra las imágenes, diagramas y páginas de las últimas ejecuciones.",
+ "mission_map": "Mapa de la misión"
}
}
diff --git a/jarvis/ui/web/frontend/src/views/VisualizationView.test.tsx b/jarvis/ui/web/frontend/src/views/VisualizationView.test.tsx
index 36a0df9a2c..b3a8a9d9f5 100644
--- a/jarvis/ui/web/frontend/src/views/VisualizationView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/VisualizationView.test.tsx
@@ -107,7 +107,7 @@ describe("classifyVisual", () => {
});
describe("VisualizationView", () => {
- it("lists only the visual artifacts and stages the newest one", async () => {
+ it("lists the visual artifacts plus one mission map per run, map staged first", async () => {
installFetchMock(
[
{ slug: "run-new", utterance: "draw the architecture" },
@@ -125,11 +125,18 @@ describe("VisualizationView", () => {
renderView();
const gallery = await screen.findByTestId("visualization-gallery");
- await waitFor(() => expect(gallery.querySelectorAll("li")).toHaveLength(2));
+ // Two visuals + one mission map per scanned run.
+ await waitFor(() => expect(gallery.querySelectorAll("li")).toHaveLength(4));
// The .log is a deliverable, but not a picture.
expect(screen.queryByText("build.log")).toBeNull();
- // Newest file first, and the stage opens on it without a click.
+ // The newest run's mission map leads and is staged without a click — the
+ // overview of what ran comes before its individual pictures.
+ const frame = await screen.findByTestId("visualization-frame");
+ expect(frame.getAttribute("src")).toContain("/api/outputs/run-new/graph");
+
+ // Its pictures are one click away.
+ fireEvent.click(screen.getByText("diagram.svg"));
const image = await screen.findByTestId("visualization-image");
expect(image.getAttribute("src")).toContain("diagram.svg");
});
@@ -168,13 +175,27 @@ describe("VisualizationView", () => {
expect(screen.queryByTestId("visualization-image")).toBeNull();
});
- it("says so when the scanned runs produced nothing visual", async () => {
+ it("still offers the mission map when a run produced nothing visual", async () => {
+ // A text-only run is exactly when "what happened" needs drawing the most:
+ // the map is the run's one visual, and file actions (download/reveal) are
+ // absent because a server-rendered page is not an archived file.
installFetchMock([{ slug: "run-1", utterance: "tidy the notes" }], {
"run-1": [file("notes.md", { is_text: true })],
});
renderView();
+ const frame = await screen.findByTestId("visualization-frame");
+ expect(frame.getAttribute("src")).toContain("/api/outputs/run-1/graph");
+ expect(screen.queryByText("notes.md")).toBeNull();
+ expect(screen.queryByTitle("Save a copy")).toBeNull();
+ });
+
+ it("says so when there are no runs at all", async () => {
+ installFetchMock([], {});
+
+ renderView();
+
await screen.findByTestId("visualization-empty");
expect(screen.queryByTestId("visualization-stage")).toBeNull();
});
diff --git a/jarvis/ui/web/frontend/src/views/VisualizationView.tsx b/jarvis/ui/web/frontend/src/views/VisualizationView.tsx
index 8d246fd932..1fa8d6e5ba 100644
--- a/jarvis/ui/web/frontend/src/views/VisualizationView.tsx
+++ b/jarvis/ui/web/frontend/src/views/VisualizationView.tsx
@@ -9,6 +9,7 @@ import {
Maximize2,
RefreshCw,
ShieldAlert,
+ Workflow,
ZoomIn,
ZoomOut,
} from "lucide-react";
@@ -179,6 +180,7 @@ export function VisualizationView() {
<ul className="space-y-1 p-2" data-testid="visualization-gallery">
{visuals.map((artifact) => {
const id = visualId(artifact);
+ const isMap = artifact.kind === "map";
return (
<li key={id}>
<button
@@ -192,10 +194,14 @@ export function VisualizationView() {
: "text-muted-foreground hover:bg-secondary/60 hover:text-foreground",
)}
>
- <FileImage className="h-3.5 w-3.5 shrink-0" aria-hidden />
+ {isMap ? (
+ <Workflow className="h-3.5 w-3.5 shrink-0 text-primary" aria-hidden />
+ ) : (
+ <FileImage className="h-3.5 w-3.5 shrink-0" aria-hidden />
+ )}
<span className="min-w-0 flex-1">
<span className="block truncate font-medium text-foreground">
- {artifact.name}
+ {isMap ? t("visualization.mission_map") : artifact.name}
</span>
<span className="block truncate">{runLabel(artifact)}</span>
</span>
@@ -245,9 +251,15 @@ export function VisualizationView() {
every pixel spent on chrome is a pixel off the picture. */}
<footer className="flex shrink-0 items-center gap-3 border-t border-border px-4 py-2">
<div className="min-w-0 flex-1">
- <p className="truncate text-xs font-medium">{selected.path}</p>
+ <p className="truncate text-xs font-medium">
+ {selected.kind === "map"
+ ? t("visualization.mission_map")
+ : selected.path}
+ </p>
<p className="truncate text-[11px] text-muted-foreground">
- {runLabel(selected)} · {formatSize(selected.size)}
+ {selected.kind === "map"
+ ? runLabel(selected)
+ : `${runLabel(selected)} · ${formatSize(selected.size)}`}
</p>
</div>
@@ -298,18 +310,22 @@ export function VisualizationView() {
<ExternalLink className="mr-1.5 h-3.5 w-3.5" aria-hidden />
{t("visualization.open_external")}
</Button>
- <Button variant="ghost" size="sm" asChild>
- <a
- href={artifactDownloadUrl(selected.slug, selected.path)}
- download
- title={t("visualization.download")}
- >
- <Download className="h-3.5 w-3.5" aria-hidden />
- </a>
- </Button>
+ {/* The mission map is a server-rendered page, not an archived
+ file — there is nothing to download or reveal. */}
+ {selected.kind !== "map" && (
+ <Button variant="ghost" size="sm" asChild>
+ <a
+ href={artifactDownloadUrl(selected.slug, selected.path)}
+ download
+ title={t("visualization.download")}
+ >
+ <Download className="h-3.5 w-3.5" aria-hidden />
+ </a>
+ </Button>
+ )}
{/* Desktop only: a headless host has no file manager to open,
so the button is absent rather than dead. */}
- {capabilities.data?.native_file_actions && (
+ {selected.kind !== "map" && capabilities.data?.native_file_actions && (
<Button
variant="ghost"
size="sm"