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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(orb): drop the sphere's speech bubble and put the state inside the orb
rubenluetke10-beepaf0bb3fd098e
diff --git a/jarvis/ui/web/frontend/src/components/agentic/VoiceOrb.tsx b/jarvis/ui/web/frontend/src/components/agentic/VoiceOrb.tsxindex 64a8119370..4cdb63f727 100644--- a/jarvis/ui/web/frontend/src/components/agentic/VoiceOrb.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/VoiceOrb.tsx@@ -32,6 +32,13 @@ interface Motion {energy: number;/** Strength of the assistant-speech envelope. */voiceImpact: number;+ /**+ * How far the cloud field may drag the COLOUR ramp out of its vertical+ * order. At rest it only softens the horizon; while thinking it is what+ * makes ivory, gold and amber visibly churn through each other instead of+ * sitting in bands. Kept in step with the desktop twin (`ui/orb/voice_orb.py`).+ */+ colorChurn: number;}const MOTIONS: Record<VoiceState, Motion> = {@@ -43,6 +50,7 @@ const MOTIONS: Record<VoiceState, Motion> = {turbulence: 0.8,energy: 0.86,voiceImpact: 0,+ colorChurn: 0.28,},listening: {flowX: 0.11,@@ -52,24 +60,29 @@ const MOTIONS: Record<VoiceState, Motion> = {turbulence: 1.02,energy: 0.98,voiceImpact: 0,+ colorChurn: 0.34,},thinking: {- flowX: 0.42,- flowY: -0.19,- breathAmp: 0.009,- breathHz: 0.32,- turbulence: 1.28,- energy: 1.02,+ // The one state with nothing to hear, so it has to be the most visibly+ // busy: the field races and the palette churns through itself.+ flowX: 0.95,+ flowY: -0.44,+ breathAmp: 0.01,+ breathHz: 0.34,+ turbulence: 1.85,+ energy: 1.08,voiceImpact: 0,+ colorChurn: 1.45,},speaking: {flowX: 0.34,flowY: 0.085,- breathAmp: 0.016,+ breathAmp: 0.014,breathHz: 0.82,- turbulence: 1.02,+ turbulence: 1.06,energy: 1,- voiceImpact: 0.045,+ voiceImpact: 0.11,+ colorChurn: 0.45,},paused: {// Stiller than idle: the session is held, not gone — the weather keeps@@ -81,6 +94,7 @@ const MOTIONS: Record<VoiceState, Motion> = {turbulence: 0.75,energy: 0.78,voiceImpact: 0,+ colorChurn: 0.28,},error: {flowX: 0.012,@@ -90,9 +104,21 @@ const MOTIONS: Record<VoiceState, Motion> = {turbulence: 0.7,energy: 0.72,voiceImpact: 0,+ colorChurn: 0.28,},};+/**+ * Resting size as a fraction of the canvas. Below 1 ON PURPOSE: the swell has+ * to have somewhere to go. At the old value the sphere already filled its box+ * at rest, every beat hit the `Math.min(1, …)` ceiling, and the result was a+ * pulse nobody could see.+ */+const BASE_SCALE = 0.86;++/** How much of the remaining headroom a full-volume moment claims. */+const LEVEL_SWELL = 0.12;+type Rgb = readonly [number, number, number];const IVORY: Rgb = [255, 250, 235];@@ -182,6 +208,10 @@ function paintWeather(impact: number,): void {const data = image.data;+ // Slow drift keeps the colour mixing in motion, so a thinking orb never+ // settles into a still picture.+ const churn = motion.colorChurn;+ const drift = Math.sin(phaseX * 2.4 + phaseY * 1.7) * churn * 0.2;for (let y = 0; y < TEXTURE_SIZE; y += 1) {const ny = (y / (TEXTURE_SIZE - 1)) * 2 - 1;@@ -205,8 +235,10 @@ function paintWeather();const weather = cloudField * 0.76 + detail * 0.24;- // Warping the vertical color position removes the synthetic horizon band.- const vertical = clamp((ny + 1) * 0.5 + (weather - 0.5) * 0.28);+ // Where a pixel sits on the ivory→amber ramp. Warping it by the cloud+ // field removes the synthetic horizon band at rest; opening the warp up+ // makes the palette visibly MIX rather than sit in stripes.+ const vertical = clamp((ny + 1) * 0.5 + (weather - 0.5) * churn + drift);let start: Rgb;let end: Rgb;let paletteMix: number;@@ -364,10 +396,10 @@ export function VoiceOrb({const inputTarget = activeState === "listening" ? readVoiceInputLevel(now) : 0;const inputEase = 1 - Math.exp(-dt * (inputTarget > liveInput ? 24 : 9));liveInput = mix(liveInput, inputTarget, inputEase);- const visualImpact = liveImpact + liveInput * 0.055;+ const visualImpact = liveImpact + liveInput * LEVEL_SWELL;const breath =- 0.965 -+ BASE_SCALE -live.breathAmp * 0.65 +live.breathAmp * 0.52 * Math.sin(breathPhase) +live.breathAmp * 0.13 * Math.sin(breathPhase * 2.05 + 1.4) +diff --git a/tests/unit/ui/test_orb_style_surface_parity.py b/tests/unit/ui/test_orb_style_surface_parity.pyindex f82024f2f1..3fa6869800 100644--- a/tests/unit/ui/test_orb_style_surface_parity.py+++ b/tests/unit/ui/test_orb_style_surface_parity.py@@ -16,6 +16,65 @@ import pytestfrom ui.orb import overlay+# --- no bubble at all on the sphere -----------------------------------------+++def test_the_sphere_speaks_through_no_bubble_at_all() -> None:+ """Maintainer, 2026-08-06: "that speech bubble up there can go".++ Everything it used to say now lives in how the orb moves — it swells on the+ voice and churns its colours while thinking. The mascot keeps its bubble:+ a character with a face says things in one.+ """+ assert overlay.OrbOverlay(style="voice_orb")._bubble_wanted() is False+ assert overlay.OrbOverlay(style="mascot")._bubble_wanted() is True+++def test_neither_bubble_variant_reaches_the_sphere() -> None:+ """Both entry points must be closed — the "..." placeholder came through+ the transcript one while the comment one was already quiet."""+ orb = overlay.OrbOverlay(style="voice_orb")+ shown: list[str] = []+ orb._enqueue_ui = lambda fn: shown.append("queued") # type: ignore[method-assign]++ orb.show_comment("a reply", 3000)+ orb.show_listening_transcript("what I said", 30000)+ orb.show_listening_transcript("", 30000)++ assert shown == []+++def test_the_mascot_still_gets_both_bubble_variants() -> None:+ orb = overlay.OrbOverlay(style="mascot")+ shown: list[str] = []+ orb._comment_bubble = object() # only presence is checked before queueing+ orb._enqueue_ui = lambda fn: shown.append("queued") # type: ignore[method-assign]++ orb.show_comment("a reply", 3000)+ orb.show_listening_transcript("what I said", 30000)++ assert len(shown) == 2+++# --- window size ------------------------------------------------------------+++def test_the_sphere_is_half_again_the_mascots_size() -> None:+ assert overlay.window_size_for_style("voice_orb") == (+ overlay.VOICE_ORB_WIN_W,+ overlay.VOICE_ORB_WIN_H,+ )+ assert overlay.window_size_for_style("mascot") == (overlay.WIN_W, overlay.WIN_H)+ assert overlay.VOICE_ORB_WIN_W == round(overlay.WIN_W * 1.5)+++def test_a_new_orb_adopts_its_styles_window_size() -> None:+ sphere = overlay.OrbOverlay(style="voice_orb")+ ghost = overlay.OrbOverlay(style="mascot")+ assert (sphere._win_w, sphere._win_h) == (overlay.VOICE_ORB_WIN_W, overlay.VOICE_ORB_WIN_H)+ assert (ghost._win_w, ghost._win_h) == (overlay.WIN_W, overlay.WIN_H)++# --- the bubble -------------------------------------------------------------diff --git a/tests/unit/ui/test_voice_orb_renderer.py b/tests/unit/ui/test_voice_orb_renderer.pyindex b2b70b4962..355592fdd8 100644--- a/tests/unit/ui/test_voice_orb_renderer.py+++ b/tests/unit/ui/test_voice_orb_renderer.py@@ -75,8 +75,11 @@ def test_modes_look_different() -> None:assert np.abs(left - right).mean() > 1.0-def test_only_listening_modes_react_to_the_live_level() -> None:+def test_only_modes_with_a_live_feed_react_to_the_level() -> None:assert VoiceOrbRenderer._input_level("listen", 0.7) == pytest.approx(0.7)+ # Speaking rides the REAL TTS loudness the bridge forwards, so the sphere+ # swells on Jarvis's actual voice instead of a synthetic cadence.+ assert VoiceOrbRenderer._input_level("speak", 0.7) == pytest.approx(0.7)# Recording keeps a floor so a quiet moment never reads as a dead orb.assert VoiceOrbRenderer._input_level("dictate", 0.0) > 0.0# Transcribing has no live feed; a stale sample must not animate the orb.@@ -85,6 +88,56 @@ def test_only_listening_modes_react_to_the_live_level() -> None:assert VoiceOrbRenderer._input_level("listen", None) == 0.0+def _lit_radius(frame: np.ndarray) -> float:+ """Half the width of the painted sphere in a rendered frame."""+ lit = np.any(frame != np.asarray(KEY, dtype=np.int16), axis=-1)+ columns = np.nonzero(lit.any(axis=0))[0]+ return 0.0 if columns.size == 0 else (columns.max() - columns.min() + 1) / 2.0+++def test_a_loud_voice_visibly_swells_the_sphere() -> None:+ """The whole point of dropping the speech bubble: the orb IS the indicator.++ A swell that only exists in the arithmetic — because the resting sphere+ already fills its window and the growth clips away — is the bug this pins.+ """+ quiet = VoiceOrbRenderer(size=108, color_key=KEY)+ loud = VoiceOrbRenderer(size=108, color_key=KEY)+ for step in range(40):+ t = step / 30.0+ quiet_frame = _frame(quiet, t, "speak", 0.0)+ loud_frame = _frame(loud, t, "speak", 1.0)+ assert _lit_radius(loud_frame) - _lit_radius(quiet_frame) >= 4.0+++def test_the_resting_sphere_leaves_room_to_grow() -> None:+ idle = VoiceOrbRenderer(size=108, color_key=KEY)+ for step in range(30):+ frame = _frame(idle, step / 30.0, "idle", None)+ assert _lit_radius(frame) < 54.0 # strictly inside the window+++def test_thinking_churns_the_palette_harder_than_resting() -> None:+ """Thinking has nothing to hear, so it says so with colour, not with text."""+ assert MOTIONS["think"].color_churn > MOTIONS["idle"].color_churn * 2++ def banding(mode: str) -> float:+ """How tightly colour still tracks HEIGHT (1 = perfect ramp, 0 = mixed).++ This is the honest measure of "the colours mix": a resting orb is a+ vertical ivory→amber ramp, so its colour is almost a function of y.+ Churning breaks that link — the cloud decides the colour, not the row.+ """+ renderer = VoiceOrbRenderer(size=108, color_key=KEY)+ for step in range(45):+ frame = _frame(renderer, step / 30.0, mode, None)+ lit = np.any(frame != np.asarray(KEY, dtype=np.int16), axis=-1)+ rows = np.repeat(np.arange(frame.shape[0])[:, None], frame.shape[1], axis=1)+ return abs(float(np.corrcoef(rows[lit], frame[..., 2][lit])[0, 1]))++ assert banding("think") < banding("idle")++def test_field_is_recomputed_at_a_capped_rate() -> None:"""The overlay paints at ~60 fps; the procedural field must not follow."""renderer = VoiceOrbRenderer(size=108, color_key=KEY)diff --git a/ui/orb/overlay.py b/ui/orb/overlay.pyindex 734a491c54..07a025001c 100644--- a/ui/orb/overlay.py+++ b/ui/orb/overlay.py@@ -118,6 +118,23 @@ class _DragState:# 108x108 — roughly 1/3 smaller than the old 160-px sizeWIN_W = 108WIN_H = 108++#: The voice orb's window, 50 % larger than the mascot's (maintainer, 2026-08-06).+#: The sphere now carries the whole conversation state on its own — no speech+#: bubble, no text — so it has to be big enough to read a swell and a colour+#: churn at a glance. The mascot keeps 108: its artwork, taskbar anchor and+#: animations are all drawn for that size.+VOICE_ORB_WIN_W = 162+VOICE_ORB_WIN_H = 162+++def window_size_for_style(style: str) -> tuple[int, int]:+ """Window edge length for one orb style."""+ if style == "voice_orb":+ return VOICE_ORB_WIN_W, VOICE_ORB_WIN_H+ return WIN_W, WIN_H++MARGIN_RIGHT = 24MARGIN_TOP = 28@@ -225,6 +242,7 @@ def bubble_theme_for_style(style: str) -> BubbleTheme:"""The bubble look one orb style wears."""return ORB_BUBBLE_THEME if style == "voice_orb" else MASCOT_BUBBLE_THEME+# Magenta color key — Tkinter renders this color pixel-perfect transparentCOLOR_KEY_HEX = "#FF00FF"COLOR_KEY_RGB = np.array([255, 0, 255], dtype=np.uint8)@@ -1158,6 +1176,10 @@ class OrbCommentBubble:self._screen_w = screen_wself.hide()+ def set_orb_width(self, orb_w: int) -> None:+ """Re-centre over an orb that changed size (a live style swap)."""+ self._orb_w = orb_w+def _build(self) -> None:top = tk.Toplevel(self._parent)top.overrideredirect(True)@@ -1673,6 +1695,13 @@ class OrbControlRow:if self._visible:self._place()+ def set_orb_size(self, orb_w: int, orb_h: int) -> None:+ """Re-centre under an orb that changed size (a live style swap)."""+ self._orb_w = orb_w+ self._orb_h = orb_h+ if self._visible:+ self._place()+def _place(self) -> None:if self._top is None:return@@ -1955,6 +1984,9 @@ class OrbOverlay:requested_style = env_style or (style or DEFAULT_ORB_STYLE).lower()self._style = _coerce_style(requested_style)self._mascot_path_hint = str(mascot_path) if mascot_path else None+ # Window size belongs to the style, not to the module: the voice orb is+ # half again as large as the mascot (see VOICE_ORB_WIN_W).+ self._win_w, self._win_h = window_size_for_style(self._style)# --- Public API ----------------------------------------------------@@ -2061,7 +2093,7 @@ class OrbOverlay:placement = resolve_placement(persisted,screens,- mascot_size_px=WIN_W,+ mascot_size_px=self._win_w,require_primary=not allow_secondary,)if not placement.recovered:@@ -2090,9 +2122,13 @@ class OrbOverlay:placement.abs_x,placement.abs_y,)- self._root.geometry(f"{WIN_W}x{WIN_H}+{primary_anchor.x}+{primary_anchor.y}")+ self._root.geometry(+ f"{self._win_w}x{self._win_h}+{primary_anchor.x}+{primary_anchor.y}"+ )else:- self._root.geometry(f"{WIN_W}x{WIN_H}+{placement.abs_x}+{placement.abs_y}")+ self._root.geometry(+ f"{self._win_w}x{self._win_h}+{placement.abs_x}+{placement.abs_y}"+ )else:# Monitor gone, no screens, or pin on non-primary monitor# while require_primary is set — fall back to default and@@ -2104,17 +2140,17 @@ class OrbOverlay:anchor = self._resolve_anchor(screen_w, screen_h)self._mascot_x = anchor.xself._mascot_y = anchor.y- self._root.geometry(f"{WIN_W}x{WIN_H}+{anchor.x}+{anchor.y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{anchor.x}+{anchor.y}")else:anchor = self._resolve_anchor(screen_w, screen_h)self._mascot_x = anchor.xself._mascot_y = anchor.y- self._root.geometry(f"{WIN_W}x{WIN_H}+{anchor.x}+{anchor.y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{anchor.x}+{anchor.y}")self._canvas = tk.Canvas(self._root,- width=WIN_W,- height=WIN_H,+ width=self._win_w,+ height=self._win_h,bg="systemTransparent" if self._mac_transparent else COLOR_KEY_HEX,highlightthickness=0,borderwidth=0,@@ -2169,7 +2205,7 @@ class OrbOverlay:parent=self._root,orb_x=anchor.x,orb_y=anchor.y,- orb_w=WIN_W,+ orb_w=self._win_w,screen_w=screen_w,theme=bubble_theme_for_style(self._style),)@@ -2219,7 +2255,7 @@ class OrbOverlay:return compute_mascot_position(screen_w,screen_h,- mascot_size=WIN_W,+ mascot_size=self._win_w,taskbar=taskbar,tray_rect=tray_rect,tray_safe_margin_px=TRAY_SAFE_MARGIN_PX,@@ -2246,12 +2282,12 @@ class OrbOverlay:screens = screens_from_tk(self._root)monitor_geo, monitor_name = self._monitor_at_orb_center(screens)clamped_x, clamped_y = clamp_to_work_area(- self._mascot_x, self._mascot_y, monitor_geo, mascot_size_px=WIN_W+ self._mascot_x, self._mascot_y, monitor_geo, mascot_size_px=self._win_w)if (clamped_x, clamped_y) != (self._mascot_x, self._mascot_y):self._mascot_x = clamped_xself._mascot_y = clamped_y- self._root.geometry(f"{WIN_W}x{WIN_H}+{clamped_x}+{clamped_y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{clamped_x}+{clamped_y}")if self._comment_bubble is not None:self._comment_bubble.update_anchor(clamped_x, clamped_y, screen_w)if self._controls is not None:@@ -2272,7 +2308,7 @@ class OrbOverlay:if (anchor.x, anchor.y) != (self._mascot_x, self._mascot_y):self._mascot_x = anchor.xself._mascot_y = anchor.y- self._root.geometry(f"{WIN_W}x{WIN_H}+{anchor.x}+{anchor.y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{anchor.x}+{anchor.y}")if self._comment_bubble is not None:self._comment_bubble.update_anchor(anchor.x, anchor.y, screen_w)if self._controls is not None:@@ -2314,7 +2350,7 @@ class OrbOverlay:self._mascot_x = new_xself._mascot_y = new_ytry:- self._root.geometry(f"{WIN_W}x{WIN_H}+{new_x}+{new_y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{new_x}+{new_y}")except tk.TclError:returnif self._comment_bubble is not None:@@ -2337,13 +2373,13 @@ class OrbOverlay:screens = screens_from_tk(self._root)monitor_geo, monitor_name = self._monitor_at_orb_center(screens)clamped_x, clamped_y = clamp_to_work_area(- self._mascot_x, self._mascot_y, monitor_geo, mascot_size_px=WIN_W+ self._mascot_x, self._mascot_y, monitor_geo, mascot_size_px=self._win_w)if (clamped_x, clamped_y) != (self._mascot_x, self._mascot_y):self._mascot_x = clamped_xself._mascot_y = clamped_ytry:- self._root.geometry(f"{WIN_W}x{WIN_H}+{clamped_x}+{clamped_y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{clamped_x}+{clamped_y}")except tk.TclError:passif self._controls is not None:@@ -2402,8 +2438,8 @@ class OrbOverlay:parent=self._root,orb_x=self._mascot_x,orb_y=self._mascot_y,- orb_w=WIN_W,- orb_h=WIN_H,+ orb_w=self._win_w,+ orb_h=self._win_h,)except tk.TclError:logging.getLogger("jarvis.orb").debug("orb control row unavailable", exc_info=True)@@ -2715,7 +2751,7 @@ class OrbOverlay:self._mascot_x = anchor.xself._mascot_y = anchor.ytry:- self._root.geometry(f"{WIN_W}x{WIN_H}+{anchor.x}+{anchor.y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{anchor.x}+{anchor.y}")except tk.TclError:returnif self._comment_bubble is not None:@@ -2725,8 +2761,8 @@ class OrbOverlay:def _monitor_at_orb_center(self, screens: list) -> tuple[tuple[int, int, int, int], str]:"""Return (geometry, device_name) of the monitor containing the orb center."""- cx = self._mascot_x + WIN_W // 2- cy = self._mascot_y + WIN_H // 2+ cx = self._mascot_x + self._win_w // 2+ cy = self._mascot_y + self._win_h // 2for s in screens:sx, sy, sw, sh = s.geometryif sx <= cx < sx + sw and sy <= cy < sy + sh:@@ -2809,7 +2845,7 @@ class OrbOverlay:self._mascot_x = target_xself._mascot_y = target_ytry:- self._root.geometry(f"{WIN_W}x{WIN_H}+{target_x}+{target_y}")+ self._root.geometry(f"{self._win_w}x{self._win_h}+{target_x}+{target_y}")except tk.TclError:return# Only withdraw if no active LISTENING/THINKING/SPEAKING state has@@ -2849,7 +2885,7 @@ class OrbOverlay:viewable = int(self._root.winfo_viewable())x = int(self._root.winfo_x())y = int(self._root.winfo_y())- geometry = f"{WIN_W}x{WIN_H}+{x}+{y}"+ geometry = f"{self._win_w}x{self._win_h}+{x}+{y}"except tk.TclError:returnobserved = {@@ -2952,6 +2988,18 @@ class OrbOverlay:passself._pending_hide_after_id = None+ def _bubble_wanted(self) -> bool:+ """Does this style speak through a bubble at all?++ The mascot does — a character with a face says things in a bubble. The+ voice orb does NOT (maintainer, 2026-08-06): the sphere carries the+ whole state itself, and a panel of text floating over the desktop was+ the part that read as clutter. Everything the bubble used to say is now+ in how the orb moves — it swells on the voice, and its colours churn+ while it thinks.+ """+ return self._style != "voice_orb"+def show_comment(self, text: str, duration_ms: int = 3500) -> None:"""Pop a speech bubble above the orb. Thread-safe.@@ -2959,14 +3007,14 @@ class OrbOverlay:separately so the mouth only moves while audio is actually playing."""bubble = self._comment_bubble- if bubble is None or not text:+ if bubble is None or not text or not self._bubble_wanted():returnself._enqueue_ui(lambda: bubble.show(text, duration_ms))def show_listening_transcript(self, text: str = "", duration_ms: int = 30000) -> None:"""Show the larger live transcript bubble used while the user speaks."""bubble = self._comment_bubble- if bubble is None:+ if bubble is None or not self._bubble_wanted():returnself._enqueue_ui(lambda: bubble.show(text, duration_ms, variant="transcript"))@@ -3093,11 +3141,17 @@ class OrbOverlay:self._enqueue_ui(lambda: self._apply_style(style))def _apply_style(self, style: str) -> None:+ # Size first: _build_renderer paints at the window's edge length, so a+ # renderer built before the resize would be drawn at the old scale.+ self._win_w, self._win_h = window_size_for_style(style)new_renderer = self._build_renderer(style)if new_renderer is None:+ # Undo the resize — the old renderer is still the one painting.+ self._win_w, self._win_h = window_size_for_style(self._style)return # The fallback case was already logged in _build_rendererself._renderer = new_rendererself._style = style+ self._resize_window()# The bubble's look and the control row both belong to the style, so a# live swap has to carry them across or the new sphere inherits the# ghost's yellow bubble (and vice versa).@@ -3106,12 +3160,34 @@ class OrbOverlay:self._ensure_controls()self._sync_controls_visibility()+ def _resize_window(self) -> None:+ """Re-fit root, canvas and the attached surfaces after a style swap."""+ if self._root is None:+ return+ try:+ self._root.geometry(f"{self._win_w}x{self._win_h}+{self._mascot_x}+{self._mascot_y}")+ if self._canvas is not None:+ self._canvas.configure(width=self._win_w, height=self._win_h)+ except tk.TclError:+ logging.getLogger("jarvis.orb").debug("orb resize failed", exc_info=True)+ return+ if self._comment_bubble is not None:+ try:+ screen_w = self._root.winfo_screenwidth()+ except tk.TclError:+ screen_w = self._win_w+ self._comment_bubble.update_anchor(self._mascot_x, self._mascot_y, screen_w)+ self._comment_bubble.set_orb_width(self._win_w)+ if self._controls is not None:+ self._controls.set_orb_size(self._win_w, self._win_h)+ self._controls.update_anchor(self._mascot_x, self._mascot_y)+def _build_renderer(self, style: str) -> MascotRenderer | VoiceOrbRenderer | None:if style == "voice_orb":try:return VoiceOrbRenderer(- size=WIN_W, color_key=(int(COLOR_KEY_RGB[0]), int(COLOR_KEY_RGB[1]),- int(COLOR_KEY_RGB[2]))+ size=self._win_w,+ color_key=(int(COLOR_KEY_RGB[0]), int(COLOR_KEY_RGB[1]), int(COLOR_KEY_RGB[2])),)except Exception as exc: # noqa: BLE001import loggingdiff --git a/ui/orb/voice_orb.py b/ui/orb/voice_orb.pyindex 0228083c15..b1c3e32b72 100644--- a/ui/orb/voice_orb.py+++ b/ui/orb/voice_orb.py@@ -66,6 +66,7 @@ class Motion:"turbulence","energy","voice_impact",+ "color_churn",)def __init__(@@ -77,6 +78,7 @@ class Motion:turbulence: float,energy: float,voice_impact: float,+ color_churn: float = 0.28,) -> None:self.flow_x = flow_xself.flow_y = flow_y@@ -85,6 +87,11 @@ class Motion:self.turbulence = turbulenceself.energy = energyself.voice_impact = voice_impact+ #: How far the cloud field is allowed to drag the COLOUR ramp out of+ #: its vertical order. At rest it only softens the horizon; while+ #: thinking it is what makes the ivory, gold and amber visibly churn+ #: through each other instead of sitting in bands.+ self.color_churn = color_churndef copy(self) -> Motion:return Motion(@@ -95,6 +102,7 @@ class Motion:self.turbulence,self.energy,self.voice_impact,+ self.color_churn,)@@ -110,24 +118,40 @@ class Motion:#: * ``notice`` — something the user asked for did not happen. Quiet and dim,#: clearly awake but clearly not listening.MOTIONS: dict[str, Motion] = {- "idle": Motion(0.025, 0.008, 0.004, 0.14, 0.8, 0.86, 0.0),- "listen": Motion(0.11, 0.035, 0.016, 0.72, 1.02, 0.98, 0.0),- "think": Motion(0.42, -0.19, 0.009, 0.32, 1.28, 1.02, 0.0),- "speak": Motion(0.34, 0.085, 0.016, 0.82, 1.02, 1.0, 0.045),- "dictate": Motion(0.11, 0.035, 0.016, 0.72, 1.02, 0.98, 0.0),- "dictate_transcribing": Motion(0.42, -0.19, 0.009, 0.32, 1.28, 1.02, 0.0),- "notice": Motion(0.012, 0.0, 0.003, 0.12, 0.7, 0.72, 0.0),+ "idle": Motion(0.025, 0.008, 0.004, 0.14, 0.8, 0.86, 0.0, 0.28),+ "listen": Motion(0.11, 0.035, 0.016, 0.72, 1.02, 0.98, 0.0, 0.34),+ # Thinking is the one state with nothing to hear, so it has to be the most+ # visibly BUSY: the field races, and the colour ramp churns hard enough+ # that ivory, gold and amber run through each other (maintainer, 2026-08-06+ # — "the colours mix and that is how it shows it is thinking").+ "think": Motion(0.95, -0.44, 0.010, 0.34, 1.85, 1.08, 0.0, 1.45),+ "speak": Motion(0.34, 0.085, 0.014, 0.82, 1.06, 1.0, 0.11, 0.45),+ "dictate": Motion(0.11, 0.035, 0.016, 0.72, 1.02, 0.98, 0.0, 0.34),+ "dictate_transcribing": Motion(0.95, -0.44, 0.010, 0.34, 1.85, 1.08, 0.0, 1.45),+ "notice": Motion(0.012, 0.0, 0.003, 0.12, 0.7, 0.72, 0.0, 0.28),}-#: Modes that react to the live microphone / output level. Everything else-#: ignores ``ext_level`` outright, so a stale sample cannot animate the orb-#: while nothing is being heard.-_LEVEL_REACTIVE = frozenset({"listen", "dictate"})+#: Modes that react to a live level. ``speak`` is here because the bridge+#: forwards the REAL TTS loudness through ``set_level`` while Jarvis talks+#: (``OrbBridge._note_tts_level``); using it means the orb swells on the actual+#: voice instead of a synthetic cadence that only looks like speech. Every+#: other mode ignores ``ext_level`` outright, so a stale sample cannot animate+#: the orb while nothing is being heard.+_LEVEL_REACTIVE = frozenset({"listen", "dictate", "speak"})#: Floor under the dictation level: a quiet moment while recording must still#: read as "I am listening", never as a dead orb._DICTATE_LEVEL_FLOOR = 0.18+#: Resting size as a fraction of the window. Below 1.0 ON PURPOSE: the swell+#: has to have somewhere to go. With the old value the sphere already filled+#: its window at rest, every beat hit the ``min(1.0, ...)`` ceiling, and the+#: result was a bump nobody could see.+_BASE_SCALE = 0.86++#: How much of the remaining headroom a full-volume moment claims.+_LEVEL_SWELL = 0.12+def _mix(a, b, amount):return a + (b - a) * amount@@ -229,9 +253,7 @@ class VoiceOrbRenderer:self._ny, self._nx = np.meshgrid(axis, axis, indexing="ij")self._radius_field = np.sqrt(self._nx * self._nx + self._ny * self._ny)# Deterministic sub-LSB dither prevents broad 8-bit colour contours.- xs, ys = np.meshgrid(- np.arange(TEXTURE_SIZE), np.arange(TEXTURE_SIZE), indexing="xy"- )+ xs, ys = np.meshgrid(np.arange(TEXTURE_SIZE), np.arange(TEXTURE_SIZE), indexing="xy")self._dither = ((((xs * 73 + ys * 151) & 255) / 255.0) - 0.5) * 0.8self._live = MOTIONS["idle"].copy()@@ -268,6 +290,7 @@ class VoiceOrbRenderer:live.turbulence = _mix(live.turbulence, motion.turbulence, ease)live.energy = _mix(live.energy, motion.energy, ease)live.voice_impact = _mix(live.voice_impact, motion.voice_impact, ease)+ live.color_churn = _mix(live.color_churn, motion.color_churn, ease)self._phase_x += dt * live.flow_xself._phase_y += dt * live.flow_y@@ -276,10 +299,15 @@ class VoiceOrbRenderer:if math.isfinite(self._speaking_age):self._speaking_age += dt- # The surface receives lifecycle modes on every platform but no reliable- # normalized TTS output level, so speech choreography reacts to the- # truthful speaking mode instead of masquerading as a measured waveform.- speech = speech_envelope(self._activity_elapsed) if mode == "speak" else 0.0+ # Speech choreography. When the host forwards a REAL output level the+ # sphere follows that; the synthetic cadence is only the fallback for a+ # host that cannot measure its own playback, so the orb never stands+ # still while Jarvis is audibly talking.+ input_target = self._input_level(mode, ext_level)+ has_live_voice = mode == "speak" and ext_level is not None+ speech = (+ 0.0 if (mode != "speak" or has_live_voice) else speech_envelope(self._activity_elapsed)+ )onset = speaking_onset(self._speaking_age) if mode == "speak" else 0.0impact_target = live.voice_impact * speech + 0.032 * onsetimpact_ease = 1.0 - math.exp(-dt * (22.0 if impact_target > self._live_impact else 8.0))@@ -287,17 +315,16 @@ class VoiceOrbRenderer:# A quick attack makes consonants feel immediate; the softer release# prevents a nervous flicker between syllables.- input_target = self._input_level(mode, ext_level)input_ease = 1.0 - math.exp(-dt * (24.0 if input_target > self._live_input else 9.0))self._live_input = _mix(self._live_input, input_target, input_ease)- visual_impact = self._live_impact + self._live_input * 0.055+ visual_impact = self._live_impact + self._live_input * _LEVEL_SWELLif t >= self._field_due_t or self._texture is None:self._texture = self._paint_weather(visual_impact)self._field_due_t = t + FIELD_INTERVAL_Sbreath = (- 0.965+ _BASE_SCALE- live.breath_amp * 0.65+ live.breath_amp * 0.52 * math.sin(self._breath_phase)+ live.breath_amp * 0.13 * math.sin(self._breath_phase * 2.05 + 1.4)@@ -352,8 +379,14 @@ class VoiceOrbRenderer:)weather = cloud_field * 0.76 + detail * 0.24- # Warping the vertical colour position removes the synthetic horizon band.- vertical = _clamp((self._ny + 1.0) * 0.5 + (weather - 0.5) * 0.28)+ # Where a pixel sits on the ivory→amber ramp. Warping it by the cloud+ # field removes the synthetic horizon band at rest; opening the warp up+ # (``color_churn``) is what makes the palette visibly MIX rather than+ # sit in stripes, and the slow drift keeps that mixing in motion so a+ # thinking orb never settles into a still picture.+ churn = motion.color_churn+ drift = math.sin(self._phase_x * 2.4 + self._phase_y * 1.7) * churn * 0.20+ vertical = _clamp((self._ny + 1.0) * 0.5 + (weather - 0.5) * churn + drift)red, green, blue = self._palette(vertical)shadow = _smoothstep(0.48, 0.66, 1.0 - weather) * _smoothstep(0.28, 0.95, vertical) * 0.18