The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): index every hand-built settings row in the command palette
brooklyn!11b0bccf845c
diff --git a/apps/desktop/src/app/command-palette/index.tsx b/apps/desktop/src/app/command-palette/index.tsxindex 695b1c8975f..3e5873b8d8c 100644--- a/apps/desktop/src/app/command-palette/index.tsx+++ b/apps/desktop/src/app/command-palette/index.tsx@@ -1245,7 +1245,7 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {const fieldItems = [...settingsCatalog.subpageEntries,- ...settingsCatalog.appearanceEntries,+ ...settingsCatalog.settingEntries,...settingsCatalog.configEntries].map(settingsEntryItem)@@ -1366,7 +1366,7 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {heading: cc.settingsFields,items: [...settingsCatalog.subpageEntries,- ...settingsCatalog.appearanceEntries,+ ...settingsCatalog.settingEntries,...settingsCatalog.configEntries].map(settingsEntryItem)})diff --git a/apps/desktop/src/app/settings/about-settings.tsx b/apps/desktop/src/app/settings/about-settings.tsxindex fda946eaa21..11947506511 100644--- a/apps/desktop/src/app/settings/about-settings.tsx+++ b/apps/desktop/src/app/settings/about-settings.tsx@@ -19,7 +19,9 @@ import {} from '@/store/updates'import { ListRow, SectionHeading, SettingsContent } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'import { UninstallSection } from './uninstall-section'+import { useSettingDeepLink } from './use-setting-deep-link'const RELEASE_NOTES_URL = 'https://github.com/NousResearch/hermes-agent/releases'const INSTALLER_URL = 'https://hermes-agent.nousresearch.com/'@@ -51,6 +53,8 @@ interface AboutSettingsProps {}export function AboutSettings({ subpage }: AboutSettingsProps = {}) {+ useSettingDeepLink('about', page => subpage === undefined || page === subpage)+if (subpage === 'uninstall') {return (<SettingsContent>@@ -243,6 +247,7 @@ function AppUpdatesSettings({ includeUninstall }: { includeUninstall: boolean })<ListRowdescription={a.automaticUpdatesDesc}hint={a.branchCommit(status?.branch ?? 'unknown', status?.currentSha?.slice(0, 7) ?? 'unknown')}+ id={settingElementId(SETTING_IDS.about.automaticUpdates)}title={a.automaticUpdates}/>diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsxindex 837cc46b544..c7f8a53f575 100644--- a/apps/desktop/src/app/settings/appearance-settings.tsx+++ b/apps/desktop/src/app/settings/appearance-settings.tsx@@ -73,15 +73,16 @@ import { $marketplaceInstalls, isUserTheme, removeUserTheme } from '@/themes/useimport { setHermesConfigCache, useHermesConfigRecord } from '../hooks/use-config-record'-import { APPEARANCE_SETTING_IDS, appearanceSubpageForSetting, type AppearanceSubpageId } from './appearance-subpages'+import type { AppearanceSubpageId } from './appearance-subpages'import { ChatFontSetting } from './chat-font-setting'import { MODE_OPTIONS } from './constants'import { setNested } from './helpers'import { MinimizeToTraySetting } from './minimize-to-tray-setting'import { PetSettings } from './pet-settings'import { ListRow, RowFootnoteAction, SectionHeading, SettingsContent, ToggleRow } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'import { TerminalFontSetting } from './terminal-font-setting'-import { useDeepLinkHighlight } from './use-deep-link-highlight'+import { useSettingDeepLink } from './use-setting-deep-link'// display.resume_last_session lives in the backend config record (shared with// config.yaml and the cold-start restore in use-desktop-integrations), not a@@ -121,7 +122,7 @@ function ResumeLastSessionSetting() {checked={checked}description={a.resumeLastSessionDesc}disabled={!config}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.resumeLastSession)}+ id={settingElementId(ids.resumeLastSession)}label={a.resumeLastSessionTitle}onChange={update}/>@@ -171,8 +172,7 @@ function ThemePreview({ name, mode }: { name: string; mode: 'light' | 'dark' })// presets highlights nothing, and the row description keeps showing the// exact current percent.const UI_SCALE_PRESETS = ['90', '100', '110', '125', '150', '175'] as const-const appearanceSettingElementId = (id: string) => `setting-field-${id}`-+const ids = SETTING_IDS.appearancetype UiScalePreset = (typeof UI_SCALE_PRESETS)[number]function matchUiScalePreset(percent: number): UiScalePreset | null {@@ -468,15 +468,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {const [query, setQuery] = useState('')const show = (id: AppearanceSubpageId) => subpage === undefined || subpage === id- useDeepLinkHighlight({- elementId: appearanceSettingElementId,- param: 'setting',- ready: id => {- const targetSubpage = appearanceSubpageForSetting(id)-- return targetSubpage !== undefined && show(targetSubpage)- }- })+ useSettingDeepLink('config:appearance', page => page !== undefined && show(page as AppearanceSubpageId))// One box does double duty: filter installed themes live (below), and run a// name search against the VS Code Marketplace (the Cmd-K "Install theme…"@@ -570,7 +562,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ListRowaction={<LanguageSwitcher />}description={isSavingLocale ? t.language.saving : t.language.description}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.language)}+ id={settingElementId(ids.language)}title={t.language.label}/>)}@@ -667,7 +659,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {</>}description={a.themeDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.theme)}+ id={settingElementId(ids.theme)}title={a.themeTitle}wide/>@@ -687,15 +679,15 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={a.uiScaleDesc(zoomPercent)}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.uiScale)}+ id={settingElementId(ids.uiScale)}title={a.uiScaleTitle}/>- <div id={appearanceSettingElementId('desktop.font_family')}>+ <div id={settingElementId(ids.chatFont)}><ChatFontSetting /></div>- <div id={appearanceSettingElementId('terminal.font_family')}>+ <div id={settingElementId(ids.terminalFont)}><TerminalFontSetting /></div></>@@ -714,7 +706,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={t.interfaceMode.hint}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.interfaceMode)}+ id={settingElementId(ids.interfaceMode)}title={t.interfaceMode.title}/>)}@@ -732,7 +724,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={a.sessionDensityDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.sessionDensity)}+ id={settingElementId(ids.sessionDensity)}title={a.sessionDensityTitle}/>)}@@ -750,7 +742,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={a.tabStripDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.tabStrip)}+ id={settingElementId(ids.tabStrip)}title={a.tabStripTitle}/>)}@@ -768,13 +760,13 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={a.appActionsDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.appActions)}+ id={settingElementId(ids.appActions)}title={a.appActionsTitle}/>)}{show('window-layout') && (- <div id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.minimizeToTray)}>+ <div id={settingElementId(ids.minimizeToTray)}><MinimizeToTraySetting /></div>)}@@ -858,7 +850,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {) : undefined}description={glassMode ? a.translucencyGlassDesc : a.translucencyDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.translucency)}+ id={settingElementId(ids.translucency)}title={a.translucencyTitle}/>)}@@ -878,7 +870,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {</div>}description={a.userBubbleDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.userBubble)}+ id={settingElementId(ids.userBubble)}title={a.userBubbleTitle}/>)}@@ -896,7 +888,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={a.textDirectionDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.textDirection)}+ id={settingElementId(ids.textDirection)}title={a.textDirectionTitle}/>)}@@ -905,7 +897,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={backdrop}description={a.backdropDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.backdrop)}+ id={settingElementId(ids.backdrop)}label={a.backdropTitle}onChange={setBackdrop}/>@@ -915,7 +907,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={hideThreadTimeline}description={a.hideThreadTimelineDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.hideThreadTimeline)}+ id={settingElementId(ids.hideThreadTimeline)}label={a.hideThreadTimelineTitle}onChange={setHideThreadTimeline}/>@@ -925,7 +917,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={introSplash}description={a.introSplashDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.introSplash)}+ id={settingElementId(ids.introSplash)}label={a.introSplashTitle}onChange={setIntroSplash}/>@@ -935,7 +927,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={composerPopoutGesturesEnabled}description={a.composerPopoutDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.composerPopout)}+ id={settingElementId(ids.composerPopout)}label={a.composerPopoutTitle}onChange={setComposerPopoutGesturesEnabled}/>@@ -947,7 +939,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={reactionsEnabled}description={a.reactionsDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.reactions)}+ id={settingElementId(ids.reactions)}label={a.reactionsTitle}onChange={setReactionsEnabled}/>@@ -962,7 +954,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {}checked={tipsEnabled}description={a.tipsDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.tips)}+ id={settingElementId(ids.tips)}label={a.tipsTitle}onChange={setTipsEnabled}/>@@ -972,7 +964,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={toursEnabled}description={a.toursDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.tours)}+ id={settingElementId(ids.tours)}label={a.toursTitle}onChange={setToursEnabled}/>@@ -982,7 +974,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={vibeHeartsEnabled}description={a.vibeHeartsDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.vibeHearts)}+ id={settingElementId(ids.vibeHearts)}label={a.vibeHeartsTitle}onChange={setVibeHeartsEnabled}/>@@ -1001,7 +993,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {/>}description={withModeNote(a.toolViewDesc, toolViewShadowed)}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.toolView)}+ id={settingElementId(ids.toolView)}title={a.toolViewTitle}/>)}@@ -1010,7 +1002,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={hideCodeDiffs}description={withModeNote(a.hideCodeDiffsDesc, hideCodeDiffsShadowed)}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.hideCodeDiffs)}+ id={settingElementId(ids.hideCodeDiffs)}label={a.hideCodeDiffsTitle}onChange={setHideCodeDiffs}/>@@ -1020,7 +1012,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {<ToggleRowchecked={reasoningCollapsedByDefault}description={withModeNote(a.reasoningCollapsedDesc, reasoningCollapsedShadowed)}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.reasoningCollapsed)}+ id={settingElementId(ids.reasoningCollapsed)}label={a.reasoningCollapsedTitle}onChange={setReasoningCollapsedByDefault}/>@@ -1046,7 +1038,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {)}description={a.embedsDesc}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.embeds)}+ id={settingElementId(ids.embeds)}title={a.embedsTitle}/>)}@@ -1054,10 +1046,7 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {</div>{show('pet') && (- <div- className={subpage === undefined ? 'mt-6' : undefined}- id={appearanceSettingElementId(APPEARANCE_SETTING_IDS.pet)}- >+ <div className={subpage === undefined ? 'mt-6' : undefined} id={settingElementId(ids.pet)}><PetSettings /></div>)}diff --git a/apps/desktop/src/app/settings/appearance-subpages.ts b/apps/desktop/src/app/settings/appearance-subpages.tsindex 390f41bd75a..6d8c1b48b90 100644--- a/apps/desktop/src/app/settings/appearance-subpages.ts+++ b/apps/desktop/src/app/settings/appearance-subpages.ts@@ -1,6 +1,3 @@-import type { Translations } from '@/i18n'-import { TRANSLUCENCY_SUPPORTED } from '@/store/translucency'-export const APPEARANCE_SUBPAGES = [{ id: 'general', labelKey: 'appearanceGeneral' },{ id: 'theme', labelKey: 'appearanceTheme' },@@ -11,178 +8,3 @@ export const APPEARANCE_SUBPAGES = [] as constexport type AppearanceSubpageId = (typeof APPEARANCE_SUBPAGES)[number]['id']--interface AppearanceSettingCopy {- description?: string- label: string-}--interface AppearanceSetting {- /** Rows that only exist on some platforms stay out of search, where a hit would scroll to nothing. */- available?: () => boolean- copy: (t: Translations) => AppearanceSettingCopy- keywords: readonly string[]- subpage: AppearanceSubpageId-}--type AppearanceCopy = Translations['settings']['appearance']-type TitledKey = { [K in keyof AppearanceCopy]: K extends `${infer Base}Title` ? Base : never }[keyof AppearanceCopy]--// Most rows read `<key>Title` / `<key>Desc` straight from the appearance-// catalog; a Desc that is a formatter (uiScale) is left to the row itself.-const appearanceCopy =- <K extends TitledKey>(key: K) =>- (t: Translations): AppearanceSettingCopy => {- const catalog: Record<string, unknown> = t.settings.appearance- const description = catalog[`${key}Desc`]-- return {- label: t.settings.appearance[`${key}Title`],- description: typeof description === 'string' ? description : undefined- }- }--/**- * The manifest of every hand-built Appearance row. A key becomes the row's- * deep-link id (`appearance.<kebab-case>`), its subpage routes that id, and its- * copy + keywords feed the command palette — so a row cannot exist without- * being searchable, and search cannot point at a row that is not there.- * Schema-driven rows (`desktop.font_family`) are indexed from the schema and- * only need a subpage here.- */-export const APPEARANCE_SETTINGS = {- language: {- subpage: 'general',- keywords: ['locale'],- copy: t => ({ label: t.language.label, description: t.language.description })- },- introSplash: {- subpage: 'general',- keywords: ['splash', 'wordmark', 'empty chat', 'new chat'],- copy: appearanceCopy('introSplash')- },- resumeLastSession: {- subpage: 'general',- keywords: ['resume', 'reopen', 'launch', 'startup', 'last chat', 'session'],- copy: appearanceCopy('resumeLastSession')- },- tips: {- subpage: 'general',- keywords: ['tips', 'hints', 'coach marks', 'onboarding', 'help'],- copy: appearanceCopy('tips')- },- tours: {- subpage: 'general',- keywords: ['tour', 'walkthrough', 'guide', 'onboarding', 'help'],- copy: appearanceCopy('tours')- },- theme: { subpage: 'theme', keywords: ['color mode', 'skin', 'light', 'dark'], copy: appearanceCopy('theme') },- uiScale: { subpage: 'typography', keywords: ['zoom', 'size'], copy: appearanceCopy('uiScale') },- interfaceMode: {- subpage: 'window-layout',- keywords: ['simple', 'advanced', 'mode', 'interface', 'chrome', 'minimal', 'focus'],- copy: t => ({ label: t.interfaceMode.title, description: t.interfaceMode.hint })- },- sessionDensity: {- subpage: 'window-layout',- keywords: ['sidebar', 'sessions', 'compact', 'comfortable', 'density'],- copy: appearanceCopy('sessionDensity')- },- tabStrip: { subpage: 'window-layout', keywords: ['tabs', 'tab bar', 'strip'], copy: appearanceCopy('tabStrip') },- appActions: {- subpage: 'window-layout',- keywords: ['titlebar', 'settings gear', 'layout', 'HUD', 'left', 'right', 'tabs'],- copy: appearanceCopy('appActions')- },- minimizeToTray: {- subpage: 'window-layout',- keywords: ['tray', 'background', 'minimize', 'dock', 'taskbar', 'menu bar'],- available: () => Boolean(window.hermesDesktop?.minimizeToTray),- copy: t => ({ label: t.settings.config.minimizeToTrayTitle, description: t.settings.config.minimizeToTrayDesc })- },- translucency: {- subpage: 'window-layout',- keywords: ['opacity', 'transparent', 'glass', 'blur'],- available: () => TRANSLUCENCY_SUPPORTED,- copy: appearanceCopy('translucency')- },- backdrop: { subpage: 'window-layout', keywords: ['background', 'blur'], copy: appearanceCopy('backdrop') },- composerPopout: {- subpage: 'window-layout',- keywords: ['composer', 'floating', 'drag', 'popout', 'dock', 'input'],- copy: appearanceCopy('composerPopout')- },- userBubble: {- subpage: 'chat-display',- keywords: ['opacity', 'transparent', 'message', 'bubble'],- copy: appearanceCopy('userBubble')- },- textDirection: {- subpage: 'chat-display',- keywords: ['rtl', 'ltr', 'right to left', 'left to right', 'bidi', 'arabic', 'hebrew', 'persian', 'align'],- copy: appearanceCopy('textDirection')- },- hideThreadTimeline: {- subpage: 'chat-display',- keywords: ['thread', 'conversation', 'timeline', 'bars', 'rail', 'navigation', 'hide'],- copy: appearanceCopy('hideThreadTimeline')- },- reactions: {- subpage: 'chat-display',- keywords: ['emoji', 'tapback', 'react', 'reactions'],- copy: appearanceCopy('reactions')- },- vibeHearts: {- subpage: 'chat-display',- keywords: ['hearts', 'vibe', 'celebrate', 'confetti', 'fun'],- copy: appearanceCopy('vibeHearts')- },- toolView: { subpage: 'chat-display', keywords: ['tool display', 'technical'], copy: appearanceCopy('toolView') },- hideCodeDiffs: {- subpage: 'chat-display',- keywords: ['code', 'diff', 'patch', 'file edits', 'inline', 'added', 'removed'],- copy: appearanceCopy('hideCodeDiffs')- },- reasoningCollapsed: {- subpage: 'chat-display',- keywords: ['thinking', 'reasoning', 'collapse', 'expand', 'chain of thought'],- copy: appearanceCopy('reasoningCollapsed')- },- embeds: { subpage: 'chat-display', keywords: ['external content', 'privacy'], copy: appearanceCopy('embeds') },- pet: {- subpage: 'pet',- keywords: ['pet', 'mascot', 'petdex', 'companion', 'buddy'],- copy: t => ({ label: t.settings.appearance.pet.chooseTitle, description: t.settings.appearance.pet.chooseDesc })- }-} as const satisfies Record<string, AppearanceSetting>--export type AppearanceSettingKey = keyof typeof APPEARANCE_SETTINGS--const APPEARANCE_SETTING_KEYS = Object.keys(APPEARANCE_SETTINGS) as AppearanceSettingKey[]-const appearanceSetting = (key: AppearanceSettingKey): AppearanceSetting => APPEARANCE_SETTINGS[key]--const kebab = (key: string) => key.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)--export const APPEARANCE_SETTING_IDS = Object.fromEntries(- APPEARANCE_SETTING_KEYS.map(key => [key, `appearance.${kebab(key)}`])-) as Readonly<Record<AppearanceSettingKey, string>>--const SETTING_SUBPAGES: Readonly<Record<string, AppearanceSubpageId>> = {- // Schema-driven rows that render on an Appearance subpage.- 'desktop.font_family': 'typography',- 'terminal.font_family': 'typography',- ...Object.fromEntries(- APPEARANCE_SETTING_KEYS.map(key => [APPEARANCE_SETTING_IDS[key], appearanceSetting(key).subpage])- )-}--export function appearanceSubpageForSetting(setting: string): AppearanceSubpageId | undefined {- return Object.hasOwn(SETTING_SUBPAGES, setting) ? SETTING_SUBPAGES[setting] : undefined-}--/** The Appearance rows the command palette can land on right now, with their copy resolved. */-export function appearanceSearchTargets(t: Translations) {- return APPEARANCE_SETTING_KEYS.map(key => [key, appearanceSetting(key)] as const)- .filter(([, setting]) => setting.available?.() ?? true)- .map(([key, setting]) => ({ id: APPEARANCE_SETTING_IDS[key], keywords: [...setting.keywords], ...setting.copy(t) }))-}diff --git a/apps/desktop/src/app/settings/config-settings.tsx b/apps/desktop/src/app/settings/config-settings.tsxindex defe752199f..583a6fdcd06 100644--- a/apps/desktop/src/app/settings/config-settings.tsx+++ b/apps/desktop/src/app/settings/config-settings.tsx@@ -51,6 +51,8 @@ import { PoolLimitsSetting } from './pool-limits-setting'import { EmptyState, ListRow, SettingsContent, SettingsSkeleton, ToggleRow } from './primitives'import { SettingsProfileScope } from './profile-scope'import { QuickEntrySettings } from './quick-entry-settings'+import { SETTING_IDS, settingElementId } from './settings-manifest'+import { useSettingDeepLink } from './use-setting-deep-link'export function ConfigSettings({activeSectionId,@@ -302,6 +304,8 @@ function ConfigSettingsInner({const [searchParams, setSearchParams] = useSearchParams()const targetField = searchParams.get('field')+ useSettingDeepLink(`config:${activeSectionId}`, page => subpage === undefined || page === subpage)+useEffect(() => {if (!targetField || !config || !schema) {return@@ -438,12 +442,14 @@ function ConfigSettingsInner({<ToggleRowchecked={keepAwake}description={c.keepAwakeDesc}+ id={settingElementId(SETTING_IDS.advanced.keepAwake)}label={c.keepAwakeTitle}onChange={setKeepAwake}/><ToggleRowchecked={disableF12}description={c.disableF12Desc}+ id={settingElementId(SETTING_IDS.advanced.disableF12)}label={c.disableF12Title}onChange={setDisableF12}/>@@ -561,6 +567,7 @@ function AttachmentSizeSetting() {</div>}description={c.attachmentSizeDesc}+ id={settingElementId(SETTING_IDS.chat.attachmentSize)}title={c.attachmentSizeTitle}/>)diff --git a/apps/desktop/src/app/settings/gateway-settings.tsx b/apps/desktop/src/app/settings/gateway-settings.tsxindex c555b5f118c..432c570479b 100644--- a/apps/desktop/src/app/settings/gateway-settings.tsx+++ b/apps/desktop/src/app/settings/gateway-settings.tsx@@ -45,7 +45,9 @@ import { ConnectionsRegistrySection } from './connections-registry'import { CONTROL_TEXT } from './constants'import { ManagedUpdatesSection } from './managed-updates-section'import { EmptyState, ListRow, Pill, SettingsContent, SettingsSkeleton, ToggleRow } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'import { enrichSelectedSshHost, selectSshHost } from './ssh-host-selection'+import { useSettingDeepLink } from './use-setting-deep-link'type Mode = 'local' | 'remote' | 'cloud' | 'ssh'type AuthMode = 'oauth' | 'token'@@ -168,6 +170,8 @@ interface GatewaySettingsProps {}export function GatewaySettings({ embedded = false, subpage }: GatewaySettingsProps = {}) {+ useSettingDeepLink('gateway', page => subpage === undefined || page === subpage)+// Recovery always keeps the complete connection form, regardless of a// settings destination. Other tasks never mount that form or its probes.if (!embedded && subpage === 'devices') {@@ -1251,7 +1255,7 @@ function GatewayConnectionSettings({ embedded, standalone }: { embedded: boolean</div>) : null}- <div className="mb-5 grid gap-2">+ <div className="mb-5 grid gap-2" id={settingElementId(SETTING_IDS.gateway.connectionMode)}><div className="text-[length:var(--conversation-caption-font-size)] font-medium text-(--ui-text-secondary)">{g.modeTitle}</div>@@ -1743,6 +1747,7 @@ function GatewayConnectionSettings({ embedded, standalone }: { embedded: booleanchecked={keychainEncryption}description={g.keychainEncryptionDesc}disabled={keychainEncryptionBusy}+ id={settingElementId(SETTING_IDS.gateway.keychainEncryption)}label={g.keychainEncryptionTitle}onChange={on => void setKeychainEncryption(on)}/>@@ -1754,6 +1759,7 @@ function GatewayConnectionSettings({ embedded, standalone }: { embedded: boolean</Button>}description={g.diagnosticsDesc}+ id={settingElementId(SETTING_IDS.gateway.diagnostics)}title={g.diagnostics}/></div>diff --git a/apps/desktop/src/app/settings/hud-modifier-settings.tsx b/apps/desktop/src/app/settings/hud-modifier-settings.tsxindex 29c765b9fe1..4f41143cf3b 100644--- a/apps/desktop/src/app/settings/hud-modifier-settings.tsx+++ b/apps/desktop/src/app/settings/hud-modifier-settings.tsx@@ -7,10 +7,7 @@ import { useI18n } from '@/i18n'import type { HudModifierStatus } from '../../../electron/hud-modifier-types'import { ToggleRow } from './primitives'-import { useDeepLinkHighlight } from './use-deep-link-highlight'--const isHudModifierSetting = (target: string) => target === 'hud-modifier'-const hudModifierElementId = () => 'setting-hud-modifier'+import { SETTING_IDS, settingElementId } from './settings-manifest'export function HudModifierSettings() {const { t } = useI18n()@@ -22,7 +19,6 @@ export function HudModifierSettings() {const [error, setError] = useState<string | null>(null)const request = useRef(0)const revision = useRef(0)- useDeepLinkHighlight({ param: 'setting', ready: isHudModifierSetting, elementId: hudModifierElementId })const refresh = useCallback(async (enabled?: boolean) => {@@ -96,7 +92,7 @@ export function HudModifierSettings() {(status?.enabled && status.state === 'unavailable' ? unavailableNotice : null)return (- <div id={hudModifierElementId()}>+ <div id={settingElementId(SETTING_IDS.keybinds.hudModifier)}><ToggleRowchecked={status?.enabled ?? false}description={copy.description}diff --git a/apps/desktop/src/app/settings/keybind-settings.tsx b/apps/desktop/src/app/settings/keybind-settings.tsxindex 1d294e08563..9412fba7efe 100644--- a/apps/desktop/src/app/settings/keybind-settings.tsx+++ b/apps/desktop/src/app/settings/keybind-settings.tsx@@ -33,12 +33,15 @@ import {import { HudModifierSettings } from './hud-modifier-settings'import { SettingsBreadcrumbContext, SettingsContent } from './primitives'import { ScreenshotSettings } from './screenshot-settings'+import { useSettingDeepLink } from './use-setting-deep-link'interface KeybindSettingsProps {subpage?: string}export function KeybindSettings({ subpage }: KeybindSettingsProps = {}) {+ useSettingDeepLink('keybinds', page => subpage === undefined || page === subpage)+if (subpage === 'hud-gesture') {return (<SettingsContent>diff --git a/apps/desktop/src/app/settings/notifications-settings.tsx b/apps/desktop/src/app/settings/notifications-settings.tsxindex 6e6a0fefe3d..c210cca8f03 100644--- a/apps/desktop/src/app/settings/notifications-settings.tsx+++ b/apps/desktop/src/app/settings/notifications-settings.tsx@@ -20,6 +20,8 @@ import { notify } from '@/store/notifications'import { CONTROL_TEXT } from './constants'import { ListRow, SectionHeading, SettingsContent, ToggleRow } from './primitives'+import { notificationKindSettingId, SETTING_IDS, settingElementId } from './settings-manifest'+import { useSettingDeepLink } from './use-setting-deep-link'const CAPTION = 'text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)'@@ -39,6 +41,8 @@ export function NotificationsSettings({ subpage }: NotificationsSettingsProps =const showAlerts = subpage === undefined || subpage === 'alerts'const showSounds = subpage === undefined || subpage === 'sounds'+ useSettingDeepLink('notifications', page => subpage === undefined || page === subpage)+const runTest = async () => {triggerHaptic('open')const ok = await sendTestNativeNotification(copy.testTitle, copy.testBody)@@ -55,6 +59,7 @@ export function NotificationsSettings({ subpage }: NotificationsSettingsProps =<ToggleRowchecked={prefs.enabled}description={copy.enableAllDesc}+ id={settingElementId(SETTING_IDS.notifications.enableAll)}label={copy.enableAll}onChange={setNativeNotifyEnabled}/>@@ -64,6 +69,7 @@ export function NotificationsSettings({ subpage }: NotificationsSettingsProps =checked={prefs.enabled && prefs.kinds[kind]}description={copy.kinds[kind].description}disabled={!prefs.enabled}+ id={settingElementId(notificationKindSettingId(kind))}key={kind}label={copy.kinds[kind].label}onChange={on => setNativeNotifyKind(kind, on)}@@ -115,6 +121,7 @@ export function NotificationsSettings({ subpage }: NotificationsSettingsProps =</>}description={copy.completionSoundDesc}+ id={settingElementId(SETTING_IDS.notifications.completionSound)}title={copy.completionSoundTitle}/>)}diff --git a/apps/desktop/src/app/settings/pool-limits-setting.tsx b/apps/desktop/src/app/settings/pool-limits-setting.tsxindex 19a4c87b7a5..2081ac3c120 100644--- a/apps/desktop/src/app/settings/pool-limits-setting.tsx+++ b/apps/desktop/src/app/settings/pool-limits-setting.tsx@@ -2,6 +2,7 @@ import { useStore } from '@nanostores/react'import { useEffect, useState } from 'react'import { ListRow } from '@/app/settings/primitives'+import { SETTING_IDS, settingElementId } from '@/app/settings/settings-manifest'import { Input } from '@/components/ui/input'import { useI18n } from '@/i18n'import { $poolLimits, loadPoolLimits, savePoolLimits } from '@/store/pool-limits'@@ -83,6 +84,7 @@ export function PoolLimitsSetting() {</div>}description="How many bot backends stay running for instant switching. Higher = faster switches, more memory (~60MB per backend). Applies immediately."+ id={settingElementId(SETTING_IDS.advanced.warmBotBackends)}title={t.settings.poolLimits.warmBotBackendsTitle}/><ListRow@@ -108,6 +110,7 @@ export function PoolLimitsSetting() {</div>}description="How long an unused bot backend stays warm before it is shut down. Raise this so bots you revisit every few minutes never pay a cold start."+ id={settingElementId(SETTING_IDS.advanced.backendIdleTimeout)}title={t.settings.poolLimits.backendIdleTimeoutTitle}/></>diff --git a/apps/desktop/src/app/settings/quick-entry-settings.tsx b/apps/desktop/src/app/settings/quick-entry-settings.tsxindex 3daf56f8f2d..da829b68e59 100644--- a/apps/desktop/src/app/settings/quick-entry-settings.tsx+++ b/apps/desktop/src/app/settings/quick-entry-settings.tsx@@ -13,6 +13,7 @@ import {} from '@/store/quick-entry'import { ListRow, ToggleRow } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'/*** Quick Entry — the global-hotkey mini composer's settings rows.@@ -63,6 +64,7 @@ export function QuickEntrySettings() {<ToggleRowchecked={state.enabled}description={q.enabledDesc}+ id={settingElementId(SETTING_IDS.advanced.quickEntry)}label={q.enabledTitle}onChange={enabled => void saveQuickEntrySettings({ enabled })}/>@@ -97,6 +99,7 @@ export function QuickEntrySettings() {)}description={q.shortcutDesc}+ id={settingElementId(SETTING_IDS.advanced.quickEntryShortcut)}title={q.shortcutTitle}/></>diff --git a/apps/desktop/src/app/settings/screenshot-settings.tsx b/apps/desktop/src/app/settings/screenshot-settings.tsxindex 64325031b4b..2df4b454cbe 100644--- a/apps/desktop/src/app/settings/screenshot-settings.tsx+++ b/apps/desktop/src/app/settings/screenshot-settings.tsx@@ -8,6 +8,7 @@ import { useI18n } from '@/i18n'import type { ScreenshotStatus } from '../../../electron/command-screenshot-types'import { ListRow, ToggleRow } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'type SettingsError = 'loadFailed' | 'saveFailed' | 'permissionFailed'@@ -122,6 +123,7 @@ export function ScreenshotSettings() {checked={status?.enabled ?? false}description={s.enabledDesc}disabled={!status || busy}+ id={settingElementId(SETTING_IDS.keybinds.screenshot)}label={s.enabledTitle}onChange={enabled => void refresh(enabled)}/>diff --git a/apps/desktop/src/app/settings/sessions-settings.tsx b/apps/desktop/src/app/settings/sessions-settings.tsxindex 8e8f08da5dd..f10fad821d5 100644--- a/apps/desktop/src/app/settings/sessions-settings.tsx+++ b/apps/desktop/src/app/settings/sessions-settings.tsx@@ -26,7 +26,9 @@ import { forgetSessionUnread } from '@/store/session-unread'import type { HermesConfigRecord, SessionInfo } from '@/types/hermes'import { EmptyState, ListRow, SectionHeading, SettingsContent, SettingsSkeleton, ToggleRow } from './primitives'+import { SETTING_IDS, settingElementId } from './settings-manifest'import { useDeepLinkHighlight } from './use-deep-link-highlight'+import { useSettingDeepLink } from './use-setting-deep-link'const DEFAULT_AUTO_ARCHIVE_DAYS = 3@@ -37,6 +39,8 @@ interface SessionsSettingsProps {}export function SessionsSettings({ subpage }: SessionsSettingsProps = {}) {+ useSettingDeepLink('sessions', page => subpage === undefined || page === subpage)+if (subpage === 'default-directory') {return (<SettingsContent>@@ -281,6 +285,7 @@ function AutoArchiveSetting() {<ToggleRowchecked={enabled}description={s.autoArchiveDesc}+ id={settingElementId(SETTING_IDS.sessions.autoArchive)}label={s.autoArchiveTitle}onChange={on => {setEnabled(on)diff --git a/apps/desktop/src/app/settings/settings-manifest.ts b/apps/desktop/src/app/settings/settings-manifest.tsnew file mode 100644index 00000000000..df496997000--- /dev/null+++ b/apps/desktop/src/app/settings/settings-manifest.ts@@ -0,0 +1,328 @@+import type { Translations } from '@/i18n'+import { NATIVE_NOTIFICATION_KINDS } from '@/store/native-notifications'+import { canUseQuickEntry } from '@/store/quick-entry'+import { TRANSLUCENCY_SUPPORTED } from '@/store/translucency'++import type { AppearanceSubpageId } from './appearance-subpages'+import type { SettingsView } from './types'++interface SettingCopy {+ description?: string+ label: string+}++export interface SettingDefinition {+ /** Rows that only exist on some platforms stay out of search, where a hit would scroll to nothing. */+ available?: () => boolean+ copy: (t: Translations) => SettingCopy+ keywords: readonly string[]+ /** The child page the row lives on; omitted when the view has no subpages. */+ subpage?: string+}++type AppearanceCopy = Translations['settings']['appearance']+type TitledKey = { [K in keyof AppearanceCopy]: K extends `${infer Base}Title` ? Base : never }[keyof AppearanceCopy]++// Most Appearance rows read `<key>Title` / `<key>Desc` straight from the+// appearance catalog; a Desc that is a formatter (uiScale) is left to the row.+const appearanceCopy =+ <K extends TitledKey>(key: K) =>+ (t: Translations): SettingCopy => {+ const catalog: Record<string, unknown> = t.settings.appearance+ const description = catalog[`${key}Desc`]++ return {+ label: t.settings.appearance[`${key}Title`],+ description: typeof description === 'string' ? description : undefined+ }+ }++const appearanceSetting = (subpage: AppearanceSubpageId, keywords: readonly string[], key: TitledKey) =>+ ({ subpage, keywords, copy: appearanceCopy(key) }) satisfies SettingDefinition++/**+ * The manifest of every hand-built settings row — the ones that are not a+ * config-schema field, a credential, or a plugin (those index themselves from+ * backend metadata). A key becomes the row's deep-link id+ * (`<view>.<kebab-case>`), its subpage routes that id, and its copy + keywords+ * feed the command palette — so a row cannot exist without being searchable,+ * and search cannot point at a row that is not there.+ *+ * List *items* (an archived chat, a saved connection, a credential) are not+ * settings and do not belong here; their pages own their own deep links.+ */+export const SETTINGS_MANIFEST = {+ appearance: {+ language: {+ subpage: 'general',+ keywords: ['locale'],+ copy: t => ({ label: t.language.label, description: t.language.description })+ },+ introSplash: appearanceSetting('general', ['splash', 'wordmark', 'empty chat', 'new chat'], 'introSplash'),+ resumeLastSession: appearanceSetting(+ 'general',+ ['resume', 'reopen', 'launch', 'startup', 'last chat', 'session'],+ 'resumeLastSession'+ ),+ tips: appearanceSetting('general', ['tips', 'hints', 'coach marks', 'onboarding', 'help'], 'tips'),+ tours: appearanceSetting('general', ['tour', 'walkthrough', 'guide', 'onboarding', 'help'], 'tours'),+ theme: appearanceSetting('theme', ['color mode', 'skin', 'light', 'dark'], 'theme'),+ uiScale: appearanceSetting('typography', ['zoom', 'size'], 'uiScale'),+ chatFont: appearanceSetting('typography', ['font', 'typeface', 'family', 'text'], 'chatFont'),+ terminalFont: appearanceSetting(+ 'typography',+ ['font', 'monospace', 'nerd font', 'glyphs', 'shell'],+ 'terminalFont'+ ),+ interfaceMode: {+ subpage: 'window-layout',+ keywords: ['simple', 'advanced', 'mode', 'interface', 'chrome', 'minimal', 'focus'],+ copy: t => ({ label: t.interfaceMode.title, description: t.interfaceMode.hint })+ },+ sessionDensity: appearanceSetting(+ 'window-layout',+ ['sidebar', 'sessions', 'compact', 'comfortable', 'density'],+ 'sessionDensity'+ ),+ tabStrip: appearanceSetting('window-layout', ['tabs', 'tab bar', 'strip'], 'tabStrip'),+ appActions: appearanceSetting(+ 'window-layout',+ ['titlebar', 'settings gear', 'layout', 'HUD', 'left', 'right', 'tabs'],+ 'appActions'+ ),+ minimizeToTray: {+ subpage: 'window-layout',+ keywords: ['tray', 'background', 'minimize', 'dock', 'taskbar', 'menu bar'],+ available: () => Boolean(window.hermesDesktop?.minimizeToTray),+ copy: t => ({ label: t.settings.config.minimizeToTrayTitle, description: t.settings.config.minimizeToTrayDesc })+ },+ translucency: {+ ...appearanceSetting('window-layout', ['opacity', 'transparent', 'glass', 'blur'], 'translucency'),+ available: () => TRANSLUCENCY_SUPPORTED+ },+ backdrop: appearanceSetting('window-layout', ['background', 'blur'], 'backdrop'),+ composerPopout: appearanceSetting(+ 'window-layout',+ ['composer', 'floating', 'drag', 'popout', 'dock', 'input'],+ 'composerPopout'+ ),+ userBubble: appearanceSetting('chat-display', ['opacity', 'transparent', 'message', 'bubble'], 'userBubble'),+ textDirection: appearanceSetting(+ 'chat-display',+ ['rtl', 'ltr', 'right to left', 'left to right', 'bidi', 'arabic', 'hebrew', 'persian', 'align'],+ 'textDirection'+ ),+ hideThreadTimeline: appearanceSetting(+ 'chat-display',+ ['thread', 'conversation', 'timeline', 'bars', 'rail', 'navigation', 'hide'],+ 'hideThreadTimeline'+ ),+ reactions: appearanceSetting('chat-display', ['emoji', 'tapback', 'react', 'reactions'], 'reactions'),+ vibeHearts: appearanceSetting('chat-display', ['hearts', 'vibe', 'celebrate', 'confetti', 'fun'], 'vibeHearts'),+ toolView: appearanceSetting('chat-display', ['tool display', 'technical'], 'toolView'),+ hideCodeDiffs: appearanceSetting(+ 'chat-display',+ ['code', 'diff', 'patch', 'file edits', 'inline', 'added', 'removed'],+ 'hideCodeDiffs'+ ),+ reasoningCollapsed: appearanceSetting(+ 'chat-display',+ ['thinking', 'reasoning', 'collapse', 'expand', 'chain of thought'],+ 'reasoningCollapsed'+ ),+ embeds: appearanceSetting('chat-display', ['external content', 'privacy'], 'embeds'),+ pet: {+ subpage: 'pet',+ keywords: ['pet', 'mascot', 'petdex', 'companion', 'buddy'],+ copy: t => ({ label: t.settings.appearance.pet.chooseTitle, description: t.settings.appearance.pet.chooseDesc })+ }+ },+ chat: {+ attachmentSize: {+ subpage: 'attachments',+ keywords: ['attachment', 'image', 'preview', 'upload', 'file size', 'limit', 'MB'],+ copy: t => ({ label: t.settings.config.attachmentSizeTitle, description: t.settings.config.attachmentSizeDesc })+ }+ },+ advanced: {+ keepAwake: {+ subpage: 'desktop',+ keywords: ['sleep', 'awake', 'caffeinate', 'idle', 'overnight', 'power'],+ copy: t => ({ label: t.settings.config.keepAwakeTitle, description: t.settings.config.keepAwakeDesc })+ },+ disableF12: {+ subpage: 'desktop',+ keywords: ['devtools', 'developer tools', 'f12', 'inspector', 'debug'],+ copy: t => ({ label: t.settings.config.disableF12Title, description: t.settings.config.disableF12Desc })+ },+ warmBotBackends: {+ subpage: 'desktop',+ keywords: ['pool', 'backends', 'bots', 'warm', 'concurrency', 'limit'],+ copy: t => ({ label: t.settings.poolLimits.warmBotBackendsTitle })+ },+ backendIdleTimeout: {+ subpage: 'desktop',+ keywords: ['pool', 'backends', 'idle', 'timeout', 'milliseconds'],+ copy: t => ({ label: t.settings.poolLimits.backendIdleTimeoutTitle })+ },+ quickEntry: {+ subpage: 'desktop',+ keywords: ['quick entry', 'global shortcut', 'spotlight', 'summon', 'prompt anywhere'],+ available: canUseQuickEntry,+ copy: t => ({ label: t.settings.quickEntry.enabledTitle, description: t.settings.quickEntry.enabledDesc })+ },+ quickEntryShortcut: {+ subpage: 'desktop',+ keywords: ['quick entry', 'shortcut', 'hotkey', 'keybind', 'chord'],+ available: canUseQuickEntry,+ copy: t => ({ label: t.settings.quickEntry.shortcutTitle, description: t.settings.quickEntry.shortcutDesc })+ }+ },+ keybinds: {+ hudModifier: {+ subpage: 'hud-gesture',+ keywords: ['HUD', 'summon', 'modifier', 'tap', 'Ctrl', 'Alt', 'Command', 'Option'],+ available: () => Boolean(window.hermesDesktop?.hudModifier),+ copy: t => ({ label: t.settings.hudModifier.title, description: t.settings.hudModifier.description })+ },+ screenshot: {+ subpage: 'screen-capture',+ keywords: ['screenshot', 'screen capture', 'window', 'attach', 'command keys'],+ available: () => Boolean(window.hermesDesktop?.screenshot),+ copy: t => ({ label: t.settings.screenshot.enabledTitle, description: t.settings.screenshot.enabledDesc })+ }+ },+ notifications: {+ enableAll: {+ subpage: 'alerts',+ keywords: ['notifications', 'alerts', 'native', 'banner', 'mute', 'do not disturb'],+ copy: t => ({ label: t.settings.notifications.enableAll, description: t.settings.notifications.enableAllDesc })+ },+ ...Object.fromEntries(+ NATIVE_NOTIFICATION_KINDS.map(kind => [+ `kind-${kind}`,+ {+ subpage: 'alerts',+ keywords: ['notification', 'alert', kind],+ copy: (t: Translations) => ({+ label: t.settings.notifications.kinds[kind].label,+ description: t.settings.notifications.kinds[kind].description+ })+ } satisfies SettingDefinition+ ])+ ),+ completionSound: {+ subpage: 'sounds',+ keywords: ['sound', 'chime', 'ding', 'audio', 'done', 'complete', 'mute'],+ copy: t => ({+ label: t.settings.notifications.completionSoundTitle,+ description: t.settings.notifications.completionSoundDesc+ })+ }+ },+ sessions: {+ autoArchive: {+ subpage: 'archived',+ keywords: ['archive', 'stale', 'cleanup', 'old chats', 'days', 'after'],+ copy: t => ({ label: t.settings.sessions.autoArchiveTitle, description: t.settings.sessions.autoArchiveDesc })+ }+ },+ gateway: {+ connectionMode: {+ subpage: 'connection',+ keywords: ['gateway', 'connection', 'local', 'cloud', 'remote', 'ssh', 'url', 'token', 'host', 'port', 'key'],+ copy: t => ({ label: t.settings.gateway.modeTitle, description: t.settings.gateway.intro })+ },+ keychainEncryption: {+ subpage: 'connection',+ keywords: ['keychain', 'encrypt', 'secrets', 'secure storage', 'plain text'],+ copy: t => ({+ label: t.settings.gateway.keychainEncryptionTitle,+ description: t.settings.gateway.keychainEncryptionDesc+ })+ },+ diagnostics: {+ subpage: 'connection',+ keywords: ['diagnostics', 'logs', 'debug', 'report', 'troubleshoot'],+ copy: t => ({ label: t.settings.gateway.diagnostics, description: t.settings.gateway.diagnosticsDesc })+ }+ },+ about: {+ automaticUpdates: {+ subpage: 'updates',+ keywords: ['update', 'auto update', 'download', 'release', 'version'],+ copy: t => ({ label: t.settings.about.automaticUpdates, description: t.settings.about.automaticUpdatesDesc })+ }+ }+} as const satisfies Record<string, Record<string, SettingDefinition>>++export type ManifestViewKey = keyof typeof SETTINGS_MANIFEST++/** Manifest keys that are config sections route as `config:<key>`; the rest are views of their own. */+const CONFIG_SECTION_KEYS: readonly ManifestViewKey[] = ['appearance', 'chat', 'advanced']++export const manifestView = (key: ManifestViewKey): SettingsView =>+ CONFIG_SECTION_KEYS.includes(key) ? `config:${key}` : (key as SettingsView)++const manifestKeyForView = (view: SettingsView): ManifestViewKey | undefined => {+ const key = view.startsWith('config:') ? view.slice('config:'.length) : view++ return Object.hasOwn(SETTINGS_MANIFEST, key) ? (key as ManifestViewKey) : undefined+}++const kebab = (key: string) => key.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)++/** The deep-link id of a manifest row: `settingId('appearance', 'tips') === 'appearance.tips'`. */+export const settingId = (view: ManifestViewKey, key: string) => `${view}.${kebab(key)}`++/** Notification kinds are generated from the store's kind list, so their ids are looked up by kind. */+export const notificationKindSettingId = (kind: (typeof NATIVE_NOTIFICATION_KINDS)[number]) =>+ settingId('notifications', `kind-${kind}`)++type SettingIds = { readonly [V in ManifestViewKey]: { readonly [K in keyof (typeof SETTINGS_MANIFEST)[V]]: string } }++/** `SETTING_IDS.appearance.tips === 'appearance.tips'` — the id a row carries and a palette hit targets. */+export const SETTING_IDS = Object.fromEntries(+ (Object.keys(SETTINGS_MANIFEST) as ManifestViewKey[]).map(view => [+ view,+ Object.fromEntries(Object.keys(SETTINGS_MANIFEST[view]).map(key => [key, settingId(view, key)]))+ ])+) as SettingIds++/** The DOM id a settings row carries so a deep link can scroll to and flash it. */+export const settingElementId = (id: string) => `setting-field-${id}`++const definitions = (view: ManifestViewKey): Record<string, SettingDefinition> => SETTINGS_MANIFEST[view]++/** The manifest row behind a deep-link id on a view, if the view owns one. */+export function settingDefinition(view: SettingsView, id: string): SettingDefinition | undefined {+ const key = manifestKeyForView(view)++ if (!key) {+ return undefined+ }++ const [settingKey] = Object.entries(SETTING_IDS[key]).find(([, candidate]) => candidate === id) ?? []++ return settingKey ? definitions(key)[settingKey] : undefined+}++export interface SettingSearchTarget extends SettingCopy {+ id: string+ keywords: string[]+ view: SettingsView+}++/** Every manifest row the command palette can land on right now, copy resolved. */+export function settingSearchTargets(t: Translations): SettingSearchTarget[] {+ return (Object.keys(SETTINGS_MANIFEST) as ManifestViewKey[]).flatMap(viewKey =>+ Object.entries(definitions(viewKey))+ .filter(([, setting]) => setting.available?.() ?? true)+ .map(([key, setting]) => ({+ id: SETTING_IDS[viewKey][key as keyof (typeof SETTING_IDS)[typeof viewKey]],+ keywords: [...setting.keywords],+ view: manifestView(viewKey),+ ...setting.copy(t)+ }))+ )+}diff --git a/apps/desktop/src/app/settings/subpages.test.ts b/apps/desktop/src/app/settings/subpages.test.tsindex 3307da34ce3..3ce0d7d99e3 100644--- a/apps/desktop/src/app/settings/subpages.test.ts+++ b/apps/desktop/src/app/settings/subpages.test.ts@@ -2,16 +2,17 @@ import { describe, expect, it } from 'vitest'import { TRANSLATIONS } from '@/i18n'-import {- APPEARANCE_SETTING_IDS,- APPEARANCE_SETTINGS,- APPEARANCE_SUBPAGES,- appearanceSearchTargets,- appearanceSubpageForSetting-} from './appearance-subpages'import { CONFIG_SUBPAGES, configSubpageForField } from './config-subpages'import { SECTIONS } from './constants'import { OTHER_SUBPAGES } from './other-subpages'+import {+ manifestView,+ type ManifestViewKey,+ SETTING_IDS,+ settingDefinition,+ SETTINGS_MANIFEST,+ settingSearchTargets+} from './settings-manifest'import { settingsSearchTargetQuery } from './settings-search'import { resolveSettingsSubpage, settingsSubpages } from './subpages'import type { SettingsView } from './types'@@ -57,8 +58,10 @@ describe('settings subpage routing', () => {const cases: [SettingsView, string, string][] = [['config:model', 'aux=vision', 'auxiliary'],- ['keybinds', 'setting=hud-modifier', 'hud-gesture'],- ['keybinds', 'page=shortcuts&setting=hud-modifier', 'hud-gesture'],+ ['keybinds', 'setting=keybinds.hud-modifier', 'hud-gesture'],+ ['keybinds', 'page=shortcuts&setting=keybinds.hud-modifier', 'hud-gesture'],+ ['notifications', 'setting=notifications.completion-sound', 'sounds'],+ ['config:advanced', 'setting=advanced.keep-awake', 'desktop'],['sessions', 'session=archived-id', 'archived'],['vault', 'kind=login', 'credentials'],['vault', 'label=Example', 'credentials'],@@ -71,31 +74,45 @@ describe('settings subpage routing', () => {}})- it('makes every Appearance row a routed, translated palette hit', () => {- const subpages = APPEARANCE_SUBPAGES.map(page => page.id)+ it('makes every manifest row a routed, translated palette hit on a real page', () => {+ for (const viewKey of Object.keys(SETTINGS_MANIFEST) as ManifestViewKey[]) {+ const view = manifestView(viewKey)+ const subpages = settingsSubpages(view).map(page => page.id)+ expect(views).toContain(view)++ for (const [key, setting] of Object.entries(SETTINGS_MANIFEST[viewKey])) {+ const id = SETTING_IDS[viewKey][key as keyof (typeof SETTING_IDS)[typeof viewKey]]+ expect(id).toBe(`${viewKey}.${key.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)}`)+ expect(settingDefinition(view, id)).toBe(setting)+ expect(setting.keywords.length).toBeGreaterThan(0)- for (const [key, setting] of Object.entries(APPEARANCE_SETTINGS)) {- const id = APPEARANCE_SETTING_IDS[key as keyof typeof APPEARANCE_SETTING_IDS]- expect(id).toMatch(/^appearance\.[a-z-]+$/)- expect(subpages).toContain(setting.subpage)- expect(appearanceSubpageForSetting(id)).toBe(setting.subpage)- expect(- resolveSettingsSubpage(- 'config:appearance',- new URLSearchParams(settingsSearchTargetQuery({ view: 'config:appearance', setting: id }))- )- ).toBe(setting.subpage)- expect(setting.keywords.length).toBeGreaterThan(0)+ if (setting.subpage) {+ expect(subpages).toContain(setting.subpage)+ expect(+ resolveSettingsSubpage(view, new URLSearchParams(settingsSearchTargetQuery({ view, setting: id })))+ ).toBe(setting.subpage)+ }- for (const locale of Object.values(TRANSLATIONS)) {- expect(setting.copy(locale).label).toBeTruthy()+ for (const locale of Object.values(TRANSLATIONS)) {+ expect(setting.copy(locale).label).toBeTruthy()+ }}}// Platform-gated rows aside, the whole manifest reaches the palette.- const targets = appearanceSearchTargets(TRANSLATIONS.en)- const gated = Object.values(APPEARANCE_SETTINGS).filter(setting => 'available' in setting).length- expect(targets.length).toBeGreaterThanOrEqual(Object.keys(APPEARANCE_SETTINGS).length - gated)- expect(targets.map(target => target.label)).toEqual(expect.arrayContaining(['In-App Tips', 'Guided Tours']))+ const definitions = Object.values(SETTINGS_MANIFEST).flatMap(rows => Object.values(rows))+ const gated = definitions.filter(setting => 'available' in setting).length+ const targets = settingSearchTargets(TRANSLATIONS.en)+ expect(targets.length).toBeGreaterThanOrEqual(definitions.length - gated)+ expect(new Set(targets.map(target => target.id)).size).toBe(targets.length)+ expect(targets.map(target => target.label)).toEqual(+ expect.arrayContaining([+ 'In-App Tips',+ 'Guided Tours',+ 'Keep computer awake',+ 'Auto-archive stale chats',+ 'Automatic updates'+ ])+ )})})diff --git a/apps/desktop/src/app/settings/subpages.ts b/apps/desktop/src/app/settings/subpages.tsindex 490dc0a5a00..f6182292823 100644--- a/apps/desktop/src/app/settings/subpages.ts+++ b/apps/desktop/src/app/settings/subpages.ts@@ -29,9 +29,10 @@ import {Wrench} from '@/lib/icons'-import { APPEARANCE_SUBPAGES, appearanceSubpageForSetting } from './appearance-subpages'+import { APPEARANCE_SUBPAGES } from './appearance-subpages'import { CONFIG_SUBPAGES, configSubpageForField } from './config-subpages'import { OTHER_SUBPAGES } from './other-subpages'+import { settingDefinition } from './settings-manifest'import type { SettingsView } from './types'export interface SettingsSubpage {@@ -105,12 +106,8 @@ export function settingsSubpages(view: SettingsView): readonly SettingsSubpage[]/** Shared by search serialization and saved links that predate subpages. */export function settingsSubpageForTarget(view: SettingsView, field?: string, setting?: string): string | undefined {- if (view === 'keybinds' && setting === 'hud-modifier') {- return 'hud-gesture'- }-- if (view === 'config:appearance' && setting) {- return appearanceSubpageForSetting(setting)+ if (setting) {+ return settingDefinition(view, setting)?.subpage}if (view.startsWith('config:') && field) {diff --git a/apps/desktop/src/app/settings/use-setting-deep-link.ts b/apps/desktop/src/app/settings/use-setting-deep-link.tsnew file mode 100644index 00000000000..ef92d15a6b0--- /dev/null+++ b/apps/desktop/src/app/settings/use-setting-deep-link.ts@@ -0,0 +1,24 @@+import { useCallback } from 'react'++import { settingDefinition, settingElementId } from './settings-manifest'+import type { SettingsView } from './types'+import { useDeepLinkHighlight } from './use-deep-link-highlight'++/**+ * Land a palette hit (`?setting=<id>`) on a manifest row of this view: once+ * the row's subpage is showing, scroll to it and flash it. Pages with no+ * subpages pass no `show`; pages with subpages pass the same predicate that+ * gates their rows so the highlight waits for the right child page.+ */+export function useSettingDeepLink(view: SettingsView, show: (subpage: string | undefined) => boolean = () => true) {+ const ready = useCallback(+ (id: string) => {+ const setting = settingDefinition(view, id)++ return setting !== undefined && show(setting.subpage)+ },+ [show, view]+ )++ return useDeepLinkHighlight({ elementId: settingElementId, param: 'setting', ready })+}diff --git a/apps/desktop/src/app/settings/use-settings-search.ts b/apps/desktop/src/app/settings/use-settings-search.tsindex afa21893a04..384ef0c8eb9 100644--- a/apps/desktop/src/app/settings/use-settings-search.ts+++ b/apps/desktop/src/app/settings/use-settings-search.ts@@ -6,16 +6,16 @@ import { useGatewayRequest } from '@/app/gateway/hooks/use-gateway-request'import { $pluginRecords } from '@/contrib/plugins-store'import { getEnvVars, getHermesConfigSchema } from '@/hermes'import { useI18n } from '@/i18n'-import { type IconComponent, Monitor, Package, Palette, Settings2, Wrench } from '@/lib/icons'+import { type IconComponent, Monitor, Package, Settings2, Wrench } from '@/lib/icons'import { $agentPlugins, isDesktopRelevantPlugin, loadAgentPlugins } from '@/store/agent-plugins'import { $gatewayState } from '@/store/session'import { useHermesConfigRecord } from '../hooks/use-config-record'import { useOnProfileSwitch } from '../hooks/use-on-profile-switch'-import { appearanceSearchTargets } from './appearance-subpages'import { SECTIONS } from './constants'import { OTHER_SUBPAGES } from './other-subpages'+import { settingSearchTargets } from './settings-manifest'import { buildConfigSearchEntries, buildCredentialSearchEntries, type SettingsSearchEntry } from './settings-search'import { settingsSubpages } from './subpages'import type { SettingsView } from './types'@@ -116,18 +116,6 @@ export function useSettingsSearchCatalog(enabled: boolean) {sections: t.settings.sections})- const appearanceContext = t.settings.sections.appearance-- // Every hand-built Appearance row, straight from the manifest that also- // routes and ids them — the palette cannot drift from the page.- const appearanceEntries: SettingsSearchEntry[] = appearanceSearchTargets(t).map(({ id, ...entry }) => ({- ...entry,- context: appearanceContext,- icon: Palette,- id: `setting:${id}`,- target: { setting: id, view: 'config:appearance' }- }))-const credentialEntries = buildCredentialSearchEntries(envVarsFetching || envVarsError ? null : envVars,{@@ -142,11 +130,8 @@ export function useSettingsSearchCatalog(enabled: boolean) {sessions: t.settings.nav.archivedChats}- // A page named after its one setting (Appearance › Theme) would show up as- // two identical rows; the setting wins because it lands on the row itself.- const settingLabels = new Set(appearanceEntries.map(entry => `${entry.context}\u0000${entry.label}`))-- const subpageEntries: SettingsSearchEntry[] = [+ // The pages that own rows: config sections and the standalone views.+ const parents = [...SECTIONS.map(section => ({view: `config:${section.id}` as SettingsView,label: t.settings.sections[section.id] ?? section.label,@@ -158,6 +143,28 @@ export function useSettingsSearchCatalog(enabled: boolean) {icon: Settings2}))]++ const parentOf = (view: SettingsView) => parents.find(parent => parent.view === view)++ // Every hand-built settings row, straight from the manifest that also+ // routes and ids them — the palette cannot drift from the pages.+ const settingEntries: SettingsSearchEntry[] = settingSearchTargets(t).map(({ id, view, ...entry }) => {+ const parent = parentOf(view)++ return {+ ...entry,+ context: parent?.label ?? view,+ icon: parent?.icon ?? Settings2,+ id: `setting:${id}`,+ target: { setting: id, view }+ }+ })++ // A page named after its one setting (Appearance › Theme) would show up as+ // two identical rows; the setting wins because it lands on the row itself.+ const settingLabels = new Set(settingEntries.map(entry => `${entry.context}\u0000${entry.label}`))++ const subpageEntries: SettingsSearchEntry[] = parents.flatMap(parent =>settingsSubpages(parent.view).map(page => ({context: parent.label,@@ -171,23 +178,8 @@ export function useSettingsSearchCatalog(enabled: boolean) {.filter(entry => !settingLabels.has(`${entry.context}\u0000${entry.label}`))return {- subpageEntries: [- ...subpageEntries,- ...(window.hermesDesktop?.hudModifier- ? [- {- context: t.keybinds.title,- icon: Settings2,- id: 'setting:hud-modifier',- keywords: ['HUD', 'summon', 'modifier', 'tap', 'Ctrl', 'Alt', 'Command', 'Option'],- label: t.settings.hudModifier.title,- description: t.settings.hudModifier.description,- target: { view: 'keybinds' as const, subpage: 'hud-gesture', setting: 'hud-modifier' }- }- ]- : [])- ],- appearanceEntries,+ subpageEntries,+ settingEntries,configEntries,credentialEntries,pluginEntries