The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): distinguish sources from profiles
David Dudok de Witccd30f955c1e
diff --git a/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx b/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsxindex 1dcaa2d21a6..cd347bb4f32 100644--- a/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx+++ b/apps/desktop/src/app/chat/sidebar/connection-switcher.test.tsx@@ -6,6 +6,11 @@ import type { DesktopConnectionsRegistry } from '@/global'import { ConnectionSwitcher } from './connection-switcher'+// Radix menus use pointer capture; jsdom does not implement it.+Element.prototype.hasPointerCapture ??= () => false+Element.prototype.setPointerCapture ??= () => undefined+Element.prototype.releasePointerCapture ??= () => undefined+vi.mock('@/store/connections', () => ({$activeConnectionId: atom<null | string>('local'),$connectionsRegistry: atom<DesktopConnectionsRegistry | null>(null),@@ -19,7 +24,8 @@ vi.mock('@/i18n', () => ({t: {profiles: {switchConnectionFailed: (name: string) => `Could not connect to ${name}`,- switchToConnection: (name: string) => `Switch to ${name}`+ switchToConnection: (name: string) => `Switch to ${name}`,+ connectGateway: 'Connect another Hermes gateway…'},settings: { connections: { title: 'Connections' } }}@@ -31,6 +37,7 @@ const $activeConnectionId = connectionStore.$activeConnectionId as ReturnType<tyconst $connectionsRegistry = connectionStore.$connectionsRegistryconst $pendingConnectionId = connectionStore.$pendingConnectionIdconst selectConnection = vi.mocked(connectionStore.selectConnection)+const onConnect = vi.fn()const connection = (id: string, label: string, kind: 'local' | 'remote' = 'remote') => ({id,@@ -58,12 +65,12 @@ afterEach(() => {describe('ConnectionSwitcher', () => {it('adds no source chrome for a local-only setup', () => {$connectionsRegistry.set(registry([connection('local', 'This device', 'local')]))- render(<ConnectionSwitcher />)+ render(<ConnectionSwitcher onConnect={onConnect} />)expect(screen.queryByRole('group', { name: 'Connections' })).toBeNull()})- it('shows direct local and remote source controls for a small registry', () => {+ it('shows a named source selector instead of profile-like gateway glyphs', () => {$connectionsRegistry.set(registry([connection('local', 'This device', 'local'),@@ -71,33 +78,44 @@ describe('ConnectionSwitcher', () => {connection('work-vps', 'Work VPS')]))- render(<ConnectionSwitcher />)+ render(<ConnectionSwitcher onConnect={onConnect} />)++ const trigger = screen.getByRole('button', { name: 'Connections: This device' })++ expect(trigger.textContent).toContain('This device')+ expect(trigger.getAttribute('data-variant')).toBe('ghost')+ expect(trigger.querySelector('[data-connection-kind="local"] svg')).toBeTruthy()+ expect(trigger.querySelector('.codicon-home')).toBeNull()- expect(screen.getByRole('button', { name: 'Switch to This device' }).getAttribute('aria-pressed')).toBe('true')- fireEvent.click(screen.getByRole('button', { name: 'Switch to Homelab' }))+ fireEvent.pointerDown(trigger, { button: 0, pointerType: 'mouse' })+ fireEvent.click(screen.getByRole('menuitemradio', { name: 'Homelab' }))expect(selectConnection).toHaveBeenCalledWith('homelab')++ fireEvent.pointerDown(trigger, { button: 0, pointerType: 'mouse' })+ fireEvent.click(screen.getByRole('menuitem', { name: 'Connect another Hermes gateway…' }))+ expect(onConnect).toHaveBeenCalledTimes(1)+ expect(selectConnection).toHaveBeenCalledTimes(1)})it('keeps source controls stable while a remote is opening', () => {$connectionsRegistry.set(registry([connection('local', 'This device', 'local'), connection('homelab', 'Homelab')]))$pendingConnectionId.set('homelab')- render(<ConnectionSwitcher />)+ render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.getByRole('button', { name: 'Switch to Homelab' }).getAttribute('aria-busy')).toBe('true')- expect(screen.getByRole('button', { name: 'Switch to This device' }).getAttribute('aria-busy')).toBe('false')+ expect(screen.getByRole('group', { name: 'Connections' }).getAttribute('aria-busy')).toBe('true')+ expect(screen.getByRole('button', { name: 'Connections: This device' }).querySelector('.animate-spin')).toBeTruthy()})- it('collapses a larger registry into one compact source select', () => {+ it.each([2, 20])('uses the same stable source selector for %i registered backends', count => {$connectionsRegistry.set(registry([connection('local', 'This device', 'local'),- ...Array.from({ length: 6 }, (_, index) => connection(`remote-${index}`, `Remote ${index}`))+ ...Array.from({ length: count - 1 }, (_, index) => connection(`remote-${index}`, `Remote ${index}`))]))- render(<ConnectionSwitcher />)+ render(<ConnectionSwitcher onConnect={onConnect} />)- expect(screen.getByRole('combobox', { name: 'Connections' })).toBeTruthy()- expect(screen.queryByRole('button', { name: 'Switch to Homelab' })).toBeNull()+ expect(screen.getByRole('button', { name: 'Connections: This device' })).toBeTruthy()})it('announces a pending switch in the compact source menu', () => {@@ -108,7 +126,7 @@ describe('ConnectionSwitcher', () => {]))$pendingConnectionId.set('remote-3')- render(<ConnectionSwitcher />)+ render(<ConnectionSwitcher onConnect={onConnect} />)expect(screen.getByRole('group', { name: 'Connections' }).getAttribute('aria-busy')).toBe('true')})diff --git a/apps/desktop/src/app/chat/sidebar/connection-switcher.tsx b/apps/desktop/src/app/chat/sidebar/connection-switcher.tsxindex 4f409858b55..ae3b6aed265 100644--- a/apps/desktop/src/app/chat/sidebar/connection-switcher.tsx+++ b/apps/desktop/src/app/chat/sidebar/connection-switcher.tsx@@ -2,15 +2,20 @@ import { useStore } from '@nanostores/react'import { useEffect } from 'react'import { Button } from '@/components/ui/button'-import { ProfileGlyph } from '@/components/ui/profile-glyph'-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'-import { Tip } from '@/components/ui/tooltip'+import { Codicon } from '@/components/ui/codicon'+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuRadioGroup,+ DropdownMenuRadioItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger+} from '@/components/ui/dropdown-menu'import type { DesktopRegistryConnection } from '@/global'import { useI18n } from '@/i18n'import { triggerHaptic } from '@/lib/haptics'-import { Loader2 } from '@/lib/icons'-import { profileColor } from '@/lib/profile-color'-import { cn } from '@/lib/utils'+import { Cloud, Loader2, Monitor, Network, Terminal } from '@/lib/icons'import {$activeConnectionId,$connectionsRegistry,@@ -20,12 +25,7 @@ import {} from '@/store/connections'import { notifyError } from '@/store/notifications'-// Direct glyphs are faster for the common local + a few remote machines. At-// larger fleet sizes, one stable-width select prevents sources from crowding-// profiles and the create/manage actions out of the sidebar foot.-const CONNECTION_DROPDOWN_THRESHOLD = 5--export function ConnectionSwitcher() {+export function ConnectionSwitcher({ onConnect }: { onConnect: () => void }) {const { t } = useI18n()const registry = useStore($connectionsRegistry)const activeConnectionId = useStore($activeConnectionId)@@ -49,6 +49,8 @@ export function ConnectionSwitcher() {return null}+ const activeConnection = connections.find(connection => connection.id === activeConnectionId)+const choose = (connectionId: string) => {triggerHaptic('selection')const connection = connections.find(candidate => candidate.id === connectionId)@@ -58,108 +60,84 @@ export function ConnectionSwitcher() {)}- if (connections.length > CONNECTION_DROPDOWN_THRESHOLD) {- return (- <div- aria-busy={pendingConnectionId !== null}- aria-label={t.settings.connections.title}- className="min-w-0 shrink"- role="group"- >- <Select onValueChange={choose} value={activeConnectionId ?? ''}>- <SelectTrigger aria-label={t.settings.connections.title} className="w-28 max-w-full" size="xs">- <span className="flex min-w-0 items-center gap-1.5">- {pendingConnectionId && <Loader2 aria-hidden="true" className="size-3 shrink-0 animate-spin" />}- <SelectValue placeholder={t.settings.connections.title} />- </span>- </SelectTrigger>- <SelectContent collisionPadding={{ bottom: 44, left: 8, right: 8, top: 8 }} side="top">- {connections.map(connection => (- <SelectItem key={connection.id} value={connection.id}>- <ConnectionLabel connection={connection} />- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- )- }-return (<div+ aria-busy={pendingConnectionId !== null}aria-label={t.settings.connections.title}- className="flex shrink-0 items-center gap-1"+ className="min-w-20 max-w-[46%] shrink overflow-hidden"data-slot="connection-switcher"role="group">- {connections.map(connection => (- <ConnectionButton- active={connection.id === activeConnectionId}- connection={connection}- key={connection.id}- onSelect={() => choose(connection.id)}- pending={connection.id === pendingConnectionId}- />- ))}+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ aria-label={+ activeConnection+ ? `${t.settings.connections.title}: ${activeConnection.label}`+ : t.settings.connections.title+ }+ className="w-full min-w-0 justify-between overflow-hidden px-1 text-(--ui-text-secondary) data-[state=open]:bg-(--ui-control-active-background) data-[state=open]:text-foreground"+ size="xs"+ type="button"+ variant="ghost"+ >+ <span className="flex min-w-0 flex-1 items-center gap-1 overflow-hidden">+ {pendingConnectionId && <Loader2 aria-hidden="true" className="size-3 shrink-0 animate-spin" />}+ {activeConnection ? (+ <ConnectionLabel connection={activeConnection} />+ ) : (+ <span className="truncate">{t.settings.connections.title}</span>+ )}+ </span>+ <Codicon aria-hidden="true" className="shrink-0 opacity-60" name="chevron-down" size="0.875rem" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="min-w-52 max-w-72" collisionPadding={8} side="top">+ <DropdownMenuItem onSelect={onConnect}>+ <span className="flex min-w-0 items-center gap-1.5 text-(--ui-text-secondary)">+ <Codicon aria-hidden="true" name="plug" size="0.875rem" />+ <span className="truncate">{t.profiles.connectGateway}</span>+ </span>+ </DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuRadioGroup onValueChange={choose} value={activeConnectionId ?? ''}>+ {connections.map(connection => (+ <DropdownMenuRadioItem className="min-w-0" key={connection.id} value={connection.id}>+ <ConnectionLabel connection={connection} />+ </DropdownMenuRadioItem>+ ))}+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu></div>)}-function ConnectionButton({- active,- connection,- onSelect,- pending-}: {- active: boolean- connection: DesktopRegistryConnection- onSelect: () => void- pending: boolean-}) {- const { t } = useI18n()- const label = t.profiles.switchToConnection(connection.label)-- return (- <Tip label={label}>- <Button- aria-busy={pending}- aria-label={label}- aria-pressed={active}- className={cn(- 'bg-transparent text-(--ui-text-tertiary) hover:bg-(--ui-control-hover-background) hover:text-foreground',- active && 'bg-(--ui-control-active-background) text-foreground'- )}- onClick={onSelect}- size="icon-xs"- type="button"- variant="ghost"- >- {pending ? (- <Loader2 aria-hidden="true" className="size-3.5 animate-spin" />- ) : (- <ConnectionGlyph connection={connection} />- )}- </Button>- </Tip>- )-}-function ConnectionGlyph({ connection }: { connection: DesktopRegistryConnection }) {- const local = connection.kind === 'local'+ const Icon =+ connection.kind === 'local'+ ? Monitor+ : connection.kind === 'cloud'+ ? Cloud+ : connection.kind === 'ssh'+ ? Terminal+ : Networkreturn (- <ProfileGlyph+ <spanaria-hidden="true"- color={local ? null : profileColor(`connection:${connection.id}`)}- isDefault={local}- name={connection.label}- />+ className="grid size-3.5 shrink-0 place-items-center text-(--ui-text-quaternary)"+ data-connection-kind={connection.kind}+ data-slot="connection-glyph"+ >+ <Icon className="size-3" />+ </span>)}function ConnectionLabel({ connection }: { connection: DesktopRegistryConnection }) {return (- <span className="flex min-w-0 items-center gap-1.5">+ <span className="flex min-w-0 flex-1 items-center gap-1 overflow-hidden"><ConnectionGlyph connection={connection} /><span className="truncate">{connection.label}</span></span>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.tsxindex 69384133123..324008803cc 100644--- a/apps/desktop/src/app/chat/sidebar/profile-rail-connect.test.tsx+++ b/apps/desktop/src/app/chat/sidebar/profile-rail-connect.test.tsx@@ -4,8 +4,6 @@ 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@@ -84,6 +82,14 @@ vi.mock('../../profiles/rename-profile-dialog', () => ({ RenameProfileDialog: ()const { $hasMultipleConnections } = await import('@/store/connections')const hasMultipleConnections = $hasMultipleConnections as ReturnType<typeof atom<boolean>>+const { $profiles } = await import('@/store/profile')+const profiles = $profiles as ReturnType<typeof atom<Array<{ is_default: boolean; name: string }>>>++afterEach(() => {+ cleanup()+ hasMultipleConnections.set(false)+ profiles.set([{ is_default: true, name: 'default' }])+})describe('ProfileRail multi-gateway entry point', () => {it('deep-links to the unified Settings → Gateways page from the rail', () => {@@ -109,6 +115,39 @@ describe('ProfileRail multi-gateway entry point', () => {render(<ProfileRail />)expect(screen.queryByRole('button', { name: 'default' })).toBeNull()+ expect(screen.queryByRole('button', { name: 'Connect another Hermes gateway…' })).toBeNull()expect(screen.getByRole('button', { name: 'Manage profiles…' })).toBeTruthy()})++ it('keeps thirteen profiles direct and condenses the fourteenth', () => {+ profiles.set([+ { is_default: true, name: 'default' },+ ...Array.from({ length: 12 }, (_, index) => ({ is_default: false, name: `Profile ${index + 1}` }))+ ])+ const { unmount } = render(<ProfileRail />)++ expect(screen.queryByRole('button', { name: 'Profiles' })).toBeNull()+ expect(screen.getByRole('button', { name: 'Profile 12' })).toBeTruthy()+ unmount()++ profiles.set([+ { is_default: true, name: 'default' },+ ...Array.from({ length: 13 }, (_, index) => ({ is_default: false, name: `Profile ${index + 1}` }))+ ])+ render(<ProfileRail />)++ expect(screen.getByRole('button', { name: 'Profiles' })).toBeTruthy()+ })++ it('stays shrinkable when source and condensed profile controls coexist', () => {+ hasMultipleConnections.set(true)+ profiles.set([+ { is_default: true, name: 'default' },+ ...Array.from({ length: 13 }, (_, index) => ({ is_default: false, name: `Profile ${index + 1}` }))+ ])+ render(<ProfileRail />)++ expect(screen.getByRole('group', { name: 'Profiles' }).className).toContain('min-w-0')+ expect(screen.getByRole('button', { name: 'Profiles' })).toBeTruthy()+ })})diff --git a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsxindex 1f40dd889bb..924bda27cdf 100644--- a/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx+++ b/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx@@ -28,9 +28,17 @@ import { Codicon } from '@/components/ui/codicon'import { ColorSwatches } from '@/components/ui/color-swatches'import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from '@/components/ui/context-menu'import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog'+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuRadioGroup,+ DropdownMenuRadioItem,+ DropdownMenuSeparator,+ DropdownMenuTrigger+} from '@/components/ui/dropdown-menu'import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover'import { ProfileGlyph } from '@/components/ui/profile-glyph'-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'import { Tip, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'import { getProfileSoul, updateProfileSoul } from '@/hermes'import { useI18n } from '@/i18n'@@ -78,7 +86,7 @@ const RAIL_GAP = 4 // px — matches gap-1 between squares.// Past this many profiles the strip of colored squares stops scaling (tiny// drag targets, endless horizontal scroll), so the rail collapses to a compact-// select. Drag-reorder and long-press-recolor live only on the squares path.+// menu. Drag-reorder and long-press-recolor live only on the squares path.const PROFILE_DROPDOWN_THRESHOLD = 13// Neighbors reflow on RAIL_TRANSITION; the dragged square glides between@@ -107,10 +115,10 @@ const stepThroughCells: Modifier = ({ containerNodeRect, draggingNodeRect, trans// Arc-Spaces-style profile rail at the sidebar foot: a default↔all toggle pinned// left, the colored named profiles scrolling between, and Manage pinned right.// The active profile pops in its own color — the "where am I" cue. Single--// source users see the default home, "+", and Manage; with several sources the-// active source glyph replaces that redundant home. Colored named squares and-// the default↔all toggle only appear once a second profile exists on the active-// source.+// source users see the default home, "+", and Manage. With several sources, a+// named environment selector sits before a separator; square profile identities+// follow it. Colored named squares and the default↔all toggle only appear once+// a second profile exists on the active source.export function ProfileRail() {const { t } = useI18n()const p = t.profiles@@ -234,8 +242,8 @@ export function ProfileRail() {}, [createRequest])return (- <div aria-label={p.title} className="flex items-center gap-0.5" data-slot="profile-rail" role="group">- <ConnectionSwitcher />+ <div aria-label={p.title} className="flex min-w-0 items-center gap-0.5" data-slot="profile-rail" role="group">+ <ConnectionSwitcher onConnect={() => navigate(`${SETTINGS_ROUTE}?tab=connections`)} />{multipleConnections && <span aria-hidden="true" className="mx-0.5 h-3.5 w-px bg-(--ui-stroke-tertiary)" />}{/* One button toggles default ↔ all: home face when scoped to a profile,layers face when showing everything. Pinned left like Manage is right.@@ -272,11 +280,11 @@ export function ProfileRail() {<ProfileDropdownactiveKey={isAll ? null : activeKey}colors={colors}+ onCreate={() => setCreateOpen(true)}+ onImport={() => void runImportProfileFlow()}onSelect={selectProfile}profiles={named}/>- <AddProfileButton label={p.newProfile} onClick={() => setCreateOpen(true)} />- <ImportProfileButton label={p.importProfile} /></div>) : (<div@@ -325,18 +333,17 @@ 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 → Gateways (the connections registry lives on the unified- Gateways page now). 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=gateway`)}- />+ {/* Multi-gateway discoverability: before a second source exists, a plug+ pinned beside Manage deep-links to the unified Gateways page. Once+ there are several sources, the same action lives in their selector. */}+ {!multipleConnections && (+ <ProfilePill+ active={false}+ glyph="plug"+ label={p.connectGateway}+ onSelect={() => navigate(`${SETTINGS_ROUTE}?tab=gateway`)}+ />+ )}{/* Land in the new profile on a fresh chat (selectProfile triggers thenew-session reset), not stuck on the session you were just in. */}@@ -481,17 +488,21 @@ function ImportProfileButton({ label }: { label: string }) {)}-// The condensed rail: every named profile in one compact select. The trigger+// The condensed rail: every named profile in one compact menu. The trigger// shows the active profile (tinted initial + name); on default/all scope it// falls back to the placeholder since the left toggle pill carries that state.function ProfileDropdown({activeKey,colors,+ onCreate,+ onImport,onSelect,profiles}: {activeKey: null | stringcolors: Record<string, string>+ onCreate: () => void+ onImport: () => voidonSelect: (name: string) => voidprofiles: ProfileInfo[]}) {@@ -499,23 +510,59 @@ function ProfileDropdown({const p = t.profilesconst value = activeKey ? (profiles.find(profile => normalizeProfileKey(profile.name) === activeKey)?.name ?? '') : ''+ const activeProfile = profiles.find(profile => profile.name === value)return (- <Select onValueChange={name => name && onSelect(name)} value={value}>- <SelectTrigger aria-label={p.title} className="min-w-0 flex-1" size="xs">- <SelectValue placeholder={p.title} />- </SelectTrigger>- <SelectContent collisionPadding={{ bottom: 44, left: 8, right: 8, top: 8 }} side="top">- {profiles.map(profile => (- <ProfileDropdownItem- color={resolveProfileColor(profile.name, colors)}- key={profile.name}- label={profileLabel(profile)}- name={profile.name}- />- ))}- </SelectContent>- </Select>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button+ aria-label={p.title}+ className="min-w-0 flex-1 justify-between overflow-hidden px-1 text-(--ui-text-secondary) data-[state=open]:bg-(--ui-control-active-background) data-[state=open]:text-foreground"+ data-slot="profile-dropdown"+ size="xs"+ type="button"+ variant="ghost"+ >+ <span className="flex min-w-0 flex-1 items-center gap-1 overflow-hidden">+ {activeProfile ? (+ <>+ <ProfileGlyph+ aria-hidden="true"+ color={resolveProfileColor(activeProfile.name, colors)}+ isDefault={false}+ name={activeProfile.name}+ />+ <span className="truncate">{profileLabel(activeProfile)}</span>+ </>+ ) : (+ <span className="truncate">{p.title}</span>+ )}+ </span>+ <Codicon aria-hidden="true" className="shrink-0 opacity-60" name="chevron-down" size="0.875rem" />+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="min-w-48 max-w-72" collisionPadding={8} side="top">+ <DropdownMenuItem onSelect={onCreate}>+ <Codicon aria-hidden="true" name="add" size="0.875rem" />+ <span className="truncate">{p.newProfile}</span>+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={onImport}>+ <Codicon aria-hidden="true" name="cloud-download" size="0.875rem" />+ <span className="truncate">{p.importProfile}</span>+ </DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuRadioGroup onValueChange={name => name && onSelect(name)} value={value}>+ {profiles.map(profile => (+ <ProfileDropdownItem+ color={resolveProfileColor(profile.name, colors)}+ key={profile.name}+ label={profileLabel(profile)}+ name={profile.name}+ />+ ))}+ </DropdownMenuRadioGroup>+ </DropdownMenuContent>+ </DropdownMenu>)}@@ -525,12 +572,17 @@ function ProfileDropdownItem({ color, label, name }: { color: null | string; labconst { cancelPrewarm, startPrewarm } = useProfilePrewarm(name)return (- <SelectItem onPointerEnter={startPrewarm} onPointerLeave={cancelPrewarm} value={name}>+ <DropdownMenuRadioItem+ className="min-w-0"+ onPointerEnter={startPrewarm}+ onPointerLeave={cancelPrewarm}+ value={name}+ ><span className="flex min-w-0 items-center gap-1.5"><ProfileGlyph aria-hidden="true" color={color} isDefault={false} name={name} /><span className="truncate">{label}</span></span>- </SelectItem>+ </DropdownMenuRadioItem>)}diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex af9a488b87c..a7857e7c862 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -302,7 +302,7 @@ Gateway connections are **machine-level**: the Gateways page manages which gatewFurther down the same **Settings → Gateways** page, the connections registry manages a named list of every agent source the app knows about — the local runtime, any number of remote gateways (LAN, Tailscale, internet), Hermes Cloud instances, and SSH hosts — all persisted together in one place. You can jump there from the plug button at the right end of the sidebar profile rail (**Connect another Hermes gateway…**) or via **⌘K → Gateways**. The full guide, including the union agent roster, `@name-device` handles, fleet-wide updates, and the plugin SDK surface, is at [Connecting Desktop to Many Hermes Instances](./multi-connection-desktop.md).- **Every connection needs a unique name** (a device name such as "Homelab" or "Work laptop"). When the same profile name exists on several registered sources, surfaces disambiguate it as `@profile-device` (e.g. `@research-homelab`).-- **Switch sources from the Sessions sidebar.** The named selector appears when more than one source is registered; the adjacent profile rail then shows only that source's agents and remembers the last profile used there.+- **Switch sources from the Sessions sidebar.** A named source selector appears when more than one source is registered and handles any registry size without making gateways look like profiles. The adjacent profile rail then shows only that source's agents and remembers the last profile used there; large profile sets condense independently.- **Add / edit / remove / test** connections from the panel. The **Add** flow offers all four kinds — **Local**, **Hermes Cloud**, **Remote gateway**, and **SSH** (the Local button is disabled while the app-managed local entry exists, and a hint points cloud adds at the sign-in/discovery flow above). The local entry is managed by the app and cannot be removed. **Test** probes the connection's own HTTP and WebSocket legs directly.- **Duplicates are rejected at save time**: only one **local** entry ever; remote and cloud entries are deduplicated on the normalized URL (trimmed, trailing slashes stripped, lowercased — across both kinds); SSH entries on the normalized `user@host:port` plus remote profile.- Existing settings are **imported automatically** the first time you run a build with the registry: your current global connection and any legacy per-profile overrides become named entries. The legacy settings file is left untouched, so older builds keep working.diff --git a/website/docs/user-guide/multi-connection-desktop.md b/website/docs/user-guide/multi-connection-desktop.mdindex e712feb955a..0b34a4135c2 100644--- a/website/docs/user-guide/multi-connection-desktop.md+++ b/website/docs/user-guide/multi-connection-desktop.md@@ -161,13 +161,18 @@ that live on one source.- With one registered source, no source control is added. Local-only Desktopkeeps the same profile rail and keyboard flow as before.-- With up to five sources, the sidebar shows direct source glyphs: a home for- **This device**, then stable initials for named sources. Larger registries- collapse into one source menu so profiles and actions are not crowded out.+- With several sources, the sidebar shows one named source selector. Its device,+ cloud, network, or terminal icon identifies the connection type; profile+ avatars remain a separate control after the divider. The same selector scales+ from two sources to a larger fleet without turning backends into profile-like+ glyphs or crowding profile actions out of the rail.- Selecting a source restores the last profile used there. The profile railthen shows only that source's profiles; the home pill returns to its defaultprofile and the layers pill shows **All profiles on this source**.**Cmd/Ctrl+1–9** continue to switch profiles within the active source.+- With more than thirteen profiles on the active source, their avatar strip+ condenses into a named profile selector. Large source and profile sets can+ therefore coexist without changing the **source → profile → sessions** model.- **This device** remains a first-class source even when a remote connection isPrimary. It can keep local sessions available during a remote outage, but theapp does not call it "offline mode": the selected model or tools may still