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(jarvisbar): show the voice indicator instead of the blue sphere

rubenluetke10-beepb575f55f6b15
diff --git a/jarvis/ui/jarvisbar/renderer.py b/jarvis/ui/jarvisbar/renderer.py
index 4a5fc009a3..2237558779 100644
--- a/jarvis/ui/jarvisbar/renderer.py
+++ b/jarvis/ui/jarvisbar/renderer.py
@@ -227,7 +227,7 @@ def pill_center_y(_height: float) -> float:
class JarvisBarRenderer:
def __init__(self, accent: str = "#e7c46e") -> None:
- # Retained for saved-config compatibility; the authored sphere is blue.
+ # The Prompt Mode mark takes this colour; the indicator keeps its own sky.
try:
value = accent.lstrip("#")
if len(value) != 6:
@@ -277,37 +277,46 @@ class JarvisBarRenderer:
layout = controls.pet_strip_layout(strip_scale())
_, x0, x1 = next(slot for slot in layout.slots if slot[0] == "orb")
cx, cy = (x0 + x1) / 2, WIN_H / 2
- r = max(2, (layout.pill[3] - layout.pill[1]) * 0.16)
+ pill_h = layout.pill[3] - layout.pill[1]
+ r = max(2, pill_h * 0.16)
draw = ImageDraw.Draw(frame)
- color = controls.PET_ICON
width = max(1, round(strip_scale() * 2))
- if actual in DICTATION_MODES:
- draw.rounded_rectangle((cx - r, cy - r, cx + r, cy + r), radius=1, fill=color)
- elif prompt_mode:
- color = self.accent
- draw.line(
- [(cx - r, cy), (cx, cy - r), (cx + r, cy), (cx, cy + r), (cx - r, cy)],
- fill=color,
- width=width,
- )
- if prompt_mode_paused:
- draw.line(
- (cx - r, cy - r, cx + r, cy + r), fill=controls.PET_ICON_MUTED, width=width
- )
+ backdrop = controls.PET_FILL_HOVER if hovered_action == "orb" else controls.PET_FILL
+ clear_r = pill_h * 0.40
+
+ def clear_indicator() -> None:
+ # A mark replaces the indicator; drawn over the strokes it is unreadable.
+ draw.ellipse((cx - clear_r, cy - clear_r, cx + clear_r, cy + clear_r), fill=backdrop)
+
if (
drop_state in (DROP_STATE_OK, DROP_STATE_REJECTED)
and drop_elapsed >= DROP_CONFIRM_TOTAL_S
):
drop_state = DROP_STATE_NONE
if actual in NOTICE_MODES or drop_state == DROP_STATE_REJECTED:
+ clear_indicator()
red = tuple(round(c * notice_alpha(t)) for c in controls.PET_ICON_MUTED)
draw.line((cx - r, cy - r, cx + r, cy + r), fill=red, width=width)
draw.line((cx - r, cy + r, cx + r, cy - r), fill=red, width=width)
elif drop_state == DROP_STATE_OK:
+ clear_indicator()
draw.line(
[(cx - r, cy), (cx, cy + r), (cx + r, cy - r)], fill=(126, 200, 133), width=width
)
- elif drop_state == DROP_STATE_ARMED:
+ elif prompt_mode and motion == "rest":
+ # Prompt Mode marks the resting bar only; once a voice or a
+ # dictation runs, the moving strokes tell more than the mark.
+ clear_indicator()
+ draw.line(
+ [(cx - r, cy), (cx, cy - r), (cx + r, cy), (cx, cy + r), (cx - r, cy)],
+ fill=self.accent,
+ width=width,
+ )
+ if prompt_mode_paused:
+ draw.line(
+ (cx - r, cy - r, cx + r, cy + r), fill=controls.PET_ICON_MUTED, width=width
+ )
+ if drop_state == DROP_STATE_ARMED:
draw.rounded_rectangle(
layout.pill, radius=WIN_H / 2, outline=controls.PET_ORB_HIGHLIGHT, width=width
)
diff --git a/jarvis/ui/web/frontend/src/components/overlay/OverlayStylePreviews.tsx b/jarvis/ui/web/frontend/src/components/overlay/OverlayStylePreviews.tsx
index f6da8a3d48..06174cd615 100644
--- a/jarvis/ui/web/frontend/src/components/overlay/OverlayStylePreviews.tsx
+++ b/jarvis/ui/web/frontend/src/components/overlay/OverlayStylePreviews.tsx
@@ -21,7 +21,7 @@ import {
* without one view importing the other. The mascot reuses the real Gigi SVG.
*
* The canonical bar uses the existing Pet control-strip preview, including
- * its write, microphone, blue talk sphere, speaker and phone controls.
+ * its write, microphone, voice indicator, speaker and phone controls.
*
* These are still previews, not instruments: they animate nothing. Three
* thumbnails oscillating side by side on a settings screen is noise, and with
diff --git a/jarvis/ui/web/frontend/src/components/pets/PetControlStripPreview.tsx b/jarvis/ui/web/frontend/src/components/pets/PetControlStripPreview.tsx
index 0183000a16..b7ce81ebd2 100644
--- a/jarvis/ui/web/frontend/src/components/pets/PetControlStripPreview.tsx
+++ b/jarvis/ui/web/frontend/src/components/pets/PetControlStripPreview.tsx
@@ -11,14 +11,13 @@ import { cn } from "@/lib/utils";
const STRIP_FILL = "#0d1117";
const STRIP_ICON = "#e8e9ee";
const STRIP_DIVIDER = "#181c25";
-/** The glossy talk orb: lit from the top left, deep blue at the rim. */
-const ORB_GRADIENT =
- "radial-gradient(circle at 32% 30%, #e6f1ff 0 7%, #a9d0ff 15%, #4a7cf5 55%, #2747c8 100%)";
+/** The indicator strokes' sky blue (`PET_INDICATOR_SKY`). */
+const STRIP_INDICATOR = "#7ebaff";
/**
- * A still picture of the control strip the desktop pet carries: the pen in
- * its own filled disc (new chat), then one filled pill holding the
- * microphone, the talk orb and the speaker, split by faint dividers, then the
+ * A still picture of the control strip the desktop pet and the Jarvis Bar
+ * share: the pen in its own filled disc (new chat; the pet has a bell there), then one filled pill holding the
+ * microphone, the three-stroke voice indicator and the speaker, split by faint dividers, then the
* phone that calls Jarvis (its handset lies flat to hang up). Shown on
* the settings page so the user knows what sits under the pet before
* switching it on.
@@ -41,7 +40,6 @@ export function PetControlStripPreview({
const disc = small ? "w-7" : "w-10";
const slot = small ? "w-7" : "w-10";
const icon = small ? "h-3.5 w-3.5" : "h-[18px] w-[18px]";
- const orb = small ? "h-[22px] w-[22px]" : "h-8 w-8";
const divider = small ? "h-3" : "h-5";
return (
<div
@@ -64,13 +62,15 @@ export function PetControlStripPreview({
</span>
<span className={cn("w-px", divider)} style={{ backgroundColor: STRIP_DIVIDER }} />
<span className={cn("grid place-items-center", small ? "w-8" : "w-11")}>
- {companion ? <span className="flex items-center gap-1" data-testid="pet-strip-indicator">
- {[0, 1, 2].map((i) => <span key={i} className="h-2 w-1 rounded-full bg-[#7ebaff]" />)}
- </span> : <span
- data-testid="pet-strip-orb"
- className={cn("rounded-full", orb)}
- style={{ backgroundImage: ORB_GRADIENT }}
- />}
+ <span className="flex items-center gap-1" data-testid="pet-strip-indicator">
+ {[0, 1, 2].map((i) => (
+ <span
+ key={i}
+ className={cn("rounded-full", small ? "h-2 w-1" : "h-2.5 w-1.5")}
+ style={{ backgroundColor: STRIP_INDICATOR }}
+ />
+ ))}
+ </span>
</span>
<span className={cn("w-px", divider)} style={{ backgroundColor: STRIP_DIVIDER }} />
<span className={cn("grid place-items-center", slot)}>
diff --git a/jarvis/ui/web/frontend/src/components/pets/PetSprite.test.tsx b/jarvis/ui/web/frontend/src/components/pets/PetSprite.test.tsx
index eab509caee..9dfe6a030f 100644
--- a/jarvis/ui/web/frontend/src/components/pets/PetSprite.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/pets/PetSprite.test.tsx
@@ -117,11 +117,11 @@ describe("spriteFrameAt (the desktop's playback order)", () => {
});
describe("PetControlStripPreview", () => {
- it("is a decorative picture with the glossy orb", () => {
+ it("is a decorative picture with the three-stroke indicator", () => {
render(<PetControlStripPreview />);
const strip = screen.getByTestId("pet-strip-preview");
expect(strip.getAttribute("aria-hidden")).toBe("true");
expect(strip.querySelector("button")).toBeNull();
- expect(screen.getByTestId("pet-strip-orb").style.backgroundImage).toContain("radial-gradient");
+ expect(screen.getByTestId("pet-strip-indicator").children).toHaveLength(3);
});
});
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 3714f72ec2..268900c5b2 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -2942,7 +2942,7 @@
},
"overlay_style": {
"title": "Anzeige-Stil",
- "description": "Die Jarvis Bar hat einen blauen Sprach-Orb und Tasten für einen neuen Textchat, Mikrofon-Stummschaltung, Assistenten-Audio und Anrufe. Wähle alternativ Maskottchen, Sprach-Orb oder Pet, oder Keine zum Ausblenden. Jede schwebende Anzeige lässt sich auf einen Monitor ziehen.",
+ "description": "Die Jarvis Bar hat eine Sprachanzeige zum Sprechen und Tasten für einen neuen Textchat, Mikrofon-Stummschaltung, Assistenten-Audio und Anrufe. Wähle alternativ Maskottchen, Sprach-Orb oder Pet, oder Keine zum Ausblenden. Jede schwebende Anzeige lässt sich auf einen Monitor ziehen.",
"label": "Stil",
"save": "Speichern",
"saved": "Anzeige-Stil gewechselt.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index f61a353b60..5e8f60bcce 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -2942,7 +2942,7 @@
},
"overlay_style": {
"title": "Display style",
- "description": "The Jarvis Bar has a blue talk orb and controls for a new text chat, microphone mute, assistant audio and calls. Choose Mascot, Voice orb or Pet for another display style, or None to hide the overlay. Drag any floating style to place it on a monitor.",
+ "description": "The Jarvis Bar has a voice indicator to talk and controls for a new text chat, microphone mute, assistant audio and calls. Choose Mascot, Voice orb or Pet for another display style, or None to hide the overlay. Drag any floating style to place it on a monitor.",
"label": "Style",
"save": "Save",
"saved": "Display style switched.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index e630add672..898c4fe2c6 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -2942,7 +2942,7 @@
},
"overlay_style": {
"title": "Estilo de visualización",
- "description": "Jarvis Bar tiene un orbe azul y controles para un nuevo chat de texto, silenciar el micrófono, audio del asistente y llamadas. Elige Mascota, Orbe de voz o Pet para otro estilo, o Ninguno para ocultarlo. Puedes arrastrar cada vista flotante a un monitor.",
+ "description": "Jarvis Bar tiene un indicador de voz para hablar y controles para un nuevo chat de texto, silenciar el micrófono, audio del asistente y llamadas. Elige Mascota, Orbe de voz o Pet para otro estilo, o Ninguno para ocultarlo. Puedes arrastrar cada vista flotante a un monitor.",
"label": "Estilo",
"save": "Guardar",
"saved": "Estilo de visualización cambiado.",
diff --git a/jarvis/ui/web/frontend/src/views/settings/OverlayTaskbarGroup.test.tsx b/jarvis/ui/web/frontend/src/views/settings/OverlayTaskbarGroup.test.tsx
index 5141f8aab1..471b2a2979 100644
--- a/jarvis/ui/web/frontend/src/views/settings/OverlayTaskbarGroup.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/OverlayTaskbarGroup.test.tsx
@@ -55,10 +55,11 @@ afterEach(() => {
});
describe("OverlayTaskbarGroup", () => {
- it("shows the authored blue-orb bar as the default preview", () => {
+ it("shows the bar with the voice indicator as the default preview", () => {
render(<OverlayTaskbarGroup />);
expect(screen.getByTestId("jarvis-bar-preview")).toBeDefined();
- expect(screen.getByTestId("pet-strip-orb").style.backgroundImage).toContain("radial-gradient");
+ const bar = screen.getByTestId("jarvis-bar-preview");
+ expect(bar.querySelector('[data-testid="pet-strip-indicator"]')?.children).toHaveLength(3);
expect(screen.getByTestId("pet-strip-call")).toBeDefined();
});
diff --git a/tests/unit/ui/jarvisbar/test_canonical_strip.py b/tests/unit/ui/jarvisbar/test_canonical_strip.py
index ca1170fff3..664317d3f7 100644
--- a/tests/unit/ui/jarvisbar/test_canonical_strip.py
+++ b/tests/unit/ui/jarvisbar/test_canonical_strip.py
@@ -146,7 +146,7 @@ def test_hangup_guard_keeps_write_and_audio_controls_available(kind):
assert events == ["compose", "speaker", "mic"]
-def test_live_audio_moves_the_sphere_but_idle_stays_still():
+def test_live_audio_moves_the_indicator_but_idle_stays_still():
painter = renderer.JarvisBarRenderer()
assert painter.render(0, "listen", 0).tobytes() != painter.render(0, "listen", 1).tobytes()
assert painter.render(0, "idle", 0).tobytes() == painter.render(3, "idle", 1).tobytes()
@@ -160,3 +160,27 @@ def test_pet_keeps_its_existing_notification_strip():
controls.render_pet_strip(state).tobytes()
!= renderer.JarvisBarRenderer().render(0, "idle").tobytes()
)
+
+
+ "motion,level,phase", [("rest", 0, 0), ("voice", 4, 0), ("think", 0, 5)]
+)
+def test_the_bar_shows_the_pets_indicator_not_a_sphere(motion, level, phase):
+ # One talk control for both styles: the bar's pill is the pet's pill, the
+ # only difference is the pen disc where the pet has its bell.
+ layout = controls.pet_strip_layout()
+ shared = {"motion": motion, "level": level, "phase": phase}
+ bar = controls.render_pet_strip(controls.PetStripState(jarvis_bar=True, **shared))
+ pet = controls.render_pet_strip(controls.PetStripState(**shared))
+ assert bar.crop(layout.pill).tobytes() == pet.crop(layout.pill).tobytes()
+
+
+def test_a_mark_replaces_the_indicator_instead_of_covering_it():
+ painter = renderer.JarvisBarRenderer()
+ plain = painter.render(0, "idle")
+ marked = painter.render(0, "idle", prompt_mode=True)
+ # While a voice runs the moving strokes win over the Prompt Mode mark.
+ assert painter.render(0, "listen", 0.6, prompt_mode=True).tobytes() == painter.render(
+ 0, "listen", 0.6
+ ).tobytes()
+ assert marked.tobytes() != plain.tobytes()
diff --git a/ui/orb/controls.py b/ui/orb/controls.py
index 1128b5189b..603ffa277c 100644
--- a/ui/orb/controls.py
+++ b/ui/orb/controls.py
@@ -619,7 +619,7 @@ class PetStripState:
#: Jarvis's microphone is muted (``VoiceMuteChanged``).
mic_muted: bool = False
- #: The canonical bar uses the original pen and blue talk sphere.
+ #: The Jarvis Bar: the pen (a new text chat) replaces the pet's bell.
jarvis_bar: bool = False
#: The assistant's voice is muted for this session.
speaker_muted: bool = False
@@ -1024,45 +1024,7 @@ def _stroke_mask(width: int, height: int) -> Image.Image:
return mask
-PET_ORB_REST_SHARE = 0.80
-PET_ORB_PULSE_SHARE = 0.08
PET_ORB_HIGHLIGHT = (169, 208, 255)
-PET_ORB_MID = (74, 124, 245)
-PET_ORB_RIM = (39, 71, 200)
-PET_ORB_SPECULAR = (230, 241, 255)
-
-def _draw_orb(
- d: ImageDraw.ImageDraw,
- cx: float,
- cy: float,
- radius: float,
-) -> None:
- """A glossy sphere: concentric discs drifting toward a top-left light.
-
- The outermost disc is the deep rim colour, the innermost the highlight; the
- centres slide toward the light as they shrink, which reads as a lit ball.
- PIL only — no numpy on this import path.
- """
- steps = max(8, int(radius))
- lx, ly = cx - radius * 0.38, cy - radius * 0.40
- for k in range(steps, 0, -1):
- t = k / steps # 1 at the rim, toward 0 at the light
- r = radius * t
- ox = lx + (cx - lx) * t
- oy = ly + (cy - ly) * t
- if t > 0.55:
- color = _lerp(PET_ORB_MID, PET_ORB_RIM, (t - 0.55) / 0.45)
- else:
- color = _lerp(PET_ORB_HIGHLIGHT, PET_ORB_MID, t / 0.55)
- d.ellipse([ox - r, oy - r, ox + r, oy + r], fill=color)
- shine = radius * 0.16
- sx, sy = cx - radius * 0.42, cy - radius * 0.46
- d.ellipse([sx - shine, sy - shine * 0.8, sx + shine, sy + shine * 0.8], fill=PET_ORB_SPECULAR)
-
-def _orb_radius(state: PetStripState, pill_height: float) -> float:
- pulse = (state.level / PET_LEVEL_STEPS) if state.active or state.motion == "voice" else 0.0
- share = PET_ORB_REST_SHARE + PET_ORB_PULSE_SHARE * max(0.0, min(1.0, pulse))
- return pill_height * share / 2.0
def _draw_indicator(
@@ -1148,20 +1110,9 @@ def _render_pill(state: PetStripState, layout: PetStripLayout, scale: float) ->
for action, sx0, sx1 in layout.slots:
cx = ((sx0 + sx1) / 2.0 - x0) * _SS
if action == "orb":
- if state.jarvis_bar:
- _draw_orb(d, cx, cy, _orb_radius(state, h_ss))
- if state.motion == "think":
- radius = h_ss * 0.44
- start = state.phase * 360 / PET_THINK_PHASES
- d.arc(
- [cx - radius, cy - radius, cx + radius, cy + radius],
- start,
- start + 90,
- fill=PET_ORB_HIGHLIGHT,
- width=max(1, int(stroke)),
- )
- else:
- _draw_indicator(layer, cx, cy, h_ss, state)
+ # The pet and the Jarvis Bar share one talk control: the three
+ # strokes that rest, follow the voice and run while Jarvis thinks.
+ _draw_indicator(layer, cx, cy, h_ss, state)
else:
_draw_glyph(action, d, cx, cy, box, stroke, state)
return layer.resize((width, height), Image.Resampling.LANCZOS)