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.

perf(deck): the sweep is a transform, not sixty renders a second

Harald2c3da2d06ec1
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx
index 52f550d683..89375ada03 100644
--- a/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx
+++ b/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useId, useMemo, useRef, useState } from "react";
+import { useEffect, useId, useMemo, useRef } from "react";
import { useEventStore, type VoiceState } from "@/store/events";
import { JarvisOrb } from "@/components/deck/JarvisOrb";
import type { ThinkingStep } from "@/lib/thinkingSteps";
@@ -82,22 +82,6 @@ export function DeckOrb({
[],
);
- const [sweep, setSweep] = useState(0);
- const raf = useRef<number | null>(null);
- useEffect(() => {
- if (!busy || reduced) return;
- let start: number | null = null;
- const tick = (ts: number) => {
- if (start === null) start = ts;
- setSweep(((ts - start) / 30) % 360);
- raf.current = requestAnimationFrame(tick);
- };
- raf.current = requestAnimationFrame(tick);
- return () => {
- if (raf.current !== null) cancelAnimationFrame(raf.current);
- };
- }, [busy, reduced]);
-
const R = size / 2;
// The sphere sat at 0.78 of the reticle and left a ring of nothing around
// it. Gigi carries a lot of air inside its own 256 viewBox — the figure is
@@ -122,8 +106,20 @@ export function DeckOrb({
};
});
- const [sx, sy] = point(sweep, R * 0.94);
- const [ex, ey] = point(sweep + 36, R * 0.94);
+ // The sweep is drawn ONCE, at rest, and turned by CSS (`.deck-orb-sweep`,
+ // index.css). It used to be an animation-frame loop that put its angle in
+ // React state: sixty renders a second of this whole component, each one
+ // rewriting the arc's `d` INSIDE the halo filter, which forced the filter
+ // to raster again — on the CPU, at every frame, while the deck was busy.
+ // That is exactly when a person is waiting for an answer and watching the
+ // centre, and on a four-core laptop it is what made the deck crawl
+ // (maintainer, 2026-08-21: "1 FPS"). The geometry never changed; only the
+ // angle did, and an angle is a transform. So it is one now, on its own
+ // unfiltered group with the same halo as a cheap `drop-shadow`, the way
+ // `.deck-ring-orbit` already turns the standby's ring: compositor work,
+ // no render, no repaint, no filter pass.
+ const [sx, sy] = point(0, R * 0.94);
+ const [ex, ey] = point(36, R * 0.94);
const haloId = useId();
// The corners used to carry four readouts, and two of them were counters
@@ -216,17 +212,24 @@ export function DeckOrb({
opacity={0.95}
/>
))}
+ </g>
+ {/* The sweep turns on its OWN group, outside the halo filter: a
+ filtered group has to be rastered again every time anything
+ inside it moves, and this one moves every frame. It carries the
+ same halo as a `drop-shadow` in CSS, which is rastered once and
+ then only turned. */}
{busy && !reduced && (
- <path
- d={`M ${sx} ${sy} A ${R * 0.94} ${R * 0.94} 0 0 1 ${ex} ${ey}`}
- fill="none"
- stroke="hsl(var(--primary))"
- strokeWidth={2}
- strokeLinecap="butt"
- opacity={0.7}
- />
+ <g className="deck-orb-sweep">
+ <path
+ d={`M ${sx} ${sy} A ${R * 0.94} ${R * 0.94} 0 0 1 ${ex} ${ey}`}
+ fill="none"
+ stroke="hsl(var(--primary))"
+ strokeWidth={2}
+ strokeLinecap="butt"
+ opacity={0.7}
+ />
+ </g>
)}
- </g>
</svg>
{/* Ripples: one ring per word landing, leaving the figure for the edge.
diff --git a/jarvis/ui/web/frontend/src/index.css b/jarvis/ui/web/frontend/src/index.css
index 7ff1d5e9d0..a2bebeccc1 100644
--- a/jarvis/ui/web/frontend/src/index.css
+++ b/jarvis/ui/web/frontend/src/index.css
@@ -669,6 +669,24 @@
);
}
+ /*
+ * The vibrating plate (ChladniField).
+ *
+ * It rides ON the wallpaper, so its weight is set here rather than in the
+ * canvas: the component paints the sand at full strength and this decides
+ * how much of the picture underneath it is allowed to cover. Dark gets more
+ * of it — hot sand on a dark ground reads as light and does not compete
+ * with the artwork. Light gets less, because dark ink over a bright picture
+ * hides it rather than lighting it, and the maintainer's standing rule for
+ * light mode is that the wallpaper stays genuinely visible (see below).
+ */
+ .jarvis-chladni-field {
+ opacity: 0.5;
+ }
+ :root:not(.dark) .jarvis-chladni-field {
+ opacity: 0.34;
+ }
+
/* Light keeps the artwork untinted (no darkening filter), but it retains
the contrast veil: the veil is built from --shell-rgb, so on paper it
settles the edges of the frame — where chrome text lives — with a faint
@@ -2238,6 +2256,25 @@
filter: drop-shadow(0 0 1.2px hsl(var(--background) / 0.85));
animation: deck-orb-turn 90s linear infinite reverse;
}
+ /* The orb's sweep: one arc that turns while the deck has something
+ running (DeckOrb.tsx). It used to take its angle from an
+ animation-frame loop through React state — sixty renders a second of
+ the whole centre, each one rewriting the arc's `d` inside the halo
+ filter, so the filter rastered again on the CPU at every frame. It was
+ doing that exactly while a person waited for an answer, and on a
+ four-core laptop the deck fell to a frame a second. Same arc, same
+ speed (a turn every 10.8 s), same halo — as a transform the compositor
+ owns, so a busy deck costs the main thread NOTHING now.
+
+ It sits outside the halo filter for that reason: a filtered group is
+ rastered again whenever anything in it moves. */
+ .deck-orb-sweep {
+ transform-box: view-box;
+ transform-origin: 50% 50%;
+ will-change: transform;
+ filter: drop-shadow(0 0 1.2px hsl(var(--background) / 0.85));
+ animation: deck-orb-turn 10.8s linear infinite;
+ }
@keyframes deck-orb-turn {
to {
transform: rotate(360deg);
@@ -2248,6 +2285,7 @@
.deck-orb-glow,
.deck-orb-corona,
.deck-orb-ripple,
+ .deck-orb-sweep,
.deck-ring-orbit {
animation: none !important;
}