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(sidebar): the front-page row says Voice or Chat, whichever the switch picked

rubenluetke10-beepc8a607162ff2
diff --git a/jarvis/ui/web/frontend/src/components/layout/DockRail.tsx b/jarvis/ui/web/frontend/src/components/layout/DockRail.tsx
index fdc398b905..e611ad669d 100644
--- a/jarvis/ui/web/frontend/src/components/layout/DockRail.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/DockRail.tsx
@@ -8,7 +8,13 @@ import {
useTransform,
} from "framer-motion";
import { useEventStore, type SectionId } from "@/store/events";
-import { NAV_GROUPS, resolveNavLabel, type NavItem } from "@/components/layout/navGroups";
+import {
+ NAV_GROUPS,
+ presentNavItem,
+ resolveNavLabel,
+ type NavItem,
+} from "@/components/layout/navGroups";
+import { useHomeStore } from "@/store/home";
import { useSectionHealth } from "@/hooks/useProviders";
import { usePluginAttention } from "@/hooks/usePluginAttention";
import { dockSlotAt, layoutDock } from "@/lib/dockMagnify";
@@ -67,7 +73,14 @@ export function DockRail({ className }: { className?: string }) {
const pluginAttention = usePluginAttention();
const reduced = useReducedMotion() ?? false;
- const items = useMemo(() => NAV_GROUPS.flat(), []);
+ // The front page's icon follows the Voice | Chat switch like the sidebar
+ // row does (`presentNavItem`); the rail must not say "Chats" while the
+ // expanded sidebar says "Voice".
+ const surface = useHomeStore((s) => s.surface);
+ const items = useMemo(
+ () => NAV_GROUPS.flat().map((item) => presentNavItem(item, surface)),
+ [surface],
+ );
const groupBreaks = useMemo(() => {
// Index of the first item of every group after the first — a hairline is
// drawn above these so the rail keeps the sidebar's grouping.
diff --git a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
index 61aed88694..258d720ea4 100644
--- a/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/Sidebar.tsx
@@ -7,6 +7,7 @@ import {
} from "lucide-react";
import {
NAV_GROUPS,
+ presentNavItem,
resolveNavLabel,
type NavItem,
} from "@/components/layout/navGroups";
@@ -110,6 +111,9 @@ export function Sidebar({
// thread — the sidebar owns the history now, so it owns this too.
const { newChat } = useConversations();
const setSurface = useHomeStore((s) => s.setSurface);
+ // The front page's nav row names the face the switch picked (Voice / Chat),
+ // see `presentNavItem`.
+ const surface = useHomeStore((s) => s.surface);
const startNewChat = () => {
newChat();
setSurface("chat");
@@ -344,28 +348,31 @@ export function Sidebar({
groupIndex > 0 && "mt-2 border-t border-border/40 pt-2",
)}
>
- {group.map((item) => (
- <NavRow
- key={item.id}
- item={item}
- label={resolveNavLabel(t, item)}
- active={item.matchIds ? item.matchIds.includes(active) : item.id === active}
- badge={item.id === "agents" ? agentsCount : undefined}
- betaLabel={item.beta ? t("nav.agentic_ide_beta") : undefined}
- alert={item.id === "apikeys" ? apikeysHasError : false}
- alertTitle={t("sidebar.apikeys_alert")}
- warn={item.id === "skills" ? pluginsNeedReconnect : false}
- warnTitle={pluginWarnTitle}
- // A plugin problem sends the "Skills & Tools" row straight into
- // the Plugins tab (where the banner + jump button are), so one
- // click lands on the fix instead of the default Skills tab.
- onClick={() =>
- setActive(
- item.id === "skills" && pluginsNeedReconnect ? "plugins" : item.id,
- )
- }
- />
- ))}
+ {group.map((raw) => {
+ const item = presentNavItem(raw, surface);
+ return (
+ <NavRow
+ key={item.id}
+ item={item}
+ label={resolveNavLabel(t, item)}
+ active={item.matchIds ? item.matchIds.includes(active) : item.id === active}
+ badge={item.id === "agents" ? agentsCount : undefined}
+ betaLabel={item.beta ? t("nav.agentic_ide_beta") : undefined}
+ alert={item.id === "apikeys" ? apikeysHasError : false}
+ alertTitle={t("sidebar.apikeys_alert")}
+ warn={item.id === "skills" ? pluginsNeedReconnect : false}
+ warnTitle={pluginWarnTitle}
+ // A plugin problem sends the "Skills & Tools" row straight into
+ // the Plugins tab (where the banner + jump button are), so one
+ // click lands on the fix instead of the default Skills tab.
+ onClick={() =>
+ setActive(
+ item.id === "skills" && pluginsNeedReconnect ? "plugins" : item.id,
+ )
+ }
+ />
+ );
+ })}
</ul>
))}
</nav>
diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts
new file mode 100644
index 0000000000..2dad879f8a
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.test.ts
@@ -0,0 +1,29 @@
+import { describe, expect, it } from "vitest";
+import { MessageSquare, Mic } from "lucide-react";
+
+import { NAV_GROUPS, presentNavItem } from "@/components/layout/navGroups";
+
+const chats = NAV_GROUPS.flat().find((i) => i.id === "chats")!;
+const agents = NAV_GROUPS.flat().find((i) => i.id === "agents")!;
+
+describe("presentNavItem", () => {
+ it("names the front page after the face the Voice | Chat switch picked", () => {
+ const voice = presentNavItem(chats, "voice");
+ expect(voice.labelKey).toBe("sidebar.surface_voice");
+ expect(voice.icon).toBe(Mic);
+
+ const chat = presentNavItem(chats, "chat");
+ expect(chat.labelKey).toBe("sidebar.surface_chat");
+ expect(chat.icon).toBe(MessageSquare);
+ });
+
+ it("keeps the section id so the row still lands on the front page", () => {
+ expect(presentNavItem(chats, "voice").id).toBe("chats");
+ expect(presentNavItem(chats, "chat").id).toBe("chats");
+ });
+
+ it("passes every other row through untouched", () => {
+ expect(presentNavItem(agents, "voice")).toBe(agents);
+ expect(presentNavItem(agents, "chat")).toBe(agents);
+ });
+});