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(ui): hide main sidebar in settings by default (#183)

Ruben Lütkecbcc2887137d
diff --git a/jarvis/ui/web/frontend/src/App.detached.test.tsx b/jarvis/ui/web/frontend/src/App.detached.test.tsx
index d04bc715bb..f77d725696 100644
--- a/jarvis/ui/web/frontend/src/App.detached.test.tsx
+++ b/jarvis/ui/web/frontend/src/App.detached.test.tsx
@@ -1,4 +1,4 @@
-import { cleanup, render, screen } from "@testing-library/react";
+import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import App from "@/App";
@@ -37,7 +37,12 @@ vi.mock("@/components/layout/PaneResizer", () => ({
PaneResizer: () => <div data-testid="sidebar-resizer" />,
}));
vi.mock("@/components/layout/TopBar", () => ({
- TopBar: () => <div data-testid="topbar" />,
+ TopBar: ({ settingsNavigation }: { settingsNavigation?: { open: boolean; onToggle: () => void } }) => (
+ <div data-testid="topbar">
+ {settingsNavigation && <button data-testid="settings-sidebar-toggle" onClick={settingsNavigation.onToggle}
+ aria-expanded={settingsNavigation.open}>Toggle navigation</button>}
+ </div>
+ ),
}));
vi.mock("@/components/layout/MainView", () => ({
MainView: () => <div data-testid="main-view" />,
@@ -85,6 +90,27 @@ afterEach(() => {
});
describe("App shell around detached coding views", () => {
+ it("hides the main sidebar on each Settings visit and lets it be reopened", () => {
+ render(<App />);
+ expect(screen.getByTestId("sidebar")).toBeTruthy();
+
+ act(() => useEventStore.setState({ activeSection: "profile" }));
+ expect(screen.queryByTestId("sidebar")).toBeNull();
+ expect(screen.queryByTestId("sidebar-resizer")).toBeNull();
+ const toggle = screen.getByTestId("settings-sidebar-toggle");
+ expect(toggle.getAttribute("aria-expanded")).toBe("false");
+
+ fireEvent.click(toggle);
+ expect(screen.getByTestId("sidebar")).toBeTruthy();
+ expect(toggle.getAttribute("aria-expanded")).toBe("true");
+ act(() => useEventStore.setState({ activeSection: "apikeys" }));
+ expect(screen.getByTestId("sidebar")).toBeTruthy();
+
+ act(() => useEventStore.setState({ activeSection: "tasks" }));
+ act(() => useEventStore.setState({ activeSection: "profile" }));
+ expect(screen.queryByTestId("sidebar")).toBeNull();
+ });
+
it("renders the desktop wallpaper behind normal app sections", () => {
render(<App />);
diff --git a/jarvis/ui/web/frontend/src/App.tsx b/jarvis/ui/web/frontend/src/App.tsx
index ce56420a59..5673294bc0 100644
--- a/jarvis/ui/web/frontend/src/App.tsx
+++ b/jarvis/ui/web/frontend/src/App.tsx
@@ -17,6 +17,7 @@ import {
SIDEBAR_WIDTH_STORAGE_KEY,
} from "@/components/layout/Sidebar";
import { PaneResizer } from "@/components/layout/PaneResizer";
+import { SETTINGS_HUB_IDS } from "@/components/layout/navGroups";
import { useResizablePane } from "@/hooks/useResizablePane";
import { TopBar } from "@/components/layout/TopBar";
import { PermissionsAlertBanner } from "@/components/layout/PermissionsAlertBanner";
@@ -276,7 +277,16 @@ export default function App() {
const activeSection = useEventStore((s) => s.activeSection);
const agentsNavOpen = useSocietyShell((s) => s.navigationOpen);
const toggleAgentsNav = useSocietyShell((s) => s.toggleNavigation);
- const hideNavigation = activeSection === "agents" && !agentsNavOpen;
+ const settingsHubActive = SETTINGS_HUB_IDS.includes(activeSection);
+ const [settingsSidebarOpen, setSettingsSidebarOpen] = useState(false);
+ // Each visit to the Settings hub starts with its own navigation as the only
+ // left column. Switching tabs inside the hub preserves a deliberate reveal.
+ useEffect(() => {
+ if (!settingsHubActive) setSettingsSidebarOpen(false);
+ }, [settingsHubActive]);
+ const hideNavigation =
+ (activeSection === "agents" && !agentsNavOpen) ||
+ (settingsHubActive && !settingsSidebarOpen);
const solo = useEventStore((s) => s.solo);
const detachedViews = useEventStore((s) => s.detachedViews);
@@ -338,8 +348,8 @@ export default function App() {
{!hideNavigation && <>
<Sidebar
width={sidebar.size}
- collapsed={activeSection === "agents" ? false : navCollapsed}
- onToggleCollapsed={activeSection === "agents" ? toggleAgentsNav : toggleNav}
+ collapsed={activeSection === "agents" || settingsHubActive ? false : navCollapsed}
+ onToggleCollapsed={activeSection === "agents" ? toggleAgentsNav : settingsHubActive ? () => setSettingsSidebarOpen(false) : toggleNav}
/>
<PaneResizer
@@ -377,7 +387,10 @@ export default function App() {
it is the same class of problem: an OS-level gate the user must be
told about, since nothing else reports it. */}
<InputIsolationBanner />
- <TopBar />
+ <TopBar settingsNavigation={settingsHubActive ? {
+ open: settingsSidebarOpen,
+ onToggle: () => setSettingsSidebarOpen((open) => !open),
+ } : undefined} />
<VoiceWarmingBanner />
{/* The one-time "all lights green" note — the first time every
section of the active voice mode answers. Never again after. */}
diff --git a/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx b/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx
index d76a28f7c6..9445cce0fb 100644
--- a/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/TopBar.test.tsx
@@ -25,6 +25,18 @@ beforeEach(() => {
afterEach(() => vi.restoreAllMocks());
describe("TopBar detach button", () => {
+ it("offers the Settings navigation toggle with its current state", () => {
+ useEventStore.setState({ activeSection: "profile" });
+ const onToggle = vi.fn();
+ const { rerender } = render(<TopBar settingsNavigation={{ open: false, onToggle }} />);
+ const toggle = screen.getByTestId("settings-sidebar-toggle");
+ expect(toggle.getAttribute("aria-expanded")).toBe("false");
+ fireEvent.click(toggle);
+ expect(onToggle).toHaveBeenCalledOnce();
+ rerender(<TopBar settingsNavigation={{ open: true, onToggle }} />);
+ expect(toggle.getAttribute("aria-expanded")).toBe("true");
+ });
+
it("offers 'own window' on the detachable sections only", () => {
render(<TopBar />);
expect(screen.getByTestId("detach-view-button")).toBeTruthy();
diff --git a/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx b/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx
index 3475ea0e31..93051fa6a2 100644
--- a/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx
+++ b/jarvis/ui/web/frontend/src/components/layout/TopBar.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState } from "react";
-import { AppWindow, Download, RotateCw } from "lucide-react";
+import { AppWindow, Download, PanelLeftClose, PanelLeftOpen, RotateCw } from "lucide-react";
import { useEventStore, type SectionId } from "@/store/events";
import { NAV_FOOTER_ITEMS, NAV_GROUPS, resolveNavLabel } from "@/components/layout/navGroups";
@@ -98,7 +98,10 @@ function useViewTitle(activeSection: SectionId): string {
return item ? resolveNavLabel(t, item) : "";
}
-export function TopBar() {
+export function TopBar({ settingsNavigation }: {
+ settingsNavigation?: { open: boolean; onToggle: () => void };
+} = {}) {
+ const t = useT();
const activeSection = useEventStore((s) => s.activeSection);
const solo = useEventStore((s) => s.solo);
const detachedViews = useEventStore((s) => s.detachedViews);
@@ -142,6 +145,19 @@ export function TopBar() {
// app-chrome actions.
<div className="jarvis-shell-surface flex h-12 shrink-0 items-center gap-2 border-b border-border px-4">
<div className="mr-auto flex min-w-0 items-center gap-3">
+ {settingsNavigation && (
+ <button
+ type="button"
+ data-testid="settings-sidebar-toggle"
+ onClick={settingsNavigation.onToggle}
+ aria-expanded={settingsNavigation.open}
+ aria-label={t(settingsNavigation.open ? "sidebar.collapse" : "sidebar.expand")}
+ title={t(settingsNavigation.open ? "sidebar.collapse" : "sidebar.expand")}
+ className="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {settingsNavigation.open ? <PanelLeftClose className="h-4 w-4" aria-hidden /> : <PanelLeftOpen className="h-4 w-4" aria-hidden />}
+ </button>
+ )}
{viewTitle && (
<span
data-testid="topbar-view-title"
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index e182f60526..0813b4bf30 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -2247,6 +2247,11 @@
"settings_hub": {
"subtitle": "Alles über dich, deine Schlüssel und diese App — an einem Ort.",
"search_placeholder": "Einstellungen durchsuchen...",
+ "back_to_app": "Zurück zur App",
+ "search_results": "Einstellungsoptionen",
+ "search_pages": "Einstellungsseiten",
+ "no_results": "Keine Einstellungen gefunden",
+ "clear_search": "Suche löschen",
"group_general": "Allgemein",
"group_system": "System",
"group_activity": "Aktivität"
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index aaa3b01345..b2aada5b73 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -2280,6 +2280,11 @@
"settings_hub": {
"subtitle": "Everything about you, your keys and this app — in one place.",
"search_placeholder": "Search settings...",
+ "back_to_app": "Back to app",
+ "search_results": "Settings options",
+ "search_pages": "Settings pages",
+ "no_results": "No settings found",
+ "clear_search": "Clear search",
"group_general": "General",
"group_system": "System",
"group_activity": "Activity"
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 63190b01f7..237d663f43 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -2247,6 +2247,11 @@
"settings_hub": {
"subtitle": "Todo sobre ti, tus claves y esta aplicación, en un lugar.",
"search_placeholder": "Buscar ajustes...",
+ "back_to_app": "Volver a la aplicación",
+ "search_results": "Opciones de ajustes",
+ "search_pages": "Páginas de ajustes",
+ "no_results": "No se encontraron ajustes",
+ "clear_search": "Borrar búsqueda",
"group_general": "General",
"group_system": "Sistema",
"group_activity": "Actividad"
diff --git a/jarvis/ui/web/frontend/src/views/SettingsHubView.test.tsx b/jarvis/ui/web/frontend/src/views/SettingsHubView.test.tsx
index 9c24ca1cff..e06f0d55c3 100644
--- a/jarvis/ui/web/frontend/src/views/SettingsHubView.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/SettingsHubView.test.tsx
@@ -25,6 +25,7 @@ vi.mock("@/i18n", () => ({
// Identity translator: labels resolve to their keys (or the English
// fallback where the nav item defines one), so assertions match keys.
useT: () => (key: string) => key,
+ useUiLanguage: () => "en",
}));
vi.mock("@/hooks/useProviders", async (importOriginal) => {
@@ -62,7 +63,11 @@ function stub(testid: string) {
return () => <div data-testid={testid}>{testid}</div>;
}
-vi.mock("@/views/SettingsView", () => ({ SettingsView: stub("TAB_SETTINGS") }));
+vi.mock("@/views/SettingsView", () => ({
+ SettingsView: ({ searchTarget }: { searchTarget?: string }) => (
+ <div data-testid="TAB_SETTINGS" data-search-target={searchTarget} />
+ ),
+}));
vi.mock("@/views/ProfileView", () => ({ ProfileView: stub("TAB_PROFILE") }));
vi.mock("@/views/AgentInstructionsView", () => ({
AgentInstructionsView: stub("TAB_INSTRUCTIONS"),
@@ -111,6 +116,14 @@ afterEach(() => {
});
describe("SettingsHubView header and navigation", () => {
+ it("separates the navigation from the content and returns to the app", async () => {
+ render(<SettingsHubView />);
+ await screen.findByTestId("TAB_SETTINGS");
+ expect(screen.getByTestId("settings-hub-sidebar").className).toContain("bg-sidebar");
+ fireEvent.click(screen.getByRole("button", { name: "settings_hub.back_to_app" }));
+ expect(mockState.setActiveSection).toHaveBeenCalledWith("chats");
+ });
+
it("renders exactly one header titled from nav.settings", async () => {
render(<SettingsHubView />);
@@ -201,6 +214,39 @@ describe("SettingsHubView tab resolution", () => {
});
describe("SettingsHubView search", () => {
+ it("finds a field on another Settings page", async () => {
+ render(<SettingsHubView />);
+ await screen.findByTestId("TAB_SETTINGS");
+ fireEvent.change(screen.getByPlaceholderText("settings_hub.search_placeholder"), {
+ target: { value: "What is it?" },
+ });
+ fireEvent.click(screen.getByTestId("settings-hub-page-feedback"));
+ expect(mockState.setActiveSection).toHaveBeenCalledWith("feedback");
+ });
+
+ it("finds an option inside Settings and opens its group", async () => {
+ render(<SettingsHubView />);
+ await screen.findByTestId("TAB_SETTINGS");
+
+ fireEvent.change(screen.getByPlaceholderText("settings_hub.search_placeholder"), {
+ target: { value: "Microphone" },
+ });
+ fireEvent.click(screen.getByTestId("settings-hub-option-audio-devices"));
+
+ expect(mockState.setActiveSection).toHaveBeenCalledWith("settings");
+ expect(screen.getByTestId("TAB_SETTINGS").getAttribute("data-search-target"))
+ .toBe("audio-devices");
+ });
+
+ it("reports when neither pages nor options match", async () => {
+ render(<SettingsHubView />);
+ await screen.findByTestId("TAB_SETTINGS");
+ fireEvent.change(screen.getByPlaceholderText("settings_hub.search_placeholder"), {
+ target: { value: "zzz-unmatched-setting" },
+ });
+ expect(screen.getByRole("status").textContent).toBe("settings_hub.no_results");
+ });
+
it("filters the nav entries by label", async () => {
mockState.activeSection = "settings";
render(<SettingsHubView />);
diff --git a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
index 9cbdba487e..55c9c83c51 100644
--- a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
+++ b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
@@ -1,16 +1,16 @@
import { lazy, Suspense, useMemo, useState, type ComponentType, type LazyExoticComponent } from "react";
-import { Loader2, Settings as SettingsIcon } from "lucide-react";
+import { ArrowLeft, Loader2, Search, Settings as SettingsIcon, X } from "lucide-react";
import {
NAV_FOOTER_ITEMS,
NAV_GROUPS,
resolveNavLabel,
type NavItem,
} from "@/components/layout/navGroups";
-import { InlineSearch } from "@/components/extensions/primitives";
import { useEventStore } from "@/store/events";
import { useSectionHealth } from "@/hooks/useProviders";
-import { useT } from "@/i18n";
+import { useT, useUiLanguage } from "@/i18n";
import { ViewHeader } from "@/views/ChatsView";
+import { searchSettingsOptions, searchSettingsPages } from "@/views/settings/settingsSearch";
import { cn } from "@/lib/utils";
/**
@@ -187,9 +187,11 @@ function HubLoadingFallback() {
export function SettingsHubView() {
const t = useT();
+ const language = useUiLanguage();
const active = useEventStore((s) => s.activeSection);
const setActive = useEventStore((s) => s.setActiveSection);
const [query, setQuery] = useState("");
+ const [searchTarget, setSearchTarget] = useState<string | null>(null);
const { health: sectionHealth } = useSectionHealth();
const { content, highlight } = resolveHubTab(active);
@@ -204,6 +206,11 @@ export function SettingsHubView() {
...group,
items: group.ids.map(findNavItem).filter(matches),
})).filter((group) => group.items.length > 0);
+ const optionMatches = searchSettingsOptions(language, query, t);
+ const pageMatches = searchSettingsPages(language, query, t)
+ .filter((match) => !visibleGroups.some((group) =>
+ group.items.some((item) => item.id === match.id)))
+ .map((match) => ({ ...match, label: resolveNavLabel(t, findNavItem(match.id)) }));
// The same two health signals the sidebar rows used to carry, now on the
// hub's own nav: a hard provider error on API Keys, a failing or
@@ -231,7 +238,11 @@ export function SettingsHubView() {
<button
type="button"
data-testid={`settings-hub-nav-${item.id}`}
- onClick={() => setActive(item.id)}
+ onClick={() => {
+ setQuery("");
+ setSearchTarget(null);
+ setActive(item.id);
+ }}
title={hint}
aria-current={isActive ? "page" : undefined}
className={cn(
@@ -271,46 +282,113 @@ export function SettingsHubView() {
};
return (
- <div data-testid="settings-hub" className="flex h-full flex-col">
- <ViewHeader
- icon={<SettingsIcon className="h-4 w-4 text-foreground" />}
- title={t("nav.settings")}
- subtitle={t("settings_hub.subtitle")}
- right={
- <div className="w-64 max-w-full">
- <InlineSearch
- value={query}
- onChange={setQuery}
+ <div data-testid="settings-hub" className="flex h-full min-h-0 flex-col md:flex-row">
+ <aside
+ data-testid="settings-hub-sidebar"
+ className="flex max-h-72 w-full shrink-0 flex-col border-b border-border bg-sidebar md:max-h-none md:w-72 md:border-b-0 md:border-r"
+ >
+ <div className="border-b border-border px-3 py-3">
+ <button type="button" onClick={() => setActive("chats")}
+ className="flex h-9 w-full items-center gap-2 rounded-md px-2 text-base font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <ArrowLeft className="h-4 w-4 shrink-0" aria-hidden />
+ {t("settings_hub.back_to_app")}
+ </button>
+ </div>
+ <div className="px-3 pb-2 pt-3">
+ <div className="relative">
+ <Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" aria-hidden />
+ <input type="text" role="searchbox" value={query} onChange={(event) => setQuery(event.target.value)}
+ onKeyDown={(event) => { if (event.key === "Escape") setQuery(""); }}
placeholder={t("settings_hub.search_placeholder")}
+ aria-label={t("settings_hub.search_placeholder")}
+ className="h-9 w-full rounded-md border border-border bg-input pl-9 pr-9 text-base text-foreground placeholder:text-foreground-faint focus:border-accent focus:outline-none focus:ring-2 focus:ring-ring"
/>
+ {query && <button type="button" onClick={() => setQuery("")}
+ aria-label={t("settings_hub.clear_search")}
+ className="absolute right-1 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <X className="h-4 w-4" aria-hidden />
+ </button>}
</div>
- }
- />
- <div className="flex min-h-0 flex-1 flex-col gap-4 px-8 pb-8 md:flex-row">
- <nav
- aria-label={t("nav.settings")}
- className="shrink-0 overflow-x-auto scrollbar-jarvis md:w-60 md:overflow-y-auto lg:w-64"
- >
- {/* Narrow screens stack the nav above the content as one horizontal
- strip; from `md` up it is the fixed left column of the page. */}
- <ul className="flex gap-1 md:flex-col md:gap-0">
+ </div>
+ <nav aria-label={t("nav.settings")}
+ className="min-h-0 flex-1 overflow-y-auto px-3 pb-5 scrollbar-jarvis">
+ <ul className="space-y-1">
{visibleGroups.map((group) => (
- <li key={group.labelKey} className="flex shrink-0 gap-1 md:block md:shrink md:gap-0">
- <p className="hidden px-3 pb-1 pt-4 text-sm font-medium uppercase tracking-wide text-foreground-faint md:block">
+ <li key={group.labelKey}>
+ <p className="px-3 pb-1 pt-4 text-sm font-medium uppercase tracking-wide text-foreground-faint">
{t(group.labelKey)}
</p>
- <ul className="flex gap-1 md:block md:space-y-0.5 md:gap-0">
- {group.items.map(renderNavItem)}
- </ul>
+ <ul className="space-y-0.5">{group.items.map(renderNavItem)}</ul>
</li>
))}
</ul>
+ {pageMatches.length > 0 && (
+ <div data-testid="settings-hub-page-results">
+ <p className="px-3 pb-1 pt-5 text-sm font-medium uppercase tracking-wide text-foreground-faint">
+ {t("settings_hub.search_pages")}
+ </p>
+ <ul className="space-y-0.5">
+ {pageMatches.map((match) => (
+ <li key={match.id}>
+ <button type="button" data-testid={`settings-hub-page-${match.id}`}
+ onClick={() => {
+ setSearchTarget(null);
+ setQuery("");
+ setActive(match.id);
+ }}
+ className="flex w-full flex-col rounded-md px-3 py-2 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <span className="text-base font-medium text-foreground">{match.label}</span>
+ {match.detail && <span className="w-full truncate text-sm text-muted-foreground" title={match.detail}>{match.detail}</span>}
+ </button>
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ {optionMatches.length > 0 && (
+ <div data-testid="settings-hub-option-results">
+ <p className="px-3 pb-1 pt-5 text-sm font-medium uppercase tracking-wide text-foreground-faint">
+ {t("settings_hub.search_results")}
+ </p>
+ <ul className="space-y-0.5">
+ {optionMatches.map((match) => (
+ <li key={match.id}>
+ <button type="button" data-testid={`settings-hub-option-${match.id}`}
+ onClick={() => {
+ setSearchTarget(match.id);
+ setQuery("");
+ setActive("settings");
+ }}
+ className="flex w-full flex-col rounded-md px-3 py-2 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
+ <span className="text-base font-medium text-foreground">{match.label}</span>
+ {match.detail && <span className="w-full truncate text-sm text-muted-foreground" title={match.detail}>{match.detail}</span>}
+ </button>
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ {needle && visibleGroups.length === 0 && pageMatches.length === 0 && optionMatches.length === 0 && (
+ <p role="status" className="px-3 py-5 text-base text-muted-foreground">
+ {t("settings_hub.no_results")}
+ </p>
+ )}
</nav>
- <div
- data-testid="settings-hub-content"
- className="min-h-0 flex-1 overflow-y-auto scrollbar-jarvis"
- >
- <Suspense fallback={<HubLoadingFallback />}>{<Content />}</Suspense>
+ </aside>
+ <div className="flex min-h-0 min-w-0 flex-1 flex-col">
+ <ViewHeader
+ icon={<SettingsIcon className="h-4 w-4 text-foreground" />}
+ title={t("nav.settings")}
+ subtitle={t("settings_hub.subtitle")}
+ />
+ <div data-testid="settings-hub-content" className="min-h-0 flex-1 overflow-y-auto scrollbar-jarvis">
+ <div className="h-full w-full max-w-[2000px]">
+ <Suspense fallback={<HubLoadingFallback />}>
+ {content === "settings"
+ ? <SettingsTab searchTarget={searchTarget} onSearchTargetHandled={() => setSearchTarget(null)} />
+ : <Content />}
+ </Suspense>
+ </div>
</div>
</div>
</div>
diff --git a/jarvis/ui/web/frontend/src/views/SettingsView.tsx b/jarvis/ui/web/frontend/src/views/SettingsView.tsx
index 6a40711cc5..5ed69cfcef 100644
--- a/jarvis/ui/web/frontend/src/views/SettingsView.tsx
+++ b/jarvis/ui/web/frontend/src/views/SettingsView.tsx
@@ -72,7 +72,10 @@ interface SettingRow {
value?: string;
}
-export function SettingsView() {
+export function SettingsView({ searchTarget, onSearchTargetHandled }: {
+ searchTarget?: string | null;
+ onSearchTargetHandled?: () => void;
+} = {}) {
const t = useT();
const scrollRef = useRef<HTMLDivElement>(null);
const [activeSection, setActiveSection] = useState<string>(SECTIONS[0].id);
@@ -105,6 +108,14 @@ export function SettingsView() {
document.getElementById(`settings-${id}`)?.scrollIntoView({ block: "start", behavior: "smooth" });
}, []);
+ useEffect(() => {
+ if (!searchTarget) return;
+ const target = document.getElementById(`settings-${searchTarget}`);
+ if (!target) return;
+ target.scrollIntoView?.({ block: "start", behavior: "smooth" });
+ onSearchTargetHandled?.();
+ }, [searchTarget, onSearchTargetHandled]);
+
return (
<div className="flex h-full min-h-0 flex-col">
<div className="px-8">
diff --git a/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx
index 5ba9ce1846..451c094c9a 100644
--- a/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx
@@ -109,6 +109,38 @@ describe("SettingsGroupBoundary", () => {
});
describe("SettingsView against an empty backend", () => {
+ it("scrolls to a searched settings group after the view mounts", async () => {
+ vi.stubGlobal("fetch", vi.fn(async () => ({
+ ok: true,
+ status: 200,
+ json: async () => ({}),
+ text: async () => "{}",
+ }) as Response));
+ vi.spyOn(console, "error").mockImplementation(() => {});
+ const scrollIntoView = vi.fn();
+ const previous = HTMLElement.prototype.scrollIntoView;
+ Object.defineProperty(HTMLElement.prototype, "scrollIntoView", {
+ configurable: true,
+ value: scrollIntoView,
+ });
+ const handled = vi.fn();
+
+ try {
+ render(wrap(<SettingsView searchTarget="audio-devices" onSearchTargetHandled={handled} />));
+ await waitFor(() => expect(scrollIntoView).toHaveBeenCalledOnce());
+ expect(handled).toHaveBeenCalledOnce();
+ } finally {
+ if (previous) {
+ Object.defineProperty(HTMLElement.prototype, "scrollIntoView", {
+ configurable: true,
+ value: previous,
+ });
+ } else {
+ delete (HTMLElement.prototype as { scrollIntoView?: unknown }).scrollIntoView;
+ }
+ }
+ });
+
it("renders the whole page when every route answers {}", async () => {
// The shape no group expects — the worst case of a version skew.
vi.stubGlobal(
diff --git a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.test.ts b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.test.ts
new file mode 100644
index 0000000000..f8b1319021
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from "vitest";
+import { searchSettingsOptions, searchSettingsPages } from "./settingsSearch";
+
+const translate = (key: string) => key;
+
+describe("searchSettingsOptions", () => {
+ it("finds labels inside a Settings group", () => {
+ const matches = searchSettingsOptions("en", "microphone", translate);
+ expect(matches.some((match) => match.id === "audio-devices" && match.detail === "Microphone"))
+ .toBe(true);
+ });
+
+ it("finds localized options in the selected UI language", () => {
+ const matches = searchSettingsOptions("de", "Denkpause", translate);
+ expect(matches.some((match) => match.id === "silence-window")).toBe(true);
+ });
+
+ it("finds a field in another Settings page", () => {
+ const matches = searchSettingsPages("en", "What is it?", translate);
+ expect(matches.some((match) => match.id === "feedback")).toBe(true);
+ });
+
+ it("ignores empty queries", () => {
+ expect(searchSettingsOptions("en", " ", translate)).toEqual([]);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts
new file mode 100644
index 0000000000..a2d0dc3a44
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts
@@ -0,0 +1,106 @@
+import en from "@/i18n/locales/en.json";
+import de from "@/i18n/locales/de.json";
+import es from "@/i18n/locales/es.json";
+import type { UiLanguage } from "@/i18n";
+
+type LocaleTree = Record<string, unknown>;
+
+const LOCALES: Record<UiLanguage, LocaleTree> = { en, de, es };
+
+/** Each Settings page group owns the copy used to search its controls. */
+const SEARCH_GROUPS = [
+ { id: "languages", keys: ["language", "languages_group_title"] },
+ { id: "app", keys: ["app_settings_group_title", "autostart", "appearance", "jarvis_api"] },
+ { id: "permissions", keys: ["nav.permissions"] },
+ { id: "screen-context", keys: ["screen_context"] },
+ { id: "realtime-voice", keys: ["realtime_voice"] },
+ { id: "system-prompt", keys: ["system_prompt"] },
+ { id: "wake-word", keys: ["wake_word"] },
+ { id: "silence-window", keys: ["silence_window"] },
+ { id: "volume", keys: ["volume"] },
+ { id: "audio-devices", keys: ["audio_devices"] },
+ { id: "music", keys: ["music", "music_group_title"] },
+ { id: "keybinds", keys: ["keybinds"] },
+ { id: "more", keys: ["rows", "team_proxy", "codex_title", "safety_title"] },
+ { id: "overlay-taskbar", keys: ["overlay_style", "bar_size", "overlay_taskbar_group_title"] },
+] as const;
+
+const SEARCH_PAGES = [
+ { id: "profile", keys: ["profile_view"] },
+ { id: "agent-instructions", keys: ["agent_instructions"] },
+ { id: "contacts", keys: ["contacts"] },
+ { id: "socials", keys: ["socials"] },
+ { id: "apikeys", keys: ["apikeys_view", "apikeys_voice", "apikeys_model", "apikeys_cu_model"] },
+ { id: "wallpaper", keys: ["home.background_label", "home.background_hint"] },
+ { id: "costs", keys: ["costs_view"] },
+ { id: "feedback", keys: ["feedback"] },
+] as const;
+
+export interface SettingsOptionMatch {
+ id: string;
+ label: string;
+ detail?: string;
+}
+
+function normalize(value: string): string {
+ return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
+}
+
+function atPath(tree: LocaleTree, path: string): unknown {
+ return path.split(".").reduce<unknown>((node, part) =>
+ node && typeof node === "object" ? (node as LocaleTree)[part] : undefined, tree);
+}
+
+function stringsIn(node: unknown): string[] {
+ if (typeof node === "string") return [node];
+ if (!node || typeof node !== "object") return [];
+ return Object.values(node).flatMap(stringsIn);
+}
+
+function matchingCopy(tree: LocaleTree, keys: readonly string[], needle: string): string[] {
+ return keys.flatMap((key) => stringsIn(atPath(tree, key)))
+ .filter((value) => normalize(value).includes(needle));
+}
+
+function shortDetail(matches: string[], label: string): string | undefined {
+ const detail = matches.filter((value) => value !== label)
+ .sort((a, b) => a.length - b.length)[0];
+ return detail && detail.length <= 100 ? detail : undefined;
+}
+
+/** Search localized option copy, not just the ten Settings tab names. */
+export function searchSettingsOptions(
+ language: UiLanguage,
+ query: string,
+ translate: (key: string) => string,
+): SettingsOptionMatch[] {
+ const needle = normalize(query.trim());
+ if (!needle) return [];
+ const settings = atPath(LOCALES[language], "settings_view") as LocaleTree;
+
+ return SEARCH_GROUPS.flatMap(({ id, keys }) => {
+ const label = translate(`settings_view.nav.${id.replaceAll("-", "_")}`);
+ const matches = matchingCopy(settings, keys, needle);
+ if (!normalize(label).includes(needle) && matches.length === 0) return [];
+ // Prefer a control label to a long explanation or a saved-state toast.
+ return [{ id, label, detail: shortDetail(matches, label) }];
+ });
+}
+
+/** Search the other Settings pages' localized field copy. */
+export function searchSettingsPages(
+ language: UiLanguage,
+ query: string,
+ translate: (key: string) => string,
+) {
+ const needle = normalize(query.trim());
+ if (!needle) return [];
+ const locale = LOCALES[language];
+
+ return SEARCH_PAGES.flatMap(({ id, keys }) => {
+ const label = translate(`nav.${id === "agent-instructions" ? "agent_instructions" : id}`);
+ const matches = matchingCopy(locale, keys, needle);
+ if (!normalize(label).includes(needle) && matches.length === 0) return [];
+ return [{ id, label, detail: shortDetail(matches, label) }];
+ });
+}