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.

fix(apikeys): show the personal-recommendation panel only in the Realtime tab set

Ruben Lütke54457c867401
diff --git a/jarvis/ui/web/frontend/src/views/ApiKeysView.recommended-setup.test.tsx b/jarvis/ui/web/frontend/src/views/ApiKeysView.recommended-setup.test.tsx
index 5b668d2c0f..f7ba427557 100644
--- a/jarvis/ui/web/frontend/src/views/ApiKeysView.recommended-setup.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/ApiKeysView.recommended-setup.test.tsx
@@ -2,11 +2,12 @@
* Component tests for the "Personal recommendation" panel in the voice-engine
* header band (RecommendedSetupPanel).
*
- * The panel is a presentation-only hint (AP-21): it lists the maintainer's
- * pick for Realtime / Tool Model / Jarvis-Agents, and each row navigates to
- * the tab it names. Navigation is VIEW-only — opening the Realtime tab set
- * from a recommendation row must never persist `[voice].mode` (only the
- * key-gated segmented switch does that).
+ * The panel is a presentation-only hint (AP-21) for the REALTIME tab set: it
+ * lists the maintainer's pick for Realtime / Tool Model / Jarvis-Agents, so it
+ * renders ONLY while the Realtime tab set is being viewed (maintainer feedback
+ * 2026-07-17: next to the Pipeline tabs it would point at tabs that are not on
+ * screen). Each row navigates to the tab it names — VIEW-only navigation that
+ * must never persist `[voice].mode` (only the key-gated segmented switch does).
*/
import { afterEach, describe, expect, it, vi } from "vitest";
import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";
@@ -52,13 +53,24 @@ afterEach(() => {
vi.clearAllMocks();
});
+/** Switch the VIEW to the Realtime tab set via the engine segment. */
+function openRealtimeView() {
+ fireEvent.click(screen.getByRole("button", { name: /^realtime/i }));
+}
+
function panel() {
return within(screen.getByTestId("recommended-setup-panel"));
}
describe("ApiKeysView recommended-setup panel", () => {
- it("lists the three maintainer picks", () => {
+ it("stays hidden while the Pipeline tab set is viewed", () => {
+ render(<ApiKeysView />);
+ expect(screen.queryByTestId("recommended-setup-panel")).toBeNull();
+ });
+
+ it("lists the three maintainer picks once the Realtime tab set is viewed", () => {
render(<ApiKeysView />);
+ openRealtimeView();
expect(panel().getByText("OpenAI Realtime")).toBeTruthy();
expect(panel().getByText("Gemini 3.5 Flash")).toBeTruthy();
expect(panel().getByText("ChatGPT or Claude Max subscription")).toBeTruthy();
@@ -66,6 +78,7 @@ describe("ApiKeysView recommended-setup panel", () => {
it("keeps the segment buttons uniquely addressable (no /^realtime/i collision)", () => {
render(<ApiKeysView />);
+ openRealtimeView();
// The two-mode tests select the engine segment via /^realtime/i; the
// recommendation rows must not shadow that accessible name.
expect(screen.getAllByRole("button", { name: /^realtime/i })).toHaveLength(1);
@@ -73,9 +86,10 @@ describe("ApiKeysView recommended-setup panel", () => {
it("opens the Tool Model tab from its recommendation row", () => {
render(<ApiKeysView />);
- fireEvent.click(
- panel().getByRole("button", { name: /personal recommendation: tool model/i }),
- );
+ openRealtimeView();
+ // Rows are addressed by stable testids, not their labels — the tab labels
+ // are i18n strings other work renames (e.g. Jarvis-Agents -> {name}-Agents).
+ fireEvent.click(screen.getByTestId("reco-row-computer-use"));
expect(
(screen.getByRole("tab", { name: /tool model/i }) as HTMLElement).getAttribute(
"aria-selected",
@@ -83,34 +97,35 @@ describe("ApiKeysView recommended-setup panel", () => {
).toBe("true");
});
- it("opens the Jarvis-Agents tab from its recommendation row", () => {
+ it("opens the agents tab from its recommendation row", () => {
render(<ApiKeysView />);
- fireEvent.click(
- panel().getByRole("button", { name: /personal recommendation: jarvis-agents/i }),
- );
+ openRealtimeView();
+ fireEvent.click(screen.getByTestId("reco-row-subagents"));
+ // Label-agnostic: both "Jarvis-Agents" and a "{name}-Agents" rebrand end
+ // in "Agents", and no other tab does.
expect(
- (screen.getByRole("tab", { name: /jarvis-agents/i }) as HTMLElement).getAttribute(
+ (screen.getByRole("tab", { name: /agents$/i }) as HTMLElement).getAttribute(
"aria-selected",
),
).toBe("true");
});
- it("opens the Realtime tab set from its row WITHOUT persisting voice mode", () => {
+ it("returns to the Realtime tab from its row WITHOUT persisting voice mode", () => {
render(<ApiKeysView />);
- // Pipeline is the default view: no Realtime tab yet.
- expect(screen.queryByRole("tab", { name: /realtime/i })).toBeNull();
+ openRealtimeView();
+ // Wander off to another tab of the realtime set first.
+ fireEvent.click(screen.getByRole("tab", { name: /tool model/i }));
+ putVoiceMode.mockClear();
- fireEvent.click(
- panel().getByRole("button", { name: /personal recommendation: realtime/i }),
- );
+ fireEvent.click(screen.getByTestId("reco-row-realtime"));
- // The view switched to the Realtime tab set with the Realtime tab selected…
+ // The Realtime tab is selected again…
expect(
(screen.getByRole("tab", { name: /realtime/i }) as HTMLElement).getAttribute(
"aria-selected",
),
).toBe("true");
- // …but `[voice].mode` stays untouched — only the segmented switch persists.
+ // …and `[voice].mode` stays untouched — only the segmented switch persists.
expect(putVoiceMode).not.toHaveBeenCalled();
});
});
diff --git a/jarvis/ui/web/frontend/src/views/ApiKeysView.tsx b/jarvis/ui/web/frontend/src/views/ApiKeysView.tsx
index 68e8acd2c1..961a2f1f9e 100644
--- a/jarvis/ui/web/frontend/src/views/ApiKeysView.tsx
+++ b/jarvis/ui/web/frontend/src/views/ApiKeysView.tsx
@@ -382,7 +382,9 @@ function EngineModeSwitch({
</p>
</div>
- <RecommendedSetupPanel onOpenTab={onOpenRecommendedTab} />
+ {mode === "realtime" && (
+ <RecommendedSetupPanel onOpenTab={onOpenRecommendedTab} />
+ )}
<div className="shrink-0">
{/* Two equal segments over one sliding thumb: the thumb tracks the
@@ -499,15 +501,18 @@ function EngineModeSwitch({
}
/**
- * The maintainer's personal pick for the three provider slots users ask about
- * most, shown in the voice-engine header band where it is visible in BOTH tab
- * sets. Same contract as the per-card "Recommended" badges fed by
- * provider_spec.py: a presentation hint only — it never gates behavior and
- * never branches a code path on a provider name (AP-21). Each row is a button
- * that jumps straight to the tab it names, so the guidance sits one click
- * from the place it applies. The rows carry an explicit aria-label starting
- * with the panel title so their accessible names never collide with the
- * Pipeline|Realtime segment buttons (tests match those via /^realtime/i).
+ * The maintainer's personal pick for the three provider slots of the REALTIME
+ * tab set, shown in the voice-engine header band only while that tab set is
+ * being viewed — the picks name Realtime-mode tabs, so surfacing them next to
+ * the Pipeline tabs would point at tabs that are not even on screen
+ * (maintainer feedback 2026-07-17). Same contract as the per-card
+ * "Recommended" badges fed by provider_spec.py: a presentation hint only — it
+ * never gates behavior and never branches a code path on a provider name
+ * (AP-21). Each row is a button that jumps straight to the tab it names, so
+ * the guidance sits one click from the place it applies. The rows carry an
+ * explicit aria-label starting with the panel title so their accessible names
+ * never collide with the Pipeline|Realtime segment buttons (tests match those
+ * via /^realtime/i).
*/
function RecommendedSetupPanel({
onOpenTab,
@@ -561,6 +566,7 @@ function RecommendedSetupPanel({
<button
type="button"
onClick={() => onOpenTab(row.tab)}
+ data-testid={`reco-row-${row.tab}`}
aria-label={`${t("apikeys_view.reco_title")}: ${row.label} — ${row.pick}`}
className="flex w-full items-start gap-2 rounded-lg px-1.5 py-1 text-left text-xs leading-snug transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
@@ -1135,6 +1141,7 @@ function ProviderCard({
const t = useT();
const [activating, setActivating] = useState(false);
const pushToast = useEventStore((s) => s.pushToast);
+ const assistantName = useEventStore((s) => s.assistantName);
// The card only escalates to red for a real "set up but failing" error — the
// amber "needs setup" case stays on the tab + the open/ready badge so a fresh,
// half-configured screen doesn't paint cards red.
@@ -1153,7 +1160,10 @@ function ProviderCard({
async function activate(assumeConfigured = false) {
if (descriptor.active) return;
if (!isBrainSwitchable) {
- pushToast("warning", `${descriptor.label} is only available for Jarvis-Agents.`);
+ pushToast(
+ "warning",
+ `${descriptor.label} is only available for ${agentsBrand(assistantName)}.`,
+ );
return;
}
if (isCodex && !descriptor.codex_brain_ready) {
@@ -1266,7 +1276,7 @@ function ProviderCard({
descriptor.active
? t("apikeys_view.active_tooltip")
: !isBrainSwitchable
- ? "Available for Jarvis-Agents only"
+ ? `Available for ${agentsBrand(assistantName)} only`
: descriptor.configured
? t("apikeys_view.click_to_activate")
: descriptor.auth_mode === "codex"
@@ -1345,7 +1355,7 @@ function ProviderCard({
disabled={!isBrainSwitchable || (isCodex && !descriptor.codex_brain_ready)}
disabledReason={
!isBrainSwitchable
- ? "Available for Jarvis-Agents only"
+ ? `Available for ${agentsBrand(assistantName)} only`
: isCodex && !descriptor.codex_brain_ready
? t("apikeys_codex.brain_needs_openai_key")
: undefined
@@ -1378,7 +1388,7 @@ function ProviderCard({
{!isBrainSwitchable && (
<p className="rounded-md border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-[11px] leading-relaxed text-amber-700">
- Jarvis-Agent only. This provider cannot be used as the main Brain or
+ {agentBrand(assistantName)} only. This provider cannot be used as the main Brain or
Computer-Use planner because it does not receive screenshots.
</p>
)}