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(bar): the Jarvis Bar thinks with the deck's sweep, not an orbital core

Haraldcd9ddc538f42
diff --git a/docs/os-parity.md b/docs/os-parity.md
index 03408e8aab..1ecbe99f10 100644
--- a/docs/os-parity.md
+++ b/docs/os-parity.md
@@ -238,7 +238,7 @@ experiences today.
| P-18 | Low | Agent accounts | Multi-subscription switching gives each account its own CLI config directory (`CLAUDE_CONFIG_DIR` / `CODEX_HOME`) — the CLIs' own documented override. On macOS, Claude Code keeps its credentials in the **Keychain** rather than in that directory, and whether a second config dir earns a second Keychain entry is UNVERIFIED on this hardware (everything here was measured on Windows) | `jarvis/agent_accounts.py::describe`, `env_overrides` | Windows/Linux: a second Claude seat works as designed (its `.credentials.json` lives in its own folder). macOS: the added account may come back reporting **"Not signed in"** after a completed sign-in — which is the honest outcome, not a crash: the switcher never claims a login it cannot read, so a pane is never silently routed to the first account's credentials. Codex is unaffected on all three OSes (`auth.json` is a plain file). Next Mac session: add a second Claude account, sign in, and check whether `describe()` reports it connected |
| P-20 | Low | Coding-CLI panes | Kimi Code panes deliberately ship WITHOUT multi-subscription switching, unlike Claude Code and Codex. Three independent reasons, all recorded on the registry entry: the wound-down Python generation ignores `KIMI_CODE_HOME` entirely, so seats created on a machine that has it would all silently resolve to one login; its configuration and its credentials share a single `config.toml`, so no setup can be carried to a new seat without carrying the key with it; and its credential layout is unverified against a live install of the current generation | `jarvis/workspace/agents.py` (the `kimi` entry), `jarvis/agent_accounts.py::platforms` | All OSes: one Kimi login, and the account switcher honestly does not offer the CLI at all rather than showing a switch that does nothing. Unblocked by verifying the current generation's credential layout and gating the override on the generation probe |
-| P-22 | Low | Orb window | The floating orb window (both looks: the Gigi mascot and the procedural **voice orb**) is a Tk window whose transparency comes from a colour key. Windows keys it out natively; macOS uses Aqua-Tk's `-transparent` in the companion host; on Linux the attribute is accepted only under a **compositing** window manager, and not at all on Wayland | `ui/orb/overlay.py::_apply_color_key`, `_build_renderer`, `jarvis/ui/jarvisbar/host.py::_build_surface` | Windows/macOS: full parity, including drag-to-any-monitor and the live mascot↔voice-orb switch. Linux with a compositor (GNOME/KDE/picom): works. Linux without one, and Wayland: the window would be an opaque magenta square, so it is NOT shown — the surface logs one actionable English line and stays hidden; voice, tray and the app window are unaffected. Note the Jarvis Bar degrades DIFFERENTLY on such a session (it keeps drawing and shows its key colour — pre-existing, `jarvis/ui/jarvisbar/overlay.py:738`), so "None (hidden)" is the honest display style on a non-compositing Linux desktop until the bar adopts the same gate |
+| P-22 | Low | Orb window | The floating orb window (both looks: the Gigi mascot and the procedural **voice orb**) is a Tk window whose transparency comes from a colour key. Windows keys it out natively; macOS uses Aqua-Tk's `-transparent` in the companion host; on Linux the attribute is accepted only under a **compositing** window manager, and not at all on Wayland | `ui/orb/overlay.py::_apply_color_key`, `_build_renderer`, `jarvis/ui/jarvisbar/host.py::_build_surface` | Windows/macOS: full parity, including drag-to-any-monitor and the live mascot↔voice-orb switch. Linux with a compositor (GNOME/KDE/picom): works. Linux without one, and Wayland: the window would be an opaque magenta square, so it is NOT shown — the surface logs one actionable English line and stays hidden; voice, tray and the app window are unaffected. Note the Jarvis Bar degrades DIFFERENTLY on such a session (it keeps drawing and shows its key colour — pre-existing, the `transparentcolor unsupported` branch in `jarvis/ui/jarvisbar/overlay.py::JarvisBarOverlay.start`), so "None (hidden)" is the honest display style on a non-compositing Linux desktop until the bar adopts the same gate |
| P-21 | Low | Coding-CLI panes | OpenCode panes ship single-login for the same class of reason: the only variable that moves its credentials and session database is `XDG_DATA_HOME`, which is a SHARED variable rather than a dedicated override — redirecting it per pane would also redirect any other XDG-aware tool the agent spawns inside that pane | `jarvis/workspace/agents.py` (the `opencode` entry) | All OSes: one OpenCode login. Verified on Windows that `XDG_DATA_HOME` does move `auth.json` and the session database; the blast radius on macOS and Linux has not been measured, which is why it is not wired up |
| P-22 | Low | Coding-CLI panes | Kimi Code uses the bundled Git Bash as its shell environment on Windows, so without Git for Windows installed the binary answers `--version` correctly and the agent then cannot run a single shell command | Kimi vendor docs; `jarvis/workspace/agents.py` (the `kimi` entry) | Windows without Git for Windows: the pane opens, the CLI reports a healthy version, and shell commands fail inside it. macOS/Linux unaffected. `KIMI_SHELL_PATH` points at a non-standard `bash.exe`. An install check that only runs `--version` cannot see this |
| P-23 | Info | Coding-CLI panes | Kimi Code's alternate screen cannot be disabled (an open upstream request notes it is the outlier versus Claude Code, Codex and the Gemini CLI), so it may conflict with the pane's own scrollback the way a Claude Code pane once did | Upstream issue; `jarvis/agentic_ide/screen.py` | All OSes equally — not an OS gap, recorded here because it is the same class of pane defect and is expected to need the same kind of fix |
diff --git a/jarvis/ui/jarvisbar/overlay.py b/jarvis/ui/jarvisbar/overlay.py
index 0508eb3d2f..afc8f0f52b 100644
--- a/jarvis/ui/jarvisbar/overlay.py
+++ b/jarvis/ui/jarvisbar/overlay.py
@@ -10,7 +10,7 @@ Signals:
``OrbBusBridge`` forwards it to this surface without opening a second mic.
- SPEAKING: the audio player publishes its output RMS via ``level_tap``, which
this surface subscribes to on ``start()``.
-- THINKING: the renderer generates a synthetic wave (no external signal).
+- THINKING: the renderer sweeps a highlight along the row (no external signal).
Threading mirrors the orb: a daemon thread runs the Tk mainloop; all Tk
mutations from the bus-subscriber thread go through ``_enqueue_ui`` → a queue
@@ -82,12 +82,12 @@ _WIN32_TOPMOST_FLAGS = _SWP_NOSIZE | _SWP_NOMOVE | _SWP_NOACTIVATE | _SWP_NOOWNE
# Sound-driven look. The bar shows the speaking equalizer (bars) ONLY while real
# audio is present — mic input while you speak, or TTS output while Jarvis speaks
-# — and the thinking wave during silence (brain thinking AND the silent
+# — and the thinking sweep during silence (brain thinking AND the silent
# TTS-synthesis lead-in). This tracks actual sound instead of the supervisor
# state, which is unreliable here (continue-listening flips SPEAKING→LISTENING
# mid-playback). AUDIBLE_LEVEL is the normalized 0..1 level above which a
# set_level() counts as "sound now"; AUDIBLE_HOLD_S keeps the bars up across the
-# short word/sentence gaps so they don't flap back to the wave on every pause.
+# short word/sentence gaps so they don't flap back to the sweep on every pause.
AUDIBLE_LEVEL = 0.06
AUDIBLE_HOLD_S = 0.5
@@ -130,8 +130,12 @@ FRAME_STALL_THRESHOLD_NS = 2_000_000_000 # 2 s of silence ⇒ the loop is dead
# pure GIL contention, so it is deliberately NOT used). What this loop CAN
# do is shrink its own contribution to that contention — the idle-skip
# above is the main lever, and adaptive pacing (below) prevents an
-# occasional slow render (measured up to ~30ms in "think"+hovered mode)
-# from compounding into an even longer visible gap.
+# occasional slow render (measured up to ~30ms in "think"+hovered mode,
+# back when thinking drew a supersampled orbital core; the travelling
+# sweep that replaced it costs the same as the equalizer — 3.2x less than
+# the core, measured 2026-08-20 — so the pacing now has far less to
+# absorb, but the states it protects are unchanged) from compounding into
+# an even longer visible gap.
#
# Idle-static skip: EVERY branch renderer.render() can reach while the coarse
# mode is "idle" is time-independent (the empty resting pill, the hovered
@@ -394,8 +398,8 @@ class JarvisBarOverlay:
self._mode = "idle"
self._ext_level = 0.0
# perf_counter() of the last set_level() that carried real sound
- # (>= AUDIBLE_LEVEL). Drives the wave↔bars choice in _schedule_frame.
- # 0.0 = "long ago" → starts on the wave, not the bars.
+ # (>= AUDIBLE_LEVEL). Drives the sweep↔bars choice in _schedule_frame.
+ # 0.0 = "long ago" → starts on the sweep, not the bars.
self._last_audible_t = 0.0
# perf_counter() of the last set_level() of ANY value. The frame loop
# renders _ext_level only while fresh (renderer.LEVEL_STALE_S): a feed
@@ -535,7 +539,7 @@ class JarvisBarOverlay:
self._last_level_rx_t = time.perf_counter()
# Remember WHEN real sound last arrived (mic or TTS, both feed here via
# their level taps). _schedule_frame uses this to show bars while sound
- # is present and the wave during silence. Atomic float write, like
+ # is present and the sweep during silence. Atomic float write, like
# _ext_level — safe from the audio/VAD threads with no lock.
if lv >= AUDIBLE_LEVEL:
self._last_audible_t = self._last_level_rx_t
diff --git a/jarvis/ui/jarvisbar/renderer.py b/jarvis/ui/jarvisbar/renderer.py
index c7dc1b8d62..df480dd00a 100644
--- a/jarvis/ui/jarvisbar/renderer.py
+++ b/jarvis/ui/jarvisbar/renderer.py
@@ -8,12 +8,12 @@ State → look:
- ``idle`` → muted grey dots in a collapsed pill
- ``listen`` → gold equalizer bars, height driven by the live mic level
- ``speak`` → gold equalizer bars, height driven by the live TTS level
-- ``think`` → the "orbital core": a breathing gold core with two comet
- sparks counter-orbiting on tilted ellipses (synthetic,
- ignores level). Replaced the old travelling sine wave,
- which read as a generic-AI visual.
+- ``think`` → the SWEEP: the same row of strokes, with one soft highlight
+ travelling along it (synthetic, ignores level). It is the
+ mission deck header bar's "working" look, brought over here so
+ the two bars read as one product.
- ``dictate`` → the equalizer, driven by the dictation mic level.
-- ``dictate_transcribing`` → the orbital core: recording has stopped and the
+- ``dictate_transcribing`` → the sweep: recording has stopped and the
transcription is running, so there IS something to represent.
- ``notice`` → a breathing red cross in an opened pill: something the user
asked for did not happen. The bar carries no text, so this look
@@ -578,8 +578,8 @@ def visual_mode(
SPEAKING transition; continue-listening flips back to LISTENING mid-playback
while Jarvis is still talking). So:
- The orbital core (the animated "indicator") belongs ONLY to active
- thinking. Three distinct looks:
+ The sweep (the animated "indicator") belongs ONLY to active thinking.
+ Three distinct looks:
- ``idle`` → ``idle`` (the standby pill). Silence here is not "thinking".
- Real sound — ``playback_active`` (TTS audio on the device right now) OR a
@@ -590,7 +590,7 @@ def visual_mode(
blocks for the whole multi-second playback with no further level.
- Silent + ``coarse_mode == "think"`` (the THINKING state, and the silent
TTS-synthesis lead-in which the bridge also shows as ``"think"``) → the
- orbital core. This is the only place an indicator animates.
+ sweep. This is the only place an indicator animates.
- Silent + any OTHER active state (``"listen"`` — waiting after "Hey Jarvis"
with no speech) → ``"speak"`` too, but with no level the equalizer renders
flat and STILL: bars that just stand there, no indicator. "When nothing
@@ -604,11 +604,11 @@ def visual_mode(
be overruled by a stale level sample:
- ``dictate`` (the user is speaking into the dictation mic) always renders
- as the equalizer. A SPEAKING dictation must never show the thinking core:
+ as the equalizer. A SPEAKING dictation must never show the sweep:
the mic level is being fed, so a silent pause mid-sentence shows still
bars rather than falling through and pretending to think.
- ``dictate_transcribing`` (the key was released, the transcription is
- running) renders as the orbital core. Here there genuinely IS work in
+ running) renders as the sweep. Here there genuinely IS work in
flight to represent, and the mic feed has stopped — showing the equalizer
would claim the bar is still listening when it is not.
@@ -651,160 +651,99 @@ def bar_heights(
return out
-# --- thinking: the "orbital core" --------------------------------------------
-# A breathing gold core with two thought-sparks counter-orbiting on tilted
-# ellipses. The periods are deliberately incommensurate so the composite
-# figure never visibly repeats — it reads as churning thought, not a loop.
-# Sparks carry a depth value: on the far half of their orbit they render
-# smaller/dimmer and BEHIND the core, on the near half bigger/brighter and in
-# front — a pseudo-3D gyroscope inside a 34 px pill.
-
-
-@dataclass(frozen=True)
-class OrbitSpec:
- period_s: float # seconds per revolution; the sign is the spin direction
- rx_frac: float # ellipse semi-axis (own x) / pill width
- ry_frac: float # ellipse semi-axis (own y) / pill height
- tilt_rad: float # rotation of the ellipse within the pill plane
- phase: float # angular offset so the sparks never start aligned
-
-
-ORBITS: tuple[OrbitSpec, ...] = (
- OrbitSpec(period_s=3.1, rx_frac=0.40, ry_frac=0.34, tilt_rad=-0.26, phase=0.7),
- OrbitSpec(period_s=-1.95, rx_frac=0.43, ry_frac=0.24, tilt_rad=0.42, phase=2.4),
-)
+# --- thinking: the travelling sweep ------------------------------------------
+# One soft highlight runs along the equalizer row, over and over: the strokes
+# under it rise and brighten, the rest stay low and dim, and the highlight
+# leaves on the right to re-enter on the left, so the motion never visibly
+# restarts.
+#
+# Why a sweep and not an indicator of its own. The bar has exactly ONE graphic
+# vocabulary — a row of strokes — and thinking is the one active state with no
+# measured signal behind it. A sweep promises MOTION and nothing else, which is
+# the honest claim here: work is in flight, and none of it is a microphone
+# reading. Everything measured (your voice, Jarvis's voice) drives the same row
+# by level instead, so the two can never be read as each other: level-driven
+# bars jitter in place, the sweep travels.
+#
+# This is the look the mission deck's header bar already uses for its "working"
+# phase (``frontend/src/components/overlay/voiceBars.ts::sweepGain``); the
+# numbers below are that surface's, converted to this pill's fractions, so the
+# two bars read as one product. Changing one means changing the other.
+#
+# It replaced the "orbital core" (a breathing sphere with counter-orbiting comet
+# sparks, 2026-06 → 2026-08): maintainer verdict — the deck's sweep reads better,
+# and the core was also the most expensive frame the bar drew (a 3x supersampled
+# RGBA layer + LANCZOS downscale, ~30 ms measured while hovered) in the one state
+# that runs for seconds at a time.
+
+THINK_SWEEP_PERIOD_S = 1.05 # seconds for one pass across the row
+THINK_SWEEP_WIDTH = 0.16 # gaussian half-width, in row fractions
+THINK_BASE_V = 0.21 # bar level away from the highlight (0..1)
+THINK_PEAK_V = 0.93 # bar level right under it
+THINK_DIM = 0.30 # bar brightness away from the highlight (0..1)
+# Bars in the narrow row drawn while the controls are up. More than the
+# equalizer's five, because a sweep needs samples to read as travelling rather
+# than hopping — and unlike the equalizer they carry no level, so a denser row
+# costs nothing in legibility.
+THINK_HOVER_BARS = 7
+
+
+def sweep_phase(t: float, period_s: float = THINK_SWEEP_PERIOD_S) -> float:
+ """Position of the highlight along the row, wrapped to ``[0, 1)``."""
+ if period_s <= 0.0:
+ return 0.0
+ return (t / period_s) % 1.0
+
+
+def sweep_gain(
+ index: int, count: int, phase: float, width: float = THINK_SWEEP_WIDTH
+) -> float:
+ """Brightness of bar ``index`` under a highlight sitting at ``phase``.
-TRAIL_N = 12 # samples per comet tail
-TRAIL_SPAN_S = 0.50 # how far back in time the tail reaches
-
-_CORE_R_FRAC = 0.115 # core radius / pill height (slimmer: the ring needs room)
-_CORE_BREATH = 0.20 # breathing amplitude as a fraction of the base radius
-_CORE_BREATH_RAD_S = 3.2 # breathing speed (rad/s ≈ one breath every 2 s)
-_CORE_BREATH2 = 0.07 # slower second breath layered in — kills the metronome feel
-_CORE_BREATH2_RAD_S = 1.3
-
-# The whole reactor FLOATS: the core (and with it the ring, highlight and the
-# spark orbits) drifts on a slow two-frequency Lissajous path plus a faint
-# faster wobble. A position-pinned core read as "starr" — twice — even with
-# the ring glint; motion of the body itself is what reads as alive.
-DRIFT_AX_FRAC = 0.062 # max |dx| / pill width (incl. the micro wobble)
-DRIFT_AY_FRAC = 0.090 # max |dy| / pill height
-_DRIFT_WX = 0.80 # rad/s — horizontal float
-_DRIFT_WY = 1.27 # rad/s — vertical float (incommensurate with WX)
-_DRIFT_W_MICRO = 1.9 # rad/s — faint quick wobble on top
-_DRIFT_MICRO_FRAC = 0.012 # micro wobble amplitude / pill width
-_SPARK_R_FRAC = 0.058 # spark radius / pill height (clearly below the core)
-_SPARK_DEPTH_SIZE = 0.30 # spark size swing between far and near orbit half
-
-# The core's saturn ring: a perspective-flattened ellipse hugging the sphere,
-# with a glint of light travelling around it. This is what keeps the centre
-# alive — a bare static dot read as dead (user feedback 2026-06-10).
-_RING_RX = 2.05 # ring semi-axis x / core radius
-_RING_RY = 0.62 # ring semi-axis y / core radius (perspective squash)
-_RING_TILT_RAD = -0.18 # slight tilt so the ring reads as 3D, not as an "0"
-_RING_N = 28 # polyline samples around the ring
-_RING_GLINT_RAD_S = 3.0 # how fast the light runs around the ring (rad/s)
-_HILITE_SWING_RAD_S = 0.9 # specular drift speed — a slowly turning sphere
-
-
-def core_radius(t: float, ph: float) -> float:
- """Breathing radius of the thinking core — always well inside the pill.
-
- Two layered sine rhythms so the pulse feels organic, not metronomic.
+ The distance is measured around a ring, so the highlight leaves on the
+ right and re-enters on the left without a visible jump. Direct mirror of
+ the web surface's ``sweepGain``.
"""
- base = ph * _CORE_R_FRAC
- breath = _CORE_BREATH * math.sin(t * _CORE_BREATH_RAD_S)
- breath += _CORE_BREATH2 * math.sin(t * _CORE_BREATH2_RAD_S)
- return base * (1.0 + breath)
-
+ if count <= 1:
+ return 1.0
+ pos = index / (count - 1)
+ wrapped = phase - math.floor(phase)
+ d = abs(pos - wrapped)
+ if d > 0.5:
+ d = 1.0 - d
+ return math.exp(-(d * d) / (2.0 * width * width))
-def core_drift(t: float, pw: float, ph: float) -> tuple[float, float]:
- """Floating offset of the whole reactor relative to the pill centre.
- Slow two-frequency Lissajous plus a faint quicker wobble — visible
- within a ~3 s thinking phase, bounded by DRIFT_A*_FRAC, never looping.
- """
- main = (DRIFT_AX_FRAC - _DRIFT_MICRO_FRAC) * pw
- dx = math.sin(t * _DRIFT_WX) * main
- dx += math.sin(t * _DRIFT_W_MICRO + 0.8) * _DRIFT_MICRO_FRAC * pw
- dy = math.sin(t * _DRIFT_WY + 1.1) * DRIFT_AY_FRAC * ph
- return (dx, dy)
+def sweep_gains(
+ t: float,
+ n: int,
+ *,
+ period_s: float = THINK_SWEEP_PERIOD_S,
+ width: float = THINK_SWEEP_WIDTH,
+) -> list[float]:
+ """The whole row's brightness at time ``t`` — one 0..1 value per bar."""
+ phase = sweep_phase(t, period_s)
+ return [sweep_gain(i, n, phase, width) for i in range(n)]
-def core_ring_points(
- t: float, r: float, n: int = _RING_N
-) -> list[tuple[float, float, float, float]]:
- """Saturn-ring samples around the core: ``(dx, dy, depth, glint)``.
+def sweep_bar_heights(
+ gains: list[float], *, max_h: float, min_h: float
+) -> list[float]:
+ """Bar heights for a row of sweep gains, bounded by ``[min_h, max_h]``.
- ``depth`` < 0 marks the half that passes BEHIND the sphere; ``glint`` is
- the 0..1 brightness of the travelling light at that point. Coordinates
- are relative to the core centre.
+ Deterministic in the gains alone, so the height curve is testable without
+ a clock. ``THINK_BASE_V`` keeps the unlit strokes visibly present — a row
+ that collapses to the resting height between passes reads as a bar that
+ died, not one that is working.
"""
- ct, st = math.cos(_RING_TILT_RAD), math.sin(_RING_TILT_RAD)
- rx, ry = r * _RING_RX, r * _RING_RY
- out: list[tuple[float, float, float, float]] = []
- for k in range(n):
- a = 2.0 * math.pi * k / n
- ex, ey = math.cos(a) * rx, math.sin(a) * ry
- # Light position runs around the ring; cosine falloff either side.
- glint = 0.5 + 0.5 * math.cos(a - t * _RING_GLINT_RAD_S)
- out.append((ex * ct - ey * st, ex * st + ey * ct, math.sin(a), glint**2))
+ span = max_h - min_h
+ out: list[float] = []
+ for g in gains:
+ u = 0.0 if g < 0.0 else 1.0 if g > 1.0 else g
+ out.append(min_h + span * (THINK_BASE_V + (THINK_PEAK_V - THINK_BASE_V) * u))
return out
-def core_highlight_offset(t: float, r: float) -> tuple[float, float]:
- """Specular highlight position on the sphere — drifts slowly sideways so
- the core reads as a turning ball instead of a flat disc."""
- return (math.sin(t * _HILITE_SWING_RAD_S) * 0.32 * r, -0.30 * r)
-
-
-def _spark_margin(ph: float) -> float:
- """Clearance a spark needs from the pill edge (its core + glow halo)."""
- return max(2.5, ph * _SPARK_R_FRAC * 2.2 + 1.0)
-
-
-def orbit_point(
- t: float, spec: OrbitSpec, pw: float, ph: float
-) -> tuple[float, float, float]:
- """One spark's ``(dx, dy, depth)`` relative to the pill centre.
-
- ``depth`` runs -1..+1 over the revolution: negative = far half (drawn
- behind the core, smaller/dimmer), positive = near half. The tilted
- ellipse is uniformly scaled down so the spark INCLUDING its glow stays
- inside every pill size the ease-in passes through.
- """
- a = 2.0 * math.pi * (t / spec.period_s) + spec.phase
- rx = spec.rx_frac * pw
- ry = spec.ry_frac * ph
- ct, st = math.cos(spec.tilt_rad), math.sin(spec.tilt_rad)
- # Extremes of the rotated ellipse, then one shared scale factor so the
- # orbit shape is preserved while honouring both axis budgets.
- max_x = math.hypot(rx * ct, ry * st)
- max_y = math.hypot(rx * st, ry * ct)
- # Reserve room for the reactor's float so orbit + drift can never poke
- # outside the pill (the orbits ride on the drifting core).
- m = _spark_margin(ph)
- bx = max(1.0, pw / 2.0 - m - pw * DRIFT_AX_FRAC)
- by = max(1.0, ph / 2.0 - m - ph * DRIFT_AY_FRAC)
- s = min(1.0, bx / max_x if max_x > 0 else 1.0, by / max_y if max_y > 0 else 1.0)
- ex = math.cos(a) * rx * s
- ey = math.sin(a) * ry * s
- return (ex * ct - ey * st, ex * st + ey * ct, math.sin(a))
-
-
-def orbit_trail(
- t: float,
- spec: OrbitSpec,
- pw: float,
- ph: float,
- n: int = TRAIL_N,
- span_s: float = TRAIL_SPAN_S,
-) -> list[tuple[float, float, float]]:
- """Comet-tail positions for one spark — head (current position) first."""
- dt = span_s / n
- return [orbit_point(t - k * dt, spec, pw, ph) for k in range(n + 1)]
-
-
@dataclass
class _RenderState:
# default_factory (not a plain default): the collapsed size must be read
@@ -932,11 +871,20 @@ class JarvisBarRenderer:
# in the centre so you can see the voice is live, controls flanking.
if mode in ("listen", "speak"):
self._draw_bars(d, t, cx, cy, pw, ph, span=bars_span_for(pw) * 0.5, n=5)
+ elif mode == "think":
+ # Thinking keeps its indicator while the controls are up, for
+ # the same reason the equalizer does: reaching for the close-X
+ # must not make the bar look like nothing is running.
+ self._draw_thinking(
+ d, t, cx, cy, pw, ph,
+ span=bars_span_for(pw) * 0.5,
+ n=THINK_HOVER_BARS,
+ )
if active_sess:
self._draw_close_x(d, x_left, cy, ph)
self._draw_mic(img, x_right, cy, ph, muted)
elif mode == "think":
- self._draw_thinking(img, t, cx, cy, pw, ph)
+ self._draw_thinking(d, t, cx, cy, pw, ph)
elif mode in ("listen", "speak"):
self._draw_bars(d, t, cx, cy, pw, ph)
elif muted:
@@ -1104,104 +1052,41 @@ class JarvisBarRenderer:
def _draw_thinking(
self,
- img: Image.Image,
+ d: ImageDraw.ImageDraw,
t: float,
cx: float,
cy: float,
pw: float,
ph: float,
+ span: float | None = None,
+ n: int | None = None,
) -> None:
- """Render the orbital core (THINKING) onto the frame.
-
- Drawn at 3x on an RGBA layer and LANCZOS-downscaled (same trick as
- the standby dots) — at 34 px pill height, direct drawing aliases
- badly. ImageDraw on RGBA REPLACES pixels rather than compositing, so
- everything is painted strictly back-to-front: trails, far sparks,
- core (glow → body → highlight), near sparks.
+ """Render the travelling sweep (THINKING) onto the frame.
+
+ Drawn exactly like the equalizer — same row, same span, same stroke
+ width, same rounded caps — so the bar keeps one vocabulary and the
+ hand-off between thinking and speaking is a change of MOTION, not a
+ change of object. Only the heights and the brightness come from the
+ sweep instead of a level.
+
+ No supersampled layer here (unlike the standby dots or the drop glyph):
+ these are axis-aligned rounded rectangles, which ImageDraw renders
+ cleanly at this size — and thinking is the state that runs for seconds
+ at a stretch, so it has to be among the CHEAPEST frames the bar draws
+ rather than the dearest.
"""
- ss = 3
- layer = Image.new("RGBA", (img.width * ss, img.height * ss), (0, 0, 0, 0))
- ld = ImageDraw.Draw(layer)
- accent = self._accent
- bright = _lerp_rgb(accent, (255, 255, 255), 0.40)
- spark_r = max(1.1, ph * _SPARK_R_FRAC)
-
- # The whole reactor floats: core, ring, highlight AND the spark
- # orbits all ride on this drifting centre.
- ddx, ddy = core_drift(t, pw, ph)
- ccx, ccy = cx + ddx, cy + ddy
-
- def dot(dx: float, dy: float, r: float, color: tuple[int, int, int], alpha: int) -> None:
- x, y = (ccx + dx) * ss, (ccy + dy) * ss
- rr = r * ss
- ld.ellipse([x - rr, y - rr, x + rr, y + rr], fill=(*color, alpha))
-
- # 1. Comet trails — fade and thin toward the past.
- trails = [orbit_trail(t, spec, pw, ph) for spec in ORBITS]
- for trail in trails:
- for k in range(len(trail) - 1):
- u = k / (len(trail) - 1) # 0 at the head → 1 at the tail tip
- alpha = int(150 * (1.0 - u) ** 1.3)
- if alpha <= 4:
- continue
- x0, y0, _ = trail[k]
- x1, y1, _ = trail[k + 1]
- w = max(1, round(spark_r * ss * (1.0 - 0.65 * u)))
- ld.line(
- [((ccx + x0) * ss, (ccy + y0) * ss), ((ccx + x1) * ss, (ccy + y1) * ss)],
- fill=(*accent, alpha),
- width=w,
- )
-
- def spark(dx: float, dy: float, depth: float) -> None:
- r = spark_r * (1.0 + _SPARK_DEPTH_SIZE * depth)
- dot(dx, dy, r * 1.6, accent, max(0, int(45 + 25 * depth)))
- dot(dx, dy, r, bright, min(255, int(195 + 60 * depth)))
-
- heads = [trail[0] for trail in trails]
-
- # 2. Far-half sparks pass BEHIND the core.
- for dx, dy, depth in heads:
- if depth < 0:
- spark(dx, dy, depth)
-
- # 3. The breathing core "reactor": pulsing halo → back ring arc →
- # sphere body → drifting specular highlight → front ring arc.
- # The saturn ring with its travelling glint is what keeps the
- # centre alive — a bare static dot read as dead.
- r = core_radius(t, ph)
- breath = math.sin(t * _CORE_BREATH_RAD_S) # in step with the radius
- ring = core_ring_points(t, r)
-
- def ring_arc(front: bool) -> None:
- w = max(1, round(r * 0.22 * ss))
- for k in range(len(ring)):
- x0, y0, d0, g0 = ring[k]
- x1, y1, d1, g1 = ring[(k + 1) % len(ring)]
- mid_depth = (d0 + d1) / 2.0
- if (mid_depth >= 0) != front:
- continue
- g = (g0 + g1) / 2.0
- alpha = int(80 + 160 * g)
- color = _lerp_rgb(accent, bright, g)
- ld.line(
- [((ccx + x0) * ss, (ccy + y0) * ss), ((ccx + x1) * ss, (ccy + y1) * ss)],
- fill=(*color, min(255, alpha)),
- width=w,
- )
-
- dot(0, 0, r * 2.3, accent, int(34 + 16 * breath)) # halo breathes visibly
- dot(0, 0, r * 1.5, accent, 70) # kept soft so the ring doesn't drown
- ring_arc(front=False) # the half passing behind the sphere
- dot(0, 0, r, accent, 255)
- hx, hy = core_highlight_offset(t, r)
- dot(hx, hy, r * 0.40, _lerp_rgb(accent, (255, 255, 255), 0.65), 235)
- ring_arc(front=True) # the half passing in front
-
- # 4. Near-half sparks pass IN FRONT of the core.
- for dx, dy, depth in heads:
- if depth >= 0:
- spark(dx, dy, depth)
-
- small = layer.resize(img.size, Image.Resampling.LANCZOS)
- img.paste(small, (0, 0), small)
+ n = n or N_BARS
+ span = bars_span_for(pw) if span is None else span
+ half_w = bar_half_w_for(pw)
+ gains = sweep_gains(t, n)
+ hs = sweep_bar_heights(gains, max_h=bar_max_for(ph), min_h=bar_min_for(ph))
+ for x, h, g in zip(evenly_spaced(cx, span, n), hs, gains, strict=True):
+ # This frame is RGB (the color key needs it), so there is no alpha
+ # to fade with: mixing toward the pill's own background is what an
+ # opacity would look like over it anyway, and it costs one lerp.
+ color = _lerp_rgb(PILL_BG, self._accent, THINK_DIM + (1.0 - THINK_DIM) * g)
+ d.rounded_rectangle(
+ [x - half_w, cy - h / 2, x + half_w, cy + h / 2],
+ radius=half_w,
+ fill=color,
+ )
diff --git a/jarvis/ui/web/frontend/src/components/overlay/voiceBars.ts b/jarvis/ui/web/frontend/src/components/overlay/voiceBars.ts
index a58816d2ca..e399b2b116 100644
--- a/jarvis/ui/web/frontend/src/components/overlay/voiceBars.ts
+++ b/jarvis/ui/web/frontend/src/components/overlay/voiceBars.ts
@@ -109,7 +109,12 @@ export function smoothLevel(
return to <= 0 && next < 0.01 ? 0 : clamp01(next);
}
-/** Gaussian width of the travelling activity highlight, in row fractions. */
+/** Gaussian width of the travelling activity highlight, in row fractions.
+ *
+ * The desktop bar draws the SAME sweep for its thinking state and copies this
+ * number (``renderer.THINK_SWEEP_WIDTH``, pinned by
+ * ``tests/unit/ui/jarvisbar/test_renderer.py``). Changing it here without
+ * changing it there splits the two bars apart. */
export const SWEEP_WIDTH = 0.16;
/**
@@ -141,7 +146,10 @@ export function sweepGain(
/** Seconds one sweep needs to cross the row, per phase. Each phase gets its
* own tempo so the three unmeasured states stay distinguishable at a glance:
- * a brisk sweep while work is in flight, a calm one while the reply plays. */
+ * a brisk sweep while work is in flight, a calm one while the reply plays.
+ *
+ * ``working`` is shared with the desktop bar's thinking look
+ * (``renderer.THINK_SWEEP_PERIOD_S``) — see SWEEP_WIDTH above. */
export const SWEEP_PERIOD_S: Record<string, number> = {
connecting: 1.6,
working: 1.05,
diff --git a/scripts/jarvisbar_thinking_preview.py b/scripts/jarvisbar_thinking_preview.py
index 9a84240418..b5bdcf052c 100644
--- a/scripts/jarvisbar_thinking_preview.py
+++ b/scripts/jarvisbar_thinking_preview.py
@@ -1,4 +1,4 @@
-"""Headless preview of the jarvis-bar THINKING animation (orbital core).
+"""Headless preview of the jarvis-bar THINKING animation (travelling sweep).
Renders frames straight from the pure renderer (no Tk, no app) and writes:
- ``screenshots/jarvisbar-thinking-sheet.png`` — 8 frames, 4x upscaled,
@@ -39,6 +39,10 @@ def _frame(rnd: R.JarvisBarRenderer, t: float) -> Image.Image:
def main() -> None:
out = screenshots_dir()
+ # screenshots_dir() deliberately does not create the folder (see its
+ # docstring), and a fresh clone has none — without this the script died on
+ # PIL's save() with a bare FileNotFoundError.
+ out.mkdir(parents=True, exist_ok=True)
rnd = R.JarvisBarRenderer()
for _ in range(80): # settle the pill ease at ACTIVE size
rnd.render(0.0, "think", 0.0)
diff --git a/tests/unit/ui/jarvisbar/test_frame_pacing.py b/tests/unit/ui/jarvisbar/test_frame_pacing.py
index 3ae602005f..549261a5ed 100644
--- a/tests/unit/ui/jarvisbar/test_frame_pacing.py
+++ b/tests/unit/ui/jarvisbar/test_frame_pacing.py
@@ -215,7 +215,7 @@ def test_hover_flip_while_idle_forces_an_immediate_render():
def test_active_mode_never_skips_render():
"""listen/speak/think are always animating (level-driven bars or the
- orbital core) — the settle counter must never suppress their render()."""
+ travelling sweep) — the settle counter must never suppress their render()."""
renderer_obj = _CountingRenderer()
bar, _root, _canvas = _bare_bar(renderer_obj, mode="think")
diff --git a/tests/unit/ui/jarvisbar/test_renderer.py b/tests/unit/ui/jarvisbar/test_renderer.py
index 8f1b9cdac9..15bcdc10cf 100644
--- a/tests/unit/ui/jarvisbar/test_renderer.py
+++ b/tests/unit/ui/jarvisbar/test_renderer.py
@@ -49,143 +49,106 @@ def test_display_level_snaps_to_exact_zero_after_silence():
assert k <= 8 # ≤ ~150 ms at 60 fps
-# --- thinking: "orbital core" (replaces the old generic sine wave) -----------
-
-
-def test_sine_wave_is_gone():
- # The travelling sine was explicitly rejected as a generic-AI visual.
- # Guard against a future session resurrecting it.
- assert not hasattr(R, "wave_points")
- assert not hasattr(R, "wave_width_for")
-
-
-def test_orbit_points_bounded_inside_pill():
- # Sparks (incl. their glow margin) must stay inside every pill size the
- # ease-in passes through — COLLAPSED (tiny) up to ACTIVE.
- sizes = [
- (R.ACTIVE_W, R.ACTIVE_H),
- (R.OPEN_W, R.OPEN_H),
- (R.COLLAPSED_W, R.COLLAPSED_H),
- ]
- for pw, ph in sizes:
- for spec in R.ORBITS:
- for k in range(80):
- t = k * 7.0 / 80.0
- dx, dy, _depth = R.orbit_point(t, spec, pw, ph)
- assert abs(dx) <= pw / 2.0, (pw, ph, t)
- assert abs(dy) <= ph / 2.0, (pw, ph, t)
-
-
-def test_orbit_trail_head_matches_current_position():
- spec = R.ORBITS[0]
- trail = R.orbit_trail(1.3, spec, R.ACTIVE_W, R.ACTIVE_H)
- assert len(trail) == R.TRAIL_N + 1
- head = R.orbit_point(1.3, spec, R.ACTIVE_W, R.ACTIVE_H)
- assert trail[0] == head
-
-
-def test_orbit_sparks_move_over_time():
- spec = R.ORBITS[0]
- a = R.orbit_point(0.0, spec, R.ACTIVE_W, R.ACTIVE_H)
- b = R.orbit_point(0.25, spec, R.ACTIVE_W, R.ACTIVE_H)
- assert (a[0], a[1]) != (b[0], b[1])
-
-
-def test_orbits_counter_rotate_and_never_sync():
- # Opposite spin directions → gyroscope feel; incommensurate periods → the
- # composite figure never visibly loops.
- assert R.ORBITS[0].period_s * R.ORBITS[1].period_s < 0
- ratio = abs(R.ORBITS[0].period_s / R.ORBITS[1].period_s)
- frac = ratio - int(ratio)
- assert 0.05 < frac < 0.95
-
-
-def test_core_radius_breathes_within_bounds():
- ph = float(R.ACTIVE_H)
- radii = [R.core_radius(k * 0.05, ph) for k in range(200)]
- assert max(radii) < ph / 2.0
- assert min(radii) > 0.0
- assert max(radii) > min(radii) # it actually breathes
-
-
-def test_core_drifts_instead_of_being_pinned():
- # The user called a position-fixed core "starr" twice — the whole reactor
- # must float. The drift has to be clearly visible within a short thinking
- # phase (~3 s). Visibility is RELATIVE to the pill (the drift amplitude is
- # a fraction of the pill size), so the floor scales with the pill width
- # instead of pinning the absolute pixels of one historical geometry.
- pw, ph = float(R.ACTIVE_W), float(R.ACTIVE_H)
- points = [R.core_drift(t, pw, ph) for t in (0.0, 1.0, 2.0, 3.0)]
- xs = [p[0] for p in points]
- ys = [p[1] for p in points]
- assert max(xs) - min(xs) >= 0.02 * pw # visibly moves horizontally in 3 s
- assert max(ys) - min(ys) >= 0.8 # and vertically
-
-
-def test_core_drift_is_bounded_and_organic():
- pw, ph = float(R.ACTIVE_W), float(R.ACTIVE_H)
- for k in range(400):
- dx, dy = R.core_drift(k * 0.1, pw, ph)
- assert abs(dx) <= pw * R.DRIFT_AX_FRAC + 1e-6
- assert abs(dy) <= ph * R.DRIFT_AY_FRAC + 1e-6
- # Non-synchronised frequencies → the float never settles into a loop.
- ratio = R._DRIFT_WX / R._DRIFT_WY
- frac = ratio - int(ratio)
- assert 0.05 < frac < 0.95
-
-
-def test_sparks_plus_drift_stay_inside_the_pill():
- # Orbits are clamped with the drift budget reserved — the floating system
- # as a whole must never poke outside any pill size the ease passes.
- sizes = [(R.ACTIVE_W, R.ACTIVE_H), (R.OPEN_W, R.OPEN_H), (R.COLLAPSED_W, R.COLLAPSED_H)]
- for pw, ph in sizes:
- for k in range(120):
- t = k * 7.0 / 120.0
- ddx, ddy = R.core_drift(t, pw, ph)
- for spec in R.ORBITS:
- dx, dy, _ = R.orbit_point(t, spec, pw, ph)
- assert abs(ddx + dx) <= pw / 2.0, (pw, ph, t)
- assert abs(ddy + dy) <= ph / 2.0, (pw, ph, t)
-
-
-def test_core_ring_stays_near_the_core_and_inside_the_pill():
- # The saturn ring hugs the core — it must never reach the spark orbits
- # (which start ~0.2*ph further out) nor the pill edge.
- ph = float(R.ACTIVE_H)
- r = R.core_radius(0.0, ph)
- for t in (0.0, 0.7, 1.9, 4.2):
- for dx, dy, _depth, glint in R.core_ring_points(t, r):
- assert abs(dx) <= r * 2.4
- assert abs(dy) <= r * 1.2
- assert 0.0 <= glint <= 1.0
-
-
-def test_core_ring_glint_travels_around_the_ring():
- # The bright spot must move along the ring over time — a static ring
- # would just be a bigger static dot, which is what we're replacing.
- ph = float(R.ACTIVE_H)
- r = R.core_radius(0.0, ph)
-
- def brightest_index(t: float) -> int:
- pts = R.core_ring_points(t, r)
- return max(range(len(pts)), key=lambda i: pts[i][3])
-
- indices = {brightest_index(t) for t in (0.0, 0.4, 0.8, 1.2)}
- assert len(indices) >= 3
-
-
-def test_core_highlight_swings_across_the_sphere():
- # The specular highlight drifts horizontally (a slowly turning sphere)
- # and always stays well inside the core body.
- ph = float(R.ACTIVE_H)
- r = R.core_radius(0.0, ph)
- xs = []
- for t in (0.0, 1.0, 2.0, 3.0, 4.0):
- hx, hy = R.core_highlight_offset(t, r)
- xs.append(hx)
- assert abs(hx) <= r * 0.5
- assert abs(hy) <= r * 0.5
- assert max(xs) > min(xs) # it actually moves
+# --- thinking: the travelling sweep ------------------------------------------
+# The look the mission deck's header bar uses for "working", brought onto the
+# desktop bar (maintainer, 2026-08-20). It replaced the "orbital core", which
+# replaced a travelling sine wave before that — so the guards below pin what
+# each of those was rejected FOR, not just the current shape.
+
+
+def test_rejected_thinking_looks_stay_gone():
+ # The travelling sine was rejected as a generic-AI visual; the orbital
+ # core was rejected on looks and on cost. Guard against a future session
+ # resurrecting either by name.
+ for gone in (
+ "wave_points",
+ "wave_width_for",
+ "orbit_point",
+ "orbit_trail",
+ "core_radius",
+ "core_drift",
+ "core_ring_points",
+ "ORBITS",
+ ):
+ assert not hasattr(R, gone), f"{gone} is back"
+
+
+def test_sweep_peak_sits_where_the_phase_points():
+ # phase 0 → the highlight is on the first bar, phase 1/2 → the middle.
+ gains = [R.sweep_gain(i, 9, 0.0) for i in range(9)]
+ assert gains.index(max(gains)) == 0
+ gains = [R.sweep_gain(i, 9, 0.5) for i in range(9)]
+ assert gains.index(max(gains)) == 4
+
+
+def test_sweep_gain_is_bounded_and_falls_off():
+ for count in (5, 7, 10, 14):
+ for phase in (0.0, 0.2, 0.5, 0.83, 0.999):
+ gains = [R.sweep_gain(i, count, phase) for i in range(count)]
+ assert all(0.0 <= g <= 1.0 for g in gains)
+ assert max(gains) > 0.5, "the highlight vanished between bars"
+ assert min(gains) < 0.3, "the whole row lit up — no highlight to see"
+
+
+def test_sweep_wraps_around_the_row():
+ # The highlight must leave on the right and re-enter on the left without a
+ # jump: just before the wrap the LAST bar is brightest, just after it the
+ # first — and the two rows are near-identical mirror images.
+ before = [R.sweep_gain(i, 10, 0.995) for i in range(10)]
+ after = [R.sweep_gain(i, 10, 0.005) for i in range(10)]
+ assert before[-1] > 0.9 and after[0] > 0.9
+ assert max(abs(a - b) for a, b in zip(before, reversed(after), strict=True)) < 0.05
+
+
+def test_sweep_travels_over_time():
+ peak_at = []
+ for k in range(6):
+ gains = R.sweep_gains(k * R.THINK_SWEEP_PERIOD_S / 6.0, 10)
+ peak_at.append(gains.index(max(gains)))
+ assert len(set(peak_at)) >= 4, f"the sweep barely moved: {peak_at}"
+
+
+def test_sweep_period_completes_one_pass():
+ a = R.sweep_gains(1.0, 10)
+ b = R.sweep_gains(1.0 + R.THINK_SWEEP_PERIOD_S, 10)
+ assert max(abs(x - y) for x, y in zip(a, b, strict=True)) < 1e-9
+
+
+def test_sweep_phase_wraps_to_unit_range():
+ for t in (0.0, 0.4, 1.05, 7.3, 123.456):
+ assert 0.0 <= R.sweep_phase(t) < 1.0
+ # A degenerate period must not divide by zero — it just stops moving.
+ assert R.sweep_phase(3.0, 0.0) == 0.0
+
+
+def test_sweep_bar_heights_stay_inside_the_pill():
+ for phase in (0.0, 0.25, 0.5, 0.75):
+ gains = [R.sweep_gain(i, 10, phase) for i in range(10)]
+ hs = R.sweep_bar_heights(gains, max_h=40.0, min_h=4.0)
+ assert all(4.0 <= h <= 40.0 + 1e-9 for h in hs)
+
+
+def test_sweep_bars_never_collapse_to_the_resting_height():
+ # A row that drops to min_h between passes reads as a dead bar, not a
+ # working one — THINK_BASE_V is what keeps the unlit strokes present.
+ gains = [0.0] * 10
+ hs = R.sweep_bar_heights(gains, max_h=40.0, min_h=4.0)
+ assert all(h > 4.0 + 1.0 for h in hs)
+
+
+def test_sweep_lifts_the_bar_under_the_highlight():
+ gains = [R.sweep_gain(i, 10, 0.5) for i in range(10)]
+ hs = R.sweep_bar_heights(gains, max_h=40.0, min_h=4.0)
+ assert max(hs) > 2.0 * min(hs)
+
+
+def test_sweep_matches_the_web_surfaces_numbers():
+ """The deck's header bar draws the SAME motion from
+ ``frontend/src/components/overlay/voiceBars.ts``. If either side's
+ constants move, the two bars stop reading as one product — so they are
+ pinned here, next to a pointer at the file to change with them."""
+ assert R.THINK_SWEEP_WIDTH == 0.16 # SWEEP_WIDTH
+ assert R.THINK_SWEEP_PERIOD_S == 1.05 # SWEEP_PERIOD_S.working
def test_render_think_mode_animates_over_time():
@@ -252,7 +215,7 @@ def test_visual_mode_shows_bars_while_sound_is_recent():
def test_visual_mode_indicator_only_while_thinking():
- # The orbital core (the "indicator") appears ONLY while actively
+ # The sweep (the "indicator") appears ONLY while actively
# thinking/processing — coarse "think" is the THINKING state AND the
# silent TTS-synthesis lead-in (the bridge shows "think" for SPEAKING
# too). That is the only place an animated indicator belongs.
diff --git a/ui/orb/bus_bridge.py b/ui/orb/bus_bridge.py
index c6059d2eb9..5b906f96f9 100644
--- a/ui/orb/bus_bridge.py
+++ b/ui/orb/bus_bridge.py
@@ -868,7 +868,7 @@ class OrbBusBridge:
# SPEAKING before the first audio sample actually leaves the
# speaker (0.5–2 s lead time). From the user's perspective that
# silent lead time is still "processing", so the overlay stays on
- # the THINKING wave and only switches to the SPEAKING bars once
+ # the THINKING look and only switches to the SPEAKING bars once
# there is real sound — driven by the AudioOutFirst event (see
# _on_audio_out_first). The mouth + the "nod" hang off the
# AudioOutFirst event for the same reason. The bubble already shows