Skip to content

The agent that grows with you

feat(desktop): make the multi-gateway Connections registry discoverable

Teknium34271eb069aa
diff --git a/apps/desktop/src/app/chat/sidebar/profile-rail-connect.test.tsx b/apps/desktop/src/app/chat/sidebar/profile-rail-connect.test.tsx
new file mode 100644
index 00000000000..75f8b9eb3b4
--- /dev/null
+++ b/apps/desktop/src/app/chat/sidebar/profile-rail-connect.test.tsx
@@ -0,0 +1,97 @@
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { atom } from 'nanostores'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { ProfileRail } from './profile-switcher'
+
+afterEach(cleanup)
+
+// The rail's discoverability pills are navigation, not identity — assert the
+// multi-gateway entry point deep-links to Settings → Connections instead of
+// relying on someone finding the pane three levels into Settings (the exact
+// gap reported against the multi-connection registry launch).
+
+const navigate = vi.fn()
+
+vi.mock('react-router', () => ({
+ useNavigate: () => navigate
+}))
+
+vi.mock('@/i18n', () => ({
+ useI18n: () => ({
+ t: {
+ common: { cancel: 'Cancel' },
+ profiles: {
+ allProfiles: 'All profiles',
+ connectGateway: 'Connect another Hermes gateway…',
+ failedLoadSoul: 'Failed to load SOUL.md',
+ failedSaveSoul: 'Failed to save SOUL.md',
+ importProfile: 'Import profile…',
+ manageProfiles: 'Manage profiles…',
+ newProfile: 'New profile',
+ saveSoul: 'Save',
+ saving: 'Saving…',
+ showAllProfiles: 'Show all profiles',
+ soulSaved: 'SOUL.md saved',
+ switchToProfile: (name: string) => `Switch to ${name}`,
+ title: 'Profiles'
+ }
+ }
+ })
+}))
+
+vi.mock('@/store/profile', () => ({
+ $activeGatewayProfile: atom('default'),
+ $profileColors: atom({}),
+ $profileCreateRequest: atom(0),
+ $profileOrder: atom([]),
+ $profiles: atom([{ is_default: true, name: 'default' }]),
+ $profileScope: atom('default'),
+ ALL_PROFILES: '*',
+ normalizeProfileKey: (name: string) => name,
+ refreshActiveProfile: vi.fn().mockResolvedValue(undefined),
+ selectProfile: vi.fn(),
+ setProfileColor: vi.fn(),
+ setProfileOrder: vi.fn(),
+ setShowAllProfiles: vi.fn(),
+ sortByProfileOrder: (profiles: unknown[]) => profiles
+}))
+
+vi.mock('@/store/profile-share', () => ({
+ runExportProfileFlow: vi.fn(),
+ runImportProfileFlow: vi.fn()
+}))
+
+vi.mock('./use-profile-prewarm', () => ({
+ useProfilePrewarm: () => ({ cancelPrewarm: vi.fn(), startPrewarm: vi.fn() })
+}))
+
+vi.mock('@/hermes', () => ({
+ getProfileSoul: vi.fn().mockResolvedValue({ content: '' }),
+ updateProfileSoul: vi.fn()
+}))
+
+vi.mock('@/components/chat/code-editor', () => ({ CodeEditor: () => null }))
+vi.mock('../../profiles/create-profile-dialog', () => ({ CreateProfileDialog: () => null }))
+vi.mock('../../profiles/delete-profile-dialog', () => ({ DeleteProfileDialog: () => null }))
+vi.mock('../../profiles/rename-profile-dialog', () => ({ RenameProfileDialog: () => null }))
+
+describe('ProfileRail multi-gateway entry point', () => {
+ it('deep-links to Settings → Connections from the rail', () => {
+ render(<ProfileRail />)
+
+ const pill = screen.getByRole('button', { name: 'Connect another Hermes gateway…' })
+ fireEvent.click(pill)
+
+ expect(navigate).toHaveBeenCalledWith('/settings?tab=connections')
+ })
+
+ it('keeps the entry point visible for single-profile users', () => {
+ render(<ProfileRail />)
+
+ // The whole point is first-run discoverability: the pill must not be
+ // gated behind multiProfile the way the default↔all toggle is.
+ expect(screen.getByRole('button', { name: 'Connect another Hermes gateway…' })).toBeTruthy()
+ expect(screen.getByRole('button', { name: 'Manage profiles…' })).toBeTruthy()
+ })
+})
diff --git a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
index 530ef5c6c0c..8f7fe793146 100644
--- a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
+++ b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx
@@ -66,7 +66,7 @@ import type { ProfileInfo } from '@/types/hermes'
import { CreateProfileDialog } from '../../profiles/create-profile-dialog'
import { DeleteProfileDialog } from '../../profiles/delete-profile-dialog'
import { RenameProfileDialog } from '../../profiles/rename-profile-dialog'
-import { PROFILES_ROUTE } from '../../routes'
+import { PROFILES_ROUTE, SETTINGS_ROUTE } from '../../routes'
import { useProfilePrewarm } from './use-profile-prewarm'
@@ -315,6 +315,18 @@ export function ProfileRail() {
without first creating a throwaway second profile. */}
<ProfilePill active={false} glyph="ellipsis" label={p.manageProfiles} onSelect={() => navigate(PROFILES_ROUTE)} />
+ {/* Multi-gateway discoverability: a plug pinned beside Manage deep-links
+ to Settings → Connections. The registry (local runtime + remote
+ gateways + Hermes Cloud + SSH) is otherwise buried three levels into
+ Settings, and the rail is exactly where a user looks when they wonder
+ "how do I get my other machine's agents in here". */}
+ <ProfilePill
+ active={false}
+ glyph="plug"
+ label={p.connectGateway}
+ onSelect={() => navigate(`${SETTINGS_ROUTE}?tab=connections`)}
+ />
+
{/* Land in the new profile on a fresh chat (selectProfile triggers the
new-session reset), not stuck on the session you were just in. */}
<CreateProfileDialog
diff --git a/apps/desktop/src/app/command-palette/index.tsx b/apps/desktop/src/app/command-palette/index.tsx
index e367e805826..6f8287fcb9e 100644
--- a/apps/desktop/src/app/command-palette/index.tsx
+++ b/apps/desktop/src/app/command-palette/index.tsx
@@ -41,6 +41,7 @@ import {
MessageCircle,
Monitor,
Moon,
+ Network,
Package,
Palette,
PawPrint,
@@ -385,6 +386,7 @@ const toSessionEntry = (session: SessionRow): SessionEntry => ({
type NonConfigSettingsLabel =
| 'about'
| 'archivedChats'
+ | 'connections'
| 'gateway'
| 'keysSettings'
| 'keysTools'
@@ -412,6 +414,12 @@ const NON_CONFIG_SETTINGS: ReadonlyArray<{
tab: 'providers&pview=keys'
},
{ icon: Globe, keywords: ['connection', 'messaging'], labelKey: 'gateway', tab: 'gateway' },
+ {
+ icon: Network,
+ keywords: ['connections', 'gateway', 'remote', 'multi', 'instances', 'ssh', 'cloud', 'add gateway', 'registry'],
+ labelKey: 'connections',
+ tab: 'connections'
+ },
{
icon: KeyRound,
keywords: ['api', 'secrets', 'tokens', 'credentials', 'browser', 'search'],
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 3e427f1e56b..5f1c492e175 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -1688,6 +1688,7 @@ export const en: Translations = {
showAllProfiles: 'Show all profiles',
switchToProfile: name => `Switch to ${name}`,
manageProfiles: 'Manage profiles…',
+ connectGateway: 'Connect another Hermes gateway…',
actions: 'Actions',
color: 'Color…',
colorFor: 'Color',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 1c0556b7085..a3814aeec9c 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -1418,6 +1418,7 @@ export interface Translations {
showAllProfiles: string
switchToProfile: (name: string) => string
manageProfiles: string
+ connectGateway: string
actions: string
color: string
colorFor: string
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 59840d709b6..334053018a7 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -1876,6 +1876,7 @@ export const zh: Translations = {
showAllProfiles: '显示全部配置档案',
switchToProfile: name => `切换到 ${name}`,
manageProfiles: '管理配置档案…',
+ connectGateway: '连接另一个 Hermes 网关…',
actions: '操作',
color: '颜色…',
colorFor: '颜色',