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(pets): a switch to always show the pet's buttons

rubenluetke10-beepe5fe7e64934c
diff --git a/docs/pets.md b/docs/pets.md
index 78208e6584..3e2603a338 100644
--- a/docs/pets.md
+++ b/docs/pets.md
@@ -18,7 +18,11 @@ one click.
- **The figure.** It reacts to Jarvis in real time (see *States*). It can be
dragged anywhere, and its position is remembered per monitor
(`[overlay.mascot] position_*`, shared with the mascot).
-- **The control strip** under the figure, from left to right:
+- **The control strip** under the figure. At rest only the figure shows; the
+ strip appears while Jarvis listens, thinks or talks, while notification cards
+ are up, and while the pointer is on the pet. With the pet "None", or with
+ **Always show the buttons** on (My Pets → Customize, `[ui] pet_strip_always`),
+ it always shows. From left to right:
- bell: notifications on or off for this run (see *Notifications*). Off
shows a red, struck-through bell and sends the cards on screen away; on
rings the bell. Like the speaker mute it never survives a restart, so a
@@ -247,7 +251,7 @@ name.
| Method | Meaning |
|---|---|
| `set_pet(pet_id)` | Swap the figure live; `"none"` shows the strip only |
-| `set_pet_look(scale, bubble)` | Apply size and card on/off live |
+| `set_pet_look(scale, bubble, strip_always)` | Apply size, card on/off and the always-on strip live |
| `set_pet_outcome(kind)` | Play the one-shot `success` or `error` |
| `set_pet_action(kind)` | `working` / `searching` for the running tool step, `None` when it ended |
| `set_pet_busy(busy)` | An agent task is running in the background |
@@ -285,6 +289,7 @@ Control-strip actions: `bell` (handled in the surface, reported through
| `[ui] pet_id` | `gigi` | Active pet (built-in id, `u…` id or `none`) |
| `[ui] pet_scale` | `1.0` | Size multiplier, 0.5–2.0 |
| `[ui] pet_bubble` | `true` | Show the thinking card |
+| `[ui] pet_strip_always` | `false` | Keep the control strip up even at rest |
| `[trigger] hotkey_pet_toggle` | `alt+win+p` | Hide / show the pet; empty disables it |
### REST (`jarvis/ui/web/pets_routes.py`)
@@ -295,7 +300,7 @@ Control-strip actions: `bell` (handled in the surface, reported through
| `GET /api/pets/{id}/sheet.png` | The sprite sheet |
| `GET /api/pets/template.png` | The empty sprite-sheet template (48 px cells, rows in state order) |
| `PUT /api/pets/active` | `{pet_id}` → saves `[ui] pet_id`, applies live |
-| `PUT /api/pets/settings` | `{scale?, bubble?}` → saves, applies live |
+| `PUT /api/pets/settings` | `{scale?, bubble?, strip_always?}` → saves, applies live |
| `POST /api/pets/visibility` | `{visible}` → runtime only |
| `POST /api/pets` | multipart: `sheet` (PNG), `name`, `description`, optional `manifest` (JSON), optional `frame_size` → the new pet |
| `DELETE /api/pets/{id}` | user-created pets only |
diff --git a/jarvis.toml.example b/jarvis.toml.example
index d0ca04adbe..d1e2f91bd3 100644
--- a/jarvis.toml.example
+++ b/jarvis.toml.example
@@ -198,6 +198,7 @@ bar_persistent = true # keep the bar visible at all times (not only durin
pet_id = "gigi" # desktop pet (orb_style = "pet"): built-in id, your own u… id, or "none"
pet_scale = 1.0 # pet size multiplier, 0.5–2.0
pet_bubble = true # show the pet's status bubble (what Jarvis is doing)
+pet_strip_always = false # true: the pet's buttons always show; false: only while active or hovered
# ── Memory ──
[memory]
diff --git a/jarvis/core/config.py b/jarvis/core/config.py
index 4666aca7a7..a19eca73df 100644
--- a/jarvis/core/config.py
+++ b/jarvis/core/config.py
@@ -2207,6 +2207,9 @@ class UIConfig(BaseModel):
pet_scale: float = 1.0
# Show the status bubble under the pet's control strip.
pet_bubble: bool = True
+ # Keep the pet's control strip on screen at all times. Off (default): it
+ # shows only while Jarvis listens, thinks or talks, or under the pointer.
+ pet_strip_always: bool = False
# Remembered "open with" choice for Outputs artifacts: an opener id
# ("default" = OS default app, "browser", or an editor key like "code").
# Empty = ask via the chooser dialog on first open. Desktop-only.
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.py
index f8d6ec8b3a..74adcce166 100644
--- a/jarvis/core/config_writer.py
+++ b/jarvis/core/config_writer.py
@@ -1464,6 +1464,11 @@ def set_pet_bubble(enabled: bool, *, path: Path = DEFAULT_CONFIG_FILE) -> None:
_patch_table(path, "ui", "pet_bubble", bool(enabled))
+def set_pet_strip_always(enabled: bool, *, path: Path = DEFAULT_CONFIG_FILE) -> None:
+ """Persist ``[ui] pet_strip_always`` (keep the pet's control strip up)."""
+ _patch_table(path, "ui", "pet_strip_always", bool(enabled))
+
+
def set_bar_follow_cursor_monitor(enabled: bool, *, path: Path = DEFAULT_CONFIG_FILE) -> None:
"""Persist ``[ui] bar_follow_cursor_monitor`` (the 'follow the mouse to the
active monitor' toggle).
diff --git a/jarvis/ui/desktop_app.py b/jarvis/ui/desktop_app.py
index 2a90e62528..368272d21d 100644
--- a/jarvis/ui/desktop_app.py
+++ b/jarvis/ui/desktop_app.py
@@ -3445,6 +3445,7 @@ class DesktopApp:
"pet_id": str(getattr(ui, "pet_id", DEFAULT_PET_ID) or DEFAULT_PET_ID),
"pet_scale": _clamp_pet_scale(getattr(ui, "pet_scale", 1.0)),
"pet_bubble": bool(getattr(ui, "pet_bubble", True)),
+ "pet_strip_always": bool(getattr(ui, "pet_strip_always", False)),
}
def _hide_on_idle_for(self, style: str) -> bool:
@@ -3493,21 +3494,27 @@ class DesktopApp:
return {"ok": True, "applied_live": self._pet_call("set_pet", pet)}
def set_pet_look(
- self, scale: float | None = None, bubble: bool | None = None
+ self,
+ scale: float | None = None,
+ bubble: bool | None = None,
+ strip_always: bool | None = None,
) -> dict[str, object]:
- """Apply the pet's size and status-bubble switch live (``PUT /api/pets/settings``)."""
+ """Apply the pet's size, bubble and strip switch live (``PUT /api/pets/settings``)."""
from loguru import logger
clamped = None if scale is None else _clamp_pet_scale(scale)
flag = None if bubble is None else bool(bubble)
+ strip = None if strip_always is None else bool(strip_always)
try:
if clamped is not None:
self.cfg.ui.pet_scale = clamped
if flag is not None:
self.cfg.ui.pet_bubble = flag
+ if strip is not None:
+ self.cfg.ui.pet_strip_always = strip
except Exception as exc: # noqa: BLE001
logger.warning("pet look not stored in config: {}", exc)
- return {"ok": True, "applied_live": self._pet_call("set_pet_look", clamped, flag)}
+ return {"ok": True, "applied_live": self._pet_call("set_pet_look", clamped, flag, strip)}
def set_pet_visible(self, visible: bool) -> dict[str, object]:
"""Hide or show the pet for this run (``POST /api/pets/visibility``).
diff --git a/jarvis/ui/jarvisbar/host.py b/jarvis/ui/jarvisbar/host.py
index dd349ec228..16f06c232b 100644
--- a/jarvis/ui/jarvisbar/host.py
+++ b/jarvis/ui/jarvisbar/host.py
@@ -18,7 +18,7 @@ Protocol (UTF-8, one JSON object per line):
``"jarvis_bar"`` (default) or ``"mascot"`` (the OrbOverlay window, whose look
comes from the optional ``"style"`` key — ``"mascot"``, ``"voice_orb"`` or
``"pet"`` — plus optional ``"mascot_path"``, ``"pet_id"``, ``"pet_scale"`` and
- ``"pet_bubble"`` passthroughs).
+ ``"pet_bubble"`` and ``"pet_strip_always"`` passthroughs).
stdin EOF means the parent died or shut down → the host stops the bar and
exits, so no ownerless bar can linger on the user's desktop.
- child → parent (stdout): events — ``{"event": "ready"}`` once the surface
@@ -165,11 +165,13 @@ def dispatch(surface: Any, msg: dict[str, Any]) -> bool:
elif op == "set_pet_look":
scale = msg.get("scale")
bubble = msg.get("bubble")
+ strip = msg.get("strip_always")
_call(
surface,
"set_pet_look",
None if scale is None else float(scale),
None if bubble is None else bool(bubble),
+ None if strip is None else bool(strip),
)
elif op == "set_pet_outcome":
_call(surface, "set_pet_outcome", str(msg.get("kind", "")))
@@ -389,6 +391,7 @@ def _build_surface(cfg: dict[str, Any]) -> Any:
pet_id=cfg.get("pet_id") or None,
pet_scale=1.0 if pet_scale is None else float(pet_scale),
pet_bubble=bool(cfg.get("pet_bubble", True)),
+ pet_strip_always=bool(cfg.get("pet_strip_always", False)),
)
kwargs = {
key: cfg[key]
diff --git a/jarvis/ui/jarvisbar/subprocess_overlay.py b/jarvis/ui/jarvisbar/subprocess_overlay.py
index e35a5c6179..a3117b37fd 100644
--- a/jarvis/ui/jarvisbar/subprocess_overlay.py
+++ b/jarvis/ui/jarvisbar/subprocess_overlay.py
@@ -715,6 +715,7 @@ class SubprocessMascotOverlay(SubprocessBarOverlay):
pet_id: str | None = None,
pet_scale: float = 1.0,
pet_bubble: bool = True,
+ pet_strip_always: bool = False,
) -> None:
super().__init__()
self._mascot_path = mascot_path
@@ -727,6 +728,7 @@ class SubprocessMascotOverlay(SubprocessBarOverlay):
self._pet_id = pet_id
self._pet_scale = float(pet_scale)
self._pet_bubble = bool(pet_bubble)
+ self._pet_strip_always = bool(pet_strip_always)
self._speaker_muted = False
self._user_visible = True
self._on_compose: Callable[[], None] | None = None
@@ -742,6 +744,7 @@ class SubprocessMascotOverlay(SubprocessBarOverlay):
"pet_id": self._pet_id,
"pet_scale": self._pet_scale,
"pet_bubble": self._pet_bubble,
+ "pet_strip_always": self._pet_strip_always,
}
@property
@@ -763,16 +766,24 @@ class SubprocessMascotOverlay(SubprocessBarOverlay):
self._pet_id = str(pet_id or "")
self._send({"op": "set_pet", "pet_id": self._pet_id})
- def set_pet_look(self, scale: float | None = None, bubble: bool | None = None) -> None:
+ def set_pet_look(
+ self,
+ scale: float | None = None,
+ bubble: bool | None = None,
+ strip_always: bool | None = None,
+ ) -> None:
if scale is not None:
self._pet_scale = float(scale)
if bubble is not None:
self._pet_bubble = bool(bubble)
+ if strip_always is not None:
+ self._pet_strip_always = bool(strip_always)
self._send(
{
"op": "set_pet_look",
"scale": None if scale is None else float(scale),
"bubble": None if bubble is None else bool(bubble),
+ "strip_always": None if strip_always is None else bool(strip_always),
}
)
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index f4887ee17a..ae83d33e82 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -5945,6 +5945,8 @@
"size_hint": "Wie groß das Pet auf deinem Desktop ist.",
"bubble_label": "Status-Blase",
"bubble_hint": "Kurze Zeilen unter dem Pet, die zeigen, was {name} gerade tut.",
+ "strip_label": "Knöpfe immer anzeigen",
+ "strip_hint": "Aus: Die Knöpfe unter dem Pet erscheinen nur, während {name} zuhört, nachdenkt oder spricht, oder wenn du auf das Pet zeigst.",
"shortcut_hint": "Blendet das Pet aus oder holt es wieder nach vorn.",
"my_pets": "Meine Pets",
"create": "Pet erstellen",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index d1fcacd26a..4ed1ba7c09 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -5978,6 +5978,8 @@
"size_hint": "How big the pet is on your desktop.",
"bubble_label": "Status bubble",
"bubble_hint": "Short lines under the pet that say what {name} is doing.",
+ "strip_label": "Always show the buttons",
+ "strip_hint": "Off: the buttons under the pet appear only while {name} listens, thinks or talks, or when you point at the pet.",
"shortcut_hint": "Hides the pet, or brings it back to the front.",
"my_pets": "My pets",
"create": "Create pet",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 1f75def2fe..009bdcf0f4 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -5945,6 +5945,8 @@
"size_hint": "Qué tan grande se ve la mascota en tu escritorio.",
"bubble_label": "Burbuja de estado",
"bubble_hint": "Líneas breves bajo la mascota que dicen qué está haciendo {name}.",
+ "strip_label": "Mostrar siempre los botones",
+ "strip_hint": "Desactivado: los botones bajo la mascota solo aparecen mientras {name} escucha, piensa o habla, o al señalar la mascota.",
"shortcut_hint": "Oculta la mascota o la trae de nuevo al frente.",
"my_pets": "Mis mascotas",
"create": "Crear mascota",
diff --git a/jarvis/ui/web/frontend/src/lib/petsApi.ts b/jarvis/ui/web/frontend/src/lib/petsApi.ts
index 3b321ca151..95b86d0da0 100644
--- a/jarvis/ui/web/frontend/src/lib/petsApi.ts
+++ b/jarvis/ui/web/frontend/src/lib/petsApi.ts
@@ -23,6 +23,8 @@ export interface PetsState {
active: string;
scale: number;
bubble: boolean;
+ /** The control strip stays up even at rest (`[ui] pet_strip_always`). */
+ strip_always: boolean;
visible: boolean;
pets: Pet[];
}
@@ -30,6 +32,7 @@ export interface PetsState {
export interface PetSettingsPatch {
scale?: number;
bubble?: boolean;
+ strip_always?: boolean;
}
export interface CreatePetInput {
diff --git a/jarvis/ui/web/frontend/src/views/PetsView.test.tsx b/jarvis/ui/web/frontend/src/views/PetsView.test.tsx
index 5d98822f33..8df7f60ca0 100644
--- a/jarvis/ui/web/frontend/src/views/PetsView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/PetsView.test.tsx
@@ -35,6 +35,7 @@ function stubServer({ style = "pet" }: { style?: string } = {}) {
active: "gigi",
scale: 1,
bubble: true,
+ strip_always: false,
visible: true,
style,
pets: [pet("gigi", "Gigi", true), pet("miso", "Miso", true), pet("u0123456789abcdef", "Pixel", false)],
@@ -259,6 +260,20 @@ describe("PetsView", () => {
);
});
+ it("switches the always-on buttons on from the customize panel", async () => {
+ const { calls } = stubServer();
+ renderView();
+
+ const customize = await screen.findByTestId("pets-customize");
+ await waitFor(() => expect((customize as HTMLButtonElement).disabled).toBe(false));
+ fireEvent.click(customize);
+ fireEvent.click(await screen.findByTestId("pets-strip-always"));
+
+ await waitFor(() =>
+ expect(calls).toContainEqual({ method: "PUT", url: "/api/pets/settings", body: { strip_always: true } }),
+ );
+ });
+
it("saves the size when the slider is released", async () => {
const { calls } = stubServer();
renderView();
diff --git a/jarvis/ui/web/frontend/src/views/PetsView.tsx b/jarvis/ui/web/frontend/src/views/PetsView.tsx
index 0be979aa10..49ce6b2e6d 100644
--- a/jarvis/ui/web/frontend/src/views/PetsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/PetsView.tsx
@@ -270,6 +270,7 @@ export function PetsView() {
<CustomizePanel
scale={data.scale}
bubble={data.bubble}
+ stripAlways={data.strip_always}
keybinds={keybinds}
/>
)}
@@ -448,10 +449,12 @@ function ActivePetCard({
function CustomizePanel({
scale,
bubble,
+ stripAlways,
keybinds,
}: {
scale: number;
bubble: boolean;
+ stripAlways: boolean;
keybinds: ReturnType<typeof useKeybinds>;
}) {
const t = useT();
@@ -526,6 +529,27 @@ function CustomizePanel({
}
/>
</div>
+ <div className="flex items-center justify-between gap-4 px-4 py-3">
+ <div className="min-w-0">
+ <p className="text-sm font-medium text-foreground">{t("pets.strip_label")}</p>
+ <p className="mt-0.5 text-xs text-muted-foreground">{t("pets.strip_hint")}</p>
+ </div>
+ <Switch
+ checked={stripAlways}
+ disabled={save.isPending}
+ aria-label={t("pets.strip_label")}
+ data-testid="pets-strip-always"
+ onCheckedChange={(next) =>
+ save.mutate(
+ { strip_always: next },
+ {
+ onError: (error) =>
+ pushToast("error", t("pets.save_error").replace("{0}", (error as Error).message)),
+ },
+ )
+ }
+ />
+ </div>
<div className="px-4 py-3">
<KeybindRow
action="pet_toggle"
diff --git a/jarvis/ui/web/pets_routes.py b/jarvis/ui/web/pets_routes.py
index fd6d76dbe6..b84abc6062 100644
--- a/jarvis/ui/web/pets_routes.py
+++ b/jarvis/ui/web/pets_routes.py
@@ -8,7 +8,7 @@ Endpoints (mounted by the WebServer in ``_build_app()``):
GET /api/pets/{id}/sheet.png → a pet's sprite sheet.
PUT /api/pets/active → pick the active pet (or "none"); saved
to ``[ui] pet_id`` and applied live.
- PUT /api/pets/settings → size and status bubble; saved, applied.
+ PUT /api/pets/settings → size, status bubble, always-on strip; saved, applied.
POST /api/pets/visibility → hide / show the pet (this run only).
POST /api/pets → create a pet from an uploaded sheet.
DELETE /api/pets/{id} → delete a user-created pet.
@@ -122,10 +122,13 @@ class ActiveBody(BaseModel):
class SettingsBody(BaseModel):
- """Both optional; only the ones sent are changed."""
+ """All optional; only the ones sent are changed."""
scale: float | None = Field(default=None, description="Size multiplier, 0.5–2.0")
bubble: bool | None = Field(default=None, description="Show the status bubble")
+ strip_always: bool | None = Field(
+ default=None, description="Keep the control strip up even at rest"
+ )
class VisibilityBody(BaseModel):
@@ -158,6 +161,10 @@ def _configured_bubble(request: Request) -> bool:
return bool(getattr(_ui(request), "pet_bubble", True))
+def _configured_strip_always(request: Request) -> bool:
+ return bool(getattr(_ui(request), "pet_strip_always", False))
+
+
def _pet_visible(request: Request) -> bool:
"""Runtime visibility, asked of the running DesktopApp (True headless)."""
getter = getattr(_desktop(request), "pet_visible", None)
@@ -287,6 +294,7 @@ def _state(request: Request, active: str) -> dict[str, Any]:
"active": active,
"scale": _configured_scale(request),
"bubble": _configured_bubble(request),
+ "strip_always": _configured_strip_always(request),
"visible": _pet_visible(request),
}
@@ -389,9 +397,11 @@ async def put_active(body: ActiveBody, request: Request) -> dict[str, Any]:
@router.put("/settings")
async def put_settings(body: SettingsBody, request: Request) -> dict[str, Any]:
- """Change the pet's size and / or its status bubble; saved and applied live."""
- if body.scale is None and body.bubble is None:
- raise HTTPException(status_code=400, detail="Send 'scale', 'bubble' or both.")
+ """Change the pet's size, status bubble or always-on strip; saved and applied live."""
+ if body.scale is None and body.bubble is None and body.strip_always is None:
+ raise HTTPException(
+ status_code=400, detail="Send at least one of 'scale', 'bubble', 'strip_always'."
+ )
_refuse_on_secondary_instance()
from jarvis.core import config_writer
@@ -414,9 +424,22 @@ async def put_settings(body: SettingsBody, request: Request) -> dict[str, Any]:
except Exception as exc: # noqa: BLE001 — the live apply is still worth trying
persisted = False
log.warning("pet_bubble persist failed (live apply still attempted): %s", exc)
+ if body.strip_always is not None:
+ _set_ui_value(request, "pet_strip_always", bool(body.strip_always))
+ try:
+ await asyncio.to_thread(
+ config_writer.set_pet_strip_always, bool(body.strip_always), path=_config_path()
+ )
+ except Exception as exc: # noqa: BLE001 — the live apply is still worth trying
+ persisted = False
+ log.warning("pet_strip_always persist failed (live apply still attempted): %s", exc)
applied_live, detail = await _apply(
- request, "set_pet_look", _configured_scale(request), _configured_bubble(request)
+ request,
+ "set_pet_look",
+ _configured_scale(request),
+ _configured_bubble(request),
+ _configured_strip_always(request),
)
active = _configured_pet_id(request)
await _publish_changed(request, active, source="settings")
diff --git a/tests/unit/core/test_pet_config.py b/tests/unit/core/test_pet_config.py
index 9152710379..6061aeff04 100644
--- a/tests/unit/core/test_pet_config.py
+++ b/tests/unit/core/test_pet_config.py
@@ -41,6 +41,7 @@ def test_defaults() -> None:
assert ui.pet_id == DEFAULT_PET_ID
assert ui.pet_scale == 1.0
assert ui.pet_bubble is True
+ assert ui.pet_strip_always is False
@pytest.mark.parametrize(
@@ -110,11 +111,13 @@ def test_writers_persist_the_three_ui_keys(tmp_path: Path) -> None:
config_writer.set_pet_id("Miso", path=toml)
config_writer.set_pet_scale(3.0, path=toml)
config_writer.set_pet_bubble(False, path=toml)
+ config_writer.set_pet_strip_always(True, path=toml)
ui = _ui_table(toml)
assert ui["pet_id"] == "miso"
assert ui["pet_scale"] == 2.0 # clamped before it reaches the disk
assert ui["pet_bubble"] is False
+ assert ui["pet_strip_always"] is True
assert ui["orb_style"] == "pet"
assert "# kept" in toml.read_text(encoding="utf-8") # comments survive
@@ -201,4 +204,5 @@ def test_example_config_documents_the_pet_keys() -> None:
assert data["ui"]["pet_id"] == UIConfig().pet_id
assert data["ui"]["pet_scale"] == UIConfig().pet_scale
assert data["ui"]["pet_bubble"] == UIConfig().pet_bubble
+ assert data["ui"]["pet_strip_always"] == UIConfig().pet_strip_always
assert data["trigger"]["hotkey_pet_toggle"] == TriggerConfig().hotkey_pet_toggle
diff --git a/tests/unit/ui/jarvisbar/test_subprocess_overlay.py b/tests/unit/ui/jarvisbar/test_subprocess_overlay.py
index 0fbeece912..f82455edff 100644
--- a/tests/unit/ui/jarvisbar/test_subprocess_overlay.py
+++ b/tests/unit/ui/jarvisbar/test_subprocess_overlay.py
@@ -562,6 +562,7 @@ def test_mascot_init_line_declares_surface_and_mascot_path(monkeypatch) -> None:
"pet_id": None,
"pet_scale": 1.0,
"pet_bubble": True,
+ "pet_strip_always": False,
}
assert surface._ready.is_set() # scripted ready event consumed
assert surface._visible is False # sticky=False mascot starts withdrawn
diff --git a/tests/unit/ui/test_pet_overlay_surface.py b/tests/unit/ui/test_pet_overlay_surface.py
index 112ef36754..4b7f402e9b 100644
--- a/tests/unit/ui/test_pet_overlay_surface.py
+++ b/tests/unit/ui/test_pet_overlay_surface.py
@@ -106,8 +106,8 @@ class _PetSurface:
def set_pet(self, pet_id: str) -> None:
self.calls.append(("set_pet", pet_id))
- def set_pet_look(self, scale, bubble) -> None:
- self.calls.append(("set_pet_look", scale, bubble))
+ def set_pet_look(self, scale, bubble, strip_always=None) -> None:
+ self.calls.append(("set_pet_look", scale, bubble, strip_always))
def set_visible(self, visible: bool) -> None:
self.pet_user_hidden = not visible
@@ -168,7 +168,10 @@ def test_set_pet_look_clamps_and_applies() -> None:
assert result == {"ok": True, "applied_live": True}
assert app.cfg.ui.pet_scale == 2.0
assert app.cfg.ui.pet_bubble is False
- assert surface.calls[-1] == ("set_pet_look", 2.0, False)
+ assert surface.calls[-1] == ("set_pet_look", 2.0, False, None)
+ app.set_pet_look(strip_always=True)
+ assert app.cfg.ui.pet_strip_always is True
+ assert surface.calls[-1] == ("set_pet_look", None, None, True)
def test_pet_methods_degrade_without_a_pet_surface() -> None:
@@ -565,6 +568,35 @@ def test_the_pointer_on_the_strip_keeps_it_up() -> None:
assert pet._pet_strip_wanted() is True
+def test_the_always_on_switch_keeps_the_strip_up_at_rest() -> None:
+ pet, strip = _pet_with_strip()
+ pet._mode = "idle"
+ pet.set_pet_look(strip_always=True)
+ assert pet._pet_strip_wanted() is True
+ pet._sync_controls_visibility()
+ assert strip.calls == ["show"]
+ pet.set_pet_look(strip_always=False)
+ assert pet._pet_strip_wanted() is False
+
+
+def test_the_macos_proxy_carries_the_always_on_strip() -> None:
+ from jarvis.ui.jarvisbar import host
+
+ proxy = SubprocessMascotOverlay(style="pet", pet_strip_always=True)
+ assert proxy._init_payload()["pet_strip_always"] is True
+ sent: list[dict] = []
+ proxy._send = sent.append # type: ignore[method-assign]
+ proxy.set_pet_look(strip_always=False)
+ looks: list[tuple] = []
+
+ class _Look:
+ def set_pet_look(self, scale, bubble, strip_always) -> None:
+ looks.append((scale, bubble, strip_always))
+
+ host.dispatch(_Look(), sent[-1])
+ assert looks == [(None, None, False)]
+
+
def test_the_figureless_pet_always_keeps_its_strip() -> None:
pet, strip = _pet_with_strip(pet_id="none")
pet._mode = "idle"
diff --git a/tests/unit/ui/test_pets_routes.py b/tests/unit/ui/test_pets_routes.py
index d14e5f6cd1..5de2c46213 100644
--- a/tests/unit/ui/test_pets_routes.py
+++ b/tests/unit/ui/test_pets_routes.py
@@ -85,8 +85,8 @@ class FakeDesktop:
self.calls.append(("set_pet", pet_id))
return {"ok": True, "applied_live": self._applied}
- def set_pet_look(self, scale: float, bubble: bool) -> dict:
- self.calls.append(("set_pet_look", scale, bubble))
+ def set_pet_look(self, scale: float, bubble: bool, strip_always: bool) -> dict:
+ self.calls.append(("set_pet_look", scale, bubble, strip_always))
return {"ok": True, "applied_live": self._applied}
def set_pet_visible(self, visible: bool) -> dict:
@@ -260,7 +260,7 @@ def test_put_settings_clamps_saves_and_applies(env) -> None:
assert (body["scale"], body["bubble"]) == (2.0, False)
assert _toml_ui(env)["pet_scale"] == 2.0
assert _toml_ui(env)["pet_bubble"] is False
- assert env.app.state.desktop_app.calls == [("set_pet_look", 2.0, False)]
+ assert env.app.state.desktop_app.calls == [("set_pet_look", 2.0, False, False)]
(event,) = env.app.state.bus.events
assert (event.scale, event.bubble) == (2.0, False)
@@ -268,7 +268,17 @@ def test_put_settings_clamps_saves_and_applies(env) -> None:
def test_put_settings_changes_only_what_is_sent(env) -> None:
env.client.put("/api/pets/settings", json={"bubble": False})
assert "pet_scale" not in _toml_ui(env)
- assert env.app.state.desktop_app.calls == [("set_pet_look", 1.0, False)]
+ assert env.app.state.desktop_app.calls == [("set_pet_look", 1.0, False, False)]
+
+
+def test_the_always_on_strip_is_saved_applied_and_reported(env) -> None:
+ assert env.client.get("/api/pets").json()["strip_always"] is False
+ r = env.client.put("/api/pets/settings", json={"strip_always": True})
+ assert r.status_code == 200
+ assert r.json()["strip_always"] is True
+ assert _toml_ui(env)["pet_strip_always"] is True
+ assert env.app.state.desktop_app.calls == [("set_pet_look", 1.0, True, True)]
+ assert env.client.get("/api/pets").json()["strip_always"] is True
def test_put_settings_needs_something_to_change(env) -> None:
diff --git a/ui/orb/overlay.py b/ui/orb/overlay.py
index b57884b6ec..33ed9b0db8 100644
--- a/ui/orb/overlay.py
+++ b/ui/orb/overlay.py
@@ -2634,6 +2634,7 @@ class OrbOverlay:
pet_id: str | None = None,
pet_scale: float | None = 1.0,
pet_bubble: bool = True,
+ pet_strip_always: bool = False,
) -> None:
"""
style: one of :data:`ORB_STYLES` — ``"mascot"`` (the Gigi ghost),
@@ -2643,6 +2644,7 @@ class OrbOverlay:
mascot_path: optional explicit path, otherwise via ENV or the default asset.
pet_id / pet_scale / pet_bubble: the pet style's ``[ui]`` settings — which
pet, its size multiplier (0.5–2.0) and whether the status bubble shows.
+ pet_strip_always: keep the pet's control strip up even at rest.
ENV-Override: ``JARVIS_ORB_STYLE=mascot|voice_orb`` selects the look;
unknown values are ignored.
"""
@@ -2688,6 +2690,8 @@ class OrbOverlay:
self._pet_id = str(pet_id or DEFAULT_PET_ID).strip() or DEFAULT_PET_ID
self._pet_scale = _clamp_pet_scale(1.0 if pet_scale is None else pet_scale)
self._pet_bubble = bool(pet_bubble)
+ #: ``[ui] pet_strip_always``: the strip stays up even at rest.
+ self._pet_strip_always = bool(pet_strip_always)
#: Mirrors ``VoiceMuteChanged`` for the strip's microphone control.
self._mic_muted = False
#: Hidden by the shortcut or the settings page — lasts until restart.
@@ -3392,11 +3396,12 @@ class OrbOverlay:
def _pet_strip_wanted(self) -> bool:
"""Should the pet's strip be up right now?
- Only while it is useful: Jarvis is listening, thinking or talking, the
+ Always when the user asked for it (``[ui] pet_strip_always``). Else
+ only while it is useful: Jarvis is listening, thinking or talking, the
pointer is on the figure or the strip, or the pet is "None" (the strip
is all there is, so hiding it would leave nothing to hover).
"""
- if self._pet_id == NO_PET_ID:
+ if self._pet_strip_always or self._pet_id == NO_PET_ID:
return True
if self._mode in PET_VOICE_MODES or self._mode in PET_THINK_MODES:
return True
@@ -4229,12 +4234,19 @@ class OrbOverlay:
self._note_activity()
self._enqueue_ui(lambda: self._apply_pet(pet))
- def set_pet_look(self, scale: float | None = None, bubble: bool | None = None) -> None:
- """Apply the pet's size multiplier and bubble on/off live. Thread-safe."""
+ def set_pet_look(
+ self,
+ scale: float | None = None,
+ bubble: bool | None = None,
+ strip_always: bool | None = None,
+ ) -> None:
+ """Apply the pet's size, bubble and always-on strip live. Thread-safe."""
if scale is not None:
self._pet_scale = _clamp_pet_scale(scale)
if bubble is not None:
self._pet_bubble = bool(bubble)
+ if strip_always is not None:
+ self._pet_strip_always = bool(strip_always)
self._note_activity()
self._enqueue_ui(self._apply_pet_look)
@@ -4352,6 +4364,7 @@ class OrbOverlay:
renderer.set_look(pet_scale=self._pet_scale)
self._refit_pet_window()
self._sync_pet_strip_scale()
+ self._sync_controls_visibility() # the always-on switch may have flipped
def _apply_outcome(self, kind: str) -> None:
renderer = self._renderer