Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
Console shell: Settings in the main nav, and a top bar with search and docs
Simon Flackfe715a34e582
diff --git a/console/apps/switch-console-desktop/src/renderer/app/workspace.tsx b/console/apps/switch-console-desktop/src/renderer/app/workspace.tsxindex 12d3dc276..a5453f039 100644--- a/console/apps/switch-console-desktop/src/renderer/app/workspace.tsx+++ b/console/apps/switch-console-desktop/src/renderer/app/workspace.tsx@@ -5,6 +5,7 @@ import { OnboardingFlow } from '@renderer/features/onboarding/onboarding-flow';import { OnboardingIntro } from '@renderer/features/onboarding/onboarding-intro';import { onboardingStore } from '@renderer/features/onboarding/onboarding-store';import { LeftSidebar } from '@renderer/features/sidebar/left-sidebar';+import { WorkspaceTopBar } from '@renderer/features/sidebar/workspace-top-bar';import { BuddyIntroDialog } from '@renderer/features/switch-buddy/buddy-intro-dialog';import { RoomEmbedLayer } from '@renderer/features/switch-rooms/room-embed-layer';import { FrozenBanner, frozenServer } from '@renderer/features/switch-servers/frozen-workspace';@@ -138,6 +139,7 @@ const Shell = observer(function Shell({ mainContent }: { mainContent: ReactNode<><WorkspaceLayoutleftSidebar={<LeftSidebar />}+ topBar={<WorkspaceTopBar />}mainContent={mainContent}persistentLayer={<RoomEmbedLayer />}banner={frozen ? <FrozenBanner server={frozen} /> : null}diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/left-sidebar.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/left-sidebar.tsxindex 9750b7793..bcc6a530b 100644--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/left-sidebar.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/left-sidebar.tsx@@ -1,14 +1,10 @@-import { ArrowUpRight, BookOpen, FolderInput, Settings } from 'lucide-react';+import { FolderInput } from 'lucide-react';import { observer } from 'mobx-react-lite';import React from 'react';import { SidebarOnboardingChecklist } from '@renderer/features/onboarding/sidebar-onboarding-checklist';-import { isCurrentView, useNavigate } from '@renderer/lib/layout/navigation-provider';-import { useWorkspaceSlots } from '@renderer/lib/layout/workspace-slots';-import { openExternalUrl } from '@renderer/lib/open-external';+import { useNavigate } from '@renderer/lib/layout/navigation-provider';import { SwitchConsoleMark } from '@renderer/lib/switch-console-mark';-import { BoundShortcut } from '@renderer/lib/ui/shortcut';import { cn } from '@renderer/utils/utils';-import { SWITCH_CONSOLE_DOCS_URL } from '@shared/urls';import { FROZEN, isFrozenServer } from '../switch-servers/managed-server-state';import { switchServersStore } from '../switch-servers/switch-servers-store';import { WorkspaceSwitcher } from '../switch-servers/workspace-switcher';@@ -19,13 +15,10 @@ import { SidebarGroupedList, useAgentManagementMode } from './sidebar-grouped-liimport {SidebarContainer,SidebarContent,- SidebarFooter,SidebarGroup,SidebarGroupContent,SidebarMenu,- SidebarMenuButton,} from './sidebar-primitives';-import { SidebarSearchTrigger } from './sidebar-search-trigger';import { SidebarSpace } from './sidebar-space';import { UpdateSection } from './update-section';import { useSidebarDrop } from './use-sidebar-drop';@@ -33,7 +26,6 @@ import { WorkspaceNav } from './workspace-nav';export const LeftSidebar: React.FC = observer(function LeftSidebar() {const { navigate } = useNavigate();- const { currentView } = useWorkspaceSlots();const { isDragOver, onDragOver, onDragEnter, onDragLeave, onDrop } = useSidebarDrop();const managementMode = useAgentManagementMode();@@ -84,38 +76,6 @@ export const LeftSidebar: React.FC = observer(function LeftSidebar() {</SidebarGroup></SidebarContent><SidebarOnboardingChecklist />- <SidebarFooter>- <SidebarMenu>- <SidebarSearchTrigger />- <SidebarMenuButton- isActive={- isCurrentView(currentView, 'settings') || isCurrentView(currentView, 'remoteHost')- }- onClick={() => navigate('settings')}- aria-label="Settings"- className="w-full justify-between"- >- <span className="flex items-center gap-2">- <Settings className="h-5 w-5 sm:h-4 sm:w-4" />- Settings- </span>- <BoundShortcut settingsKey="settings" />- </SidebarMenuButton>- <SidebarMenuButton- onClick={() =>- openExternalUrl(SWITCH_CONSOLE_DOCS_URL, 'Could not open the documentation')- }- aria-label="Docs"- className="w-full justify-between"- >- <span className="flex items-center gap-2">- <BookOpen className="h-5 w-5 sm:h-4 sm:w-4" />- Docs- </span>- <ArrowUpRight className="size-3 text-foreground-muted" />- </SidebarMenuButton>- </SidebarMenu>- </SidebarFooter><div className="flex items-center justify-between gap-2 px-3 py-2">{/* The mark doubles as the way back to the welcome screen — the oneview with no other entry point once you have navigated away. */}diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-search-trigger.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-search-trigger.tsxdeleted file mode 100644index 6fca11f81..000000000--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-search-trigger.tsx+++ /dev/null@@ -1,42 +0,0 @@-import { Search } from 'lucide-react';-import { observer } from 'mobx-react-lite';-import { useParams } from '@renderer/lib/layout/navigation-provider';-import { useWorkspaceSlots } from '@renderer/lib/layout/workspace-slots';-import { useShowModal } from '@renderer/lib/modal/modal-provider';-import { BoundShortcut } from '@renderer/lib/ui/shortcut';-import { SidebarMenuButton } from './sidebar-primitives';--export const SidebarSearchTrigger = observer(function SidebarSearchTrigger() {- const showCommandPalette = useShowModal('commandPaletteModal');- const { currentView } = useWorkspaceSlots();- const { params: sessionParams } = useParams('session');- const { params: locationParams } = useParams('location');-- const currentLocationId =- currentView === 'session'- ? sessionParams.locationId- : currentView === 'location'- ? locationParams.locationId- : undefined;- const currentSessionId = currentView === 'session' ? sessionParams.sessionId : undefined;-- return (- <SidebarMenuButton- isActive={false}- onClick={() =>- showCommandPalette({- locationId: currentLocationId,- sessionId: currentSessionId,- })- }- aria-label="Search"- className="w-full justify-between"- >- <span className="flex min-w-0 items-center gap-2">- <Search className="h-5 w-5 shrink-0 sm:h-4 sm:w-4" />- <span className="truncate">Search…</span>- </span>- <BoundShortcut settingsKey="commandPalette" />- </SidebarMenuButton>- );-});diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav-views.ts b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav-views.tsindex e84eb4338..c2c455680 100644--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav-views.ts+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav-views.ts@@ -2,48 +2,36 @@ export type WorkspaceNavView =| 'server'| 'serverAgents'| 'serverRooms'- | 'connectors'| 'templates'+ | 'connectors'| 'admin';/**- * The active server's destinations, in order. Connectors follows Your Rooms+ * The active server's destinations, in order. Connectors follows Templates* only where the server has service connections on: with them off its routes- * are not mounted, so there is nothing to show. Admin is for whoever- * administers the workspace (the server's operator among them) where service- * connections are on, its connector settings needing them, and for whoever- * runs the server from this Console, whose status is under Admin's Server- * heading: the others are run by someone else, and there is nothing here to- * start, stop or update.+ * are not mounted, so there is nothing to show.+ *+ * Admin holds only what has no other home yet. Workspace and server settings+ * belong to the server's web gateway; what is still here is the workspace's+ * connector switches, for whoever administers the workspace (the gateway has+ * no page for them yet), and connector apps for the operator of a Switch this+ * Console runs without a gateway of its own. A Switch this Console runs is+ * operated from Settings → System status, not from here.*/export function workspaceNavViews(server: {- managed: boolean;serviceConnections: boolean;administers: boolean;+ /** The operator of a Switch this Console runs that serves no web gateway. */+ operatesGatewaylessServer: boolean;}): WorkspaceNavView[] {- const admin = (server.serviceConnections && server.administers) || server.managed;+ const admin =+ server.serviceConnections && (server.administers || server.operatesGatewaylessServer);return ['server','serverAgents','serverRooms',- ...(server.serviceConnections ? (['connectors'] as const) : []),'templates',+ ...(server.serviceConnections ? (['connectors'] as const) : []),...(admin ? (['admin'] as const) : []),];}--/**- * Where the sidebar's Admin opens: the Admin page, on the first section the- * person may use, or the status of the server this Console runs where they- * have no section of their own. While that server can't answer it is always- * the status, the one entry that works without it.- */-export function adminNavTarget(server: {- serviceConnections: boolean;- administers: boolean;- frozen: boolean;-}): 'admin' | 'managedServer' {- return server.serviceConnections && server.administers && !server.frozen- ? 'admin'- : 'managedServer';-}diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsxindex 92c2447e8..f4a4f0fdf 100644--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-nav.tsx@@ -1,24 +1,40 @@-import { Bot, DoorOpen, FileText, House, type LucideIcon, Plug, ShieldCheck } from 'lucide-react';+import {+ Bot,+ DoorOpen,+ FileText,+ House,+ type LucideIcon,+ Plug,+ Settings,+ ShieldCheck,+} from 'lucide-react';import { observer } from 'mobx-react-lite';import { useRoomHealth } from '@renderer/features/switch-rooms/connection-health';import { ManagedServerDot } from '@renderer/features/switch-servers/managed-server-dot';import { FROZEN, isFrozenServer } from '@renderer/features/switch-servers/managed-server-state';+import { servesWebGateway } from '@renderer/features/switch-servers/server-gateway';import { switchServersStore } from '@renderer/features/switch-servers/switch-servers-store';-import { administersWorkspaceInScope } from '@renderer/features/switch-servers/workspace-admin';+import {+ administersWorkspaceInScope,+ operatesServer,+} from '@renderer/features/switch-servers/workspace-admin';import { useFeatureFlags } from '@renderer/lib/hooks/useFeatureFlags';import { isCurrentView, useNavigate, useParams } from '@renderer/lib/layout/navigation-provider';import { useWorkspaceSlots } from '@renderer/lib/layout/workspace-slots';+import { BoundShortcut } from '@renderer/lib/ui/shortcut';import { cn } from '@renderer/utils/utils';import { connectionNeedsAttention } from '@shared/core/switch-rooms/connection-health';import { SidebarMenu, SidebarMenuButton } from './sidebar-primitives';-import { adminNavTarget, type WorkspaceNavView, workspaceNavViews } from './workspace-nav-views';+import { type WorkspaceNavView, workspaceNavViews } from './workspace-nav-views';/**- * The active server's own destinations, under the workspace switcher.+ * The active server's own destinations, under the workspace switcher, and+ * Settings last.*- * Three places, not a tree: the server's Home, everything it has registered as- * an agent, and everywhere those agents work. The section is deliberately flat- * and short — the sessions tree below is where depth belongs.+ * Flat and short — the sessions tree below is where depth belongs. Settings is+ * here rather than in the footer, and is here even with no server at all: it is+ * about this computer and this person, so it works without one. It carries the+ * status of a Switch this Console runs, which is operated from Settings.*/export const WorkspaceNav = observer(function WorkspaceNav() {const { navigate } = useNavigate();@@ -29,22 +45,13 @@ export const WorkspaceNav = observer(function WorkspaceNav() {const { params: connectorsParams } = useParams('connectors');const { params: templatesParams } = useParams('templates');const { params: adminParams } = useParams('admin');- const { params: managedServerParams } = useParams('managedServer');const active = switchServersStore.activeServer;const health = useRoomHealth(active?.id ?? null);const serviceConnections = useFeatureFlags(active?.id ?? null).service_connections;const warningCount =health.data?.agents.filter((agent) => connectionNeedsAttention(agent.state)).length ?? 0;- if (!active) return null;- // While the server can't answer, only the way to it stays live.- const frozen = isFrozenServer(active);-- const administers = administersWorkspaceInScope(active.id);- // Admin also holds the status of a server this Console runs, a view of its own.- const adminTarget = adminNavTarget({ serviceConnections, administers, frozen });- const onAdmin = isCurrentView(currentView, 'admin') && adminParams?.serverId === active.id;- const onStatus =- isCurrentView(currentView, 'managedServer') && managedServerParams?.serverId === active.id;+ // While the server can't answer, only Settings — where it is operated — stays live.+ const frozen = active !== null && isFrozenServer(active);const destinations: Record<WorkspaceNavView,@@ -53,46 +60,60 @@ export const WorkspaceNav = observer(function WorkspaceNav() {server: { icon: House, label: 'Home', params: homeParams },serverAgents: { icon: Bot, label: 'Your Agents', params: agentsParams },serverRooms: { icon: DoorOpen, label: 'Your Rooms', params: roomsParams },- connectors: { icon: Plug, label: 'Connectors', params: connectorsParams },templates: { icon: FileText, label: 'Templates', params: templatesParams },+ connectors: { icon: Plug, label: 'Connectors', params: connectorsParams },admin: { icon: ShieldCheck, label: 'Admin', params: adminParams },};- const shown = workspaceNavViews({ managed: active.managed, serviceConnections, administers });+ const shown = active+ ? workspaceNavViews({+ serviceConnections,+ administers: administersWorkspaceInScope(active.id),+ operatesGatewaylessServer: operatesServer(active.id) && !servesWebGateway(active),+ })+ : [];+ const onSettings =+ isCurrentView(currentView, 'settings') ||+ isCurrentView(currentView, 'remoteHost') ||+ isCurrentView(currentView, 'managedServer');return (<SidebarMenu className="flex flex-col gap-[2px] px-2 pt-2">- {shown.map((view) => {- const { icon: Icon, label, params } = destinations[view];- return (- <SidebarMenuButton- key={view}- isActive={- view === 'admin'- ? onAdmin || onStatus- : isCurrentView(currentView, view) && params?.serverId === active.id- }- onClick={() => navigate(view === 'admin' ? adminTarget : view, { serverId: active.id })}- className={cn(frozen && view !== 'admin' && FROZEN)}- >- <Icon className="size-[15px] shrink-0" />- {label}- {view === 'admin' && active.managed && (- <span className="ml-auto flex items-center pr-0.5">- <ManagedServerDot server={active} size={7} />- </span>- )}- {view === 'serverAgents' && (warningCount > 0 || health.isError) && (- <span- className="ml-auto text-xs text-foreground-warning"- title="Agent room connections need attention"- aria-label="Agent room connections need attention"- >- {health.isError ? '!' : warningCount}- </span>- )}- </SidebarMenuButton>- );- })}+ {active &&+ shown.map((view) => {+ const { icon: Icon, label, params } = destinations[view];+ return (+ <SidebarMenuButton+ key={view}+ isActive={isCurrentView(currentView, view) && params?.serverId === active.id}+ onClick={() => navigate(view, { serverId: active.id })}+ className={cn(frozen && FROZEN)}+ >+ <Icon className="size-[15px] shrink-0" />+ {label}+ {view === 'serverAgents' && (warningCount > 0 || health.isError) && (+ <span+ className="ml-auto text-xs text-foreground-warning"+ title="Agent room connections need attention"+ aria-label="Agent room connections need attention"+ >+ {health.isError ? '!' : warningCount}+ </span>+ )}+ </SidebarMenuButton>+ );+ })}+ <SidebarMenuButton+ isActive={onSettings}+ onClick={() => navigate('settings')}+ aria-label="Settings"+ >+ <Settings className="size-[15px] shrink-0" />+ Settings+ <span className="ml-auto flex items-center gap-1.5 pr-0.5">+ {active?.managed && <ManagedServerDot server={active} size={7} />}+ <BoundShortcut settingsKey="settings" />+ </span>+ </SidebarMenuButton></SidebarMenu>);});diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-top-bar.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-top-bar.tsxnew file mode 100644index 000000000..3b44cdbd2--- /dev/null+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/workspace-top-bar.tsx@@ -0,0 +1,109 @@+import { detectPlatform } from '@tanstack/react-hotkeys';+import { BookOpen, PanelLeft, Search } from 'lucide-react';+import { observer } from 'mobx-react-lite';+import { NavButtons } from '@renderer/lib/components/nav-buttons';+import { useWorkspaceLayoutContext } from '@renderer/lib/layout/layout-provider';+import { useParams } from '@renderer/lib/layout/navigation-provider';+import { useWorkspaceSlots } from '@renderer/lib/layout/workspace-slots';+import { useShowModal } from '@renderer/lib/modal/modal-provider';+import { openExternalUrl } from '@renderer/lib/open-external';+import { Button } from '@renderer/lib/ui/button';+import { BoundShortcut } from '@renderer/lib/ui/shortcut';+import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/lib/ui/tooltip';+import { cn } from '@renderer/utils/utils';+import { SWITCH_CONSOLE_DOCS_URL } from '@shared/urls';++const isMac = detectPlatform() === 'mac';++/**+ * Opens the command palette scoped to wherever you are: the session or the+ * agent's folder on screen, when there is one, so its results lead with them.+ */+export function useOpenCommandPalette(): () => void {+ const showCommandPalette = useShowModal('commandPaletteModal');+ const { currentView } = useWorkspaceSlots();+ const { params: sessionParams } = useParams('session');+ const { params: locationParams } = useParams('location');+ const locationId =+ currentView === 'session'+ ? sessionParams.locationId+ : currentView === 'location'+ ? locationParams.locationId+ : undefined;+ const sessionId = currentView === 'session' ? sessionParams.sessionId : undefined;+ return () => showCommandPalette({ locationId, sessionId });+}++/**+ * The strip across the top of the window, above the content card: search in+ * the middle, the docs on the right. It is part of the window's chrome, so it+ * drags the window everywhere its controls are not.+ *+ * With the sidebar collapsed the sidebar's own top strip is gone, so its+ * toggle and the back/forward buttons sit here instead — clear of the macOS+ * window buttons, which are drawn over this corner.+ */+export const WorkspaceTopBar = observer(function WorkspaceTopBar() {+ const { isLeftOpen, setCollapsed } = useWorkspaceLayoutContext();+ const openCommandPalette = useOpenCommandPalette();+ return (+ <div className="grid h-11 shrink-0 grid-cols-[1fr_minmax(0,420px)_1fr] items-center gap-3 pr-2 [-webkit-app-region:drag]">+ <div className={cn('flex min-w-0 items-center gap-0.5', !isLeftOpen && isMac && 'pl-[70px]')}>+ {!isLeftOpen && (+ <div className="flex items-center gap-0.5 [-webkit-app-region:no-drag]">+ <Tooltip>+ <TooltipTrigger+ render={+ <Button+ variant="ghost"+ size="sm"+ className="size-7 p-0"+ aria-label="Toggle left sidebar"+ onClick={() => setCollapsed('left', isLeftOpen)}+ >+ <PanelLeft className="h-4 w-4" />+ </Button>+ }+ />+ <TooltipContent>+ Toggle left sidebar+ <BoundShortcut settingsKey="toggleLeftSidebar" variant="badge" />+ </TooltipContent>+ </Tooltip>+ <NavButtons />+ </div>+ )}+ </div>+ <button+ type="button"+ onClick={openCommandPalette}+ aria-label="Search"+ className="flex h-7 min-w-0 cursor-pointer items-center gap-2 rounded-lg bg-[var(--sel-soft)] px-2 text-xs text-foreground-passive transition-colors [-webkit-app-region:no-drag] hover:bg-[var(--sel)]"+ >+ <Search className="size-3.5 shrink-0" />+ <span className="min-w-0 flex-1 truncate text-left">Search…</span>+ <BoundShortcut settingsKey="commandPalette" />+ </button>+ <div className="flex items-center justify-end gap-1">+ <Tooltip>+ <TooltipTrigger+ render={+ <Button+ variant="ghost"+ size="sm"+ className="size-7 p-0 [-webkit-app-region:no-drag]"+ aria-label="Docs"+ onClick={() =>+ openExternalUrl(SWITCH_CONSOLE_DOCS_URL, 'Could not open the documentation')+ }+ >+ <BookOpen className="h-4 w-4" />+ </Button>+ }+ />+ <TooltipContent>Docs</TooltipContent>+ </Tooltip>+ </div>+ </div>+ );+});diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/server-gateway.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/server-gateway.tsnew file mode 100644index 000000000..ee35fe09f--- /dev/null+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/server-gateway.ts@@ -0,0 +1,14 @@+import type { SwitchServer } from '@shared/core/switch-servers/switch-servers';+import { localServerStore } from './local-server-store';++/**+ * Whether a server serves its web gateway — the workspace and server settings+ * Console links out to. Every server does except a Switch this Console runs+ * without Docker: switch-core runs there without the gateway's pages, so its+ * address serves the API alone.+ */+export function servesWebGateway(+ server: Pick<SwitchServer, 'managed' | 'managementKind'>+): boolean {+ return !(server.managed && server.managementKind === 'local' && localServerStore.isNative);+}diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/view.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/view.tsxindex b17dbe457..9ab986366 100644--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/view.tsx+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/view.tsx@@ -38,6 +38,7 @@ import { localServerStore } from './local-server-store';import { MessagingAppsCard } from './MessagingAppsCard';import { openServerPage } from './open-server-page';import { remoteServerStore } from './remote-server-store';+import { servesWebGateway } from './server-gateway';import { serverIcon } from './server-icon';import { serverPlacementLabel } from './server-presentation';import { ServerSectionTitlebar } from './server-section-titlebar';@@ -177,10 +178,7 @@ const ServerMainPanel = observer(function ServerMainPanel() {// button asks for, so the page should not look idle while one is in flight.const busy = refreshingPage || store.refreshing.has(serverId);const unreachable = store.isUnreachable(serverId);- // A local server run without Docker has no dashboard: switch-core runs there- // without the dashboard's pages, so its address serves the API alone.- const servesNoDashboard =- server.managed && server.managementKind === 'local' && localServerStore.isNative;+ const servesNoDashboard = !servesWebGateway(server);const PlacementIcon = serverIcon(server);const title = workspaceTitle(server);diff --git a/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/Titlebar.tsx b/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/Titlebar.tsxindex 6a67b22e9..038a020e6 100644--- a/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/Titlebar.tsx+++ b/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/Titlebar.tsx@@ -1,11 +1,5 @@import { detectPlatform } from '@tanstack/react-hotkeys';-import { PanelLeft } from 'lucide-react';import { type ReactNode } from 'react';-import { NavButtons } from '@renderer/lib/components/nav-buttons';-import { useWorkspaceLayoutContext } from '@renderer/lib/layout/layout-provider';-import { Button } from '@renderer/lib/ui/button';-import { BoundShortcut } from '@renderer/lib/ui/shortcut';-import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/lib/ui/tooltip';import { cn } from '@renderer/utils/utils';const isLinux = detectPlatform() === 'linux';@@ -23,7 +17,6 @@ export function Titlebar({leftClassName?: string;rightClassName?: string;}) {- const { setCollapsed, isLeftOpen } = useWorkspaceLayoutContext();return (<headerclassName={cn(@@ -32,9 +25,9 @@ export function Titlebar({// divider next to the gutter that already separates panel from// sidebar.'flex h-11 shrink-0 items-center [-webkit-app-region:drag]',- // No traffic-light padding here: with the sidebar collapsed the panel- // itself now starts below them (see `WorkspaceLayout`), which also- // covers the views that render no titlebar at all.+ // No traffic-light padding and no sidebar controls here: the window's+ // top bar sits above the panel and holds both when the sidebar is+ // collapsed (see `WorkspaceTopBar`).// Linux draws its own controls flush to the right corner (no native// frame); everywhere else keep the normal right padding.isLinux ? 'pr-0' : 'pr-[18px]',@@ -42,7 +35,6 @@ export function Titlebar({)}><div className="pointer-events-auto flex min-w-0 flex-1 items-center gap-1 self-stretch">- {!isLeftOpen && <div className="[-webkit-app-region:no-drag]"></div>}<div className="flex w-full items-center justify-between self-stretch"><divclassName={cn(@@ -50,27 +42,6 @@ export function Titlebar({leftClassName)}>- {!isLeftOpen && (- <div className="ml-2 flex items-center gap-0.5 [-webkit-app-region:no-drag]">- <Tooltip>- <TooltipTrigger>- <Button- variant="ghost"- size="sm"- className="size-7 p-0"- onClick={() => setCollapsed('left', isLeftOpen)}- >- <PanelLeft className="h-4 w-4" />- </Button>- </TooltipTrigger>- <TooltipContent>- Toggle left sidebar- <BoundShortcut settingsKey="toggleLeftSidebar" variant="badge" />- </TooltipContent>- </Tooltip>- <NavButtons />- </div>- )}{leftSlot}</div><divdiff --git a/console/apps/switch-console-desktop/src/renderer/lib/layout/workspace-layout.tsx b/console/apps/switch-console-desktop/src/renderer/lib/layout/workspace-layout.tsxindex 2d4b02bac..f5d052201 100644--- a/console/apps/switch-console-desktop/src/renderer/lib/layout/workspace-layout.tsx+++ b/console/apps/switch-console-desktop/src/renderer/lib/layout/workspace-layout.tsx@@ -28,6 +28,8 @@ interface WorkspaceLayoutProps {banner: ReactNode;/** Classes for the view and the persistent layer under the banner. */contentClassName: string | undefined;+ /** The strip across the top of the window, above the card: search and docs. */+ topBar?: ReactNode;}export function WorkspaceLayout({@@ -36,6 +38,7 @@ export function WorkspaceLayout({persistentLayer = null,banner,contentClassName,+ topBar = null,}: WorkspaceLayoutProps) {const { leftPanelRef, syncLeftOpenFromPanel, isLeftOpen } = useWorkspaceLayoutContext();const { defaultLayout, onLayoutChanged } = useDefaultLayout({@@ -88,12 +91,15 @@ export function WorkspaceLayout({own corner under the close button. */}<divclassName={cn(- 'relative h-full w-full overflow-hidden pr-2 pb-2 [-webkit-app-region:drag]',- isLeftOpen ? 'pt-2 pl-px' : 'pl-2',- !isLeftOpen && (isMac ? 'pt-9' : 'pt-2')+ 'relative flex h-full w-full flex-col overflow-hidden pr-2 pb-2 [-webkit-app-region:drag]',+ isLeftOpen ? 'pl-px' : 'pl-2',+ // The top bar is the gap above the card, and clears the macOS window+ // buttons itself; without one, the card keeps its own inset.+ topBar === null && (isLeftOpen ? 'pt-2' : isMac ? 'pt-9' : 'pt-2'))}>- <div className="relative flex h-full w-full flex-col overflow-hidden rounded-[var(--panel-radius)] shadow-[0_0_0_0.5px_var(--hair)] [-webkit-app-region:no-drag]">+ {topBar}+ <div className="relative flex min-h-0 w-full flex-1 flex-col overflow-hidden rounded-[var(--panel-radius)] shadow-[0_0_0_0.5px_var(--hair)] [-webkit-app-region:no-drag]">{banner}<div className={cn('relative min-h-0 w-full flex-1', contentClassName)}>{mainContent}diff --git a/console/apps/switch-console-desktop/src/renderer/tests/connectors.test.ts b/console/apps/switch-console-desktop/src/renderer/tests/connectors.test.tsindex e3c619a9c..c8956a84b 100644--- a/console/apps/switch-console-desktop/src/renderer/tests/connectors.test.ts+++ b/console/apps/switch-console-desktop/src/renderer/tests/connectors.test.ts@@ -47,7 +47,7 @@ import {noAgentsText,offersAddAgent,} from '@renderer/features/connectors/grant-agents';-import { adminNavTarget, workspaceNavViews } from '@renderer/features/sidebar/workspace-nav-views';+import { workspaceNavViews } from '@renderer/features/sidebar/workspace-nav-views';import {FLAGS_NOT_READ_YET,allFeatureFlagsOff,@@ -773,41 +773,36 @@ describe('with the service_connections flag off', () => {it('leaves Connectors and Admin out of the nav', () => {const shown = workspaceNavViews({- managed: false,serviceConnections: false,administers: true,+ operatesGatewaylessServer: true,});- expect(shown).not.toContain('connectors');- expect(shown).not.toContain('admin');+ expect(shown).toEqual(['server', 'serverAgents', 'serverRooms', 'templates']);expect(- workspaceNavViews({ managed: true, serviceConnections: true, administers: true })- ).toEqual(['server', 'serverAgents', 'serverRooms', 'connectors', 'templates', 'admin']);+ workspaceNavViews({+ serviceConnections: true,+ administers: true,+ operatesGatewaylessServer: false,+ })+ ).toEqual(['server', 'serverAgents', 'serverRooms', 'templates', 'connectors', 'admin']);});- it('shows Admin only to whoever administers the workspace or runs its server', () => {+ it('shows Admin only for what has no other home: workspace connector switches, or connector apps on a Switch with no gateway', () => {expect(- workspaceNavViews({ managed: false, serviceConnections: true, administers: false })- ).toEqual(['server', 'serverAgents', 'serverRooms', 'connectors', 'templates']);- // The server's status lives under Admin, for whoever runs it, flag or role aside.+ workspaceNavViews({+ serviceConnections: true,+ administers: false,+ operatesGatewaylessServer: false,+ })+ ).toEqual(['server', 'serverAgents', 'serverRooms', 'templates', 'connectors']);+ // The operator of a Switch this Console runs without Docker keeps connector apps here.expect(- workspaceNavViews({ managed: true, serviceConnections: false, administers: false })- ).toEqual(['server', 'serverAgents', 'serverRooms', 'templates', 'admin']);- });-- it('opens Admin on its sections, or on the server’s status where there are none to use', () => {- expect(adminNavTarget({ serviceConnections: true, administers: true, frozen: false })).toBe(- 'admin'- );- expect(adminNavTarget({ serviceConnections: false, administers: true, frozen: false })).toBe(- 'managedServer'- );- expect(adminNavTarget({ serviceConnections: true, administers: false, frozen: false })).toBe(- 'managedServer'- );- // While the server can't answer, its status is the only entry that works.- expect(adminNavTarget({ serviceConnections: true, administers: true, frozen: true })).toBe(- 'managedServer'- );+ workspaceNavViews({+ serviceConnections: true,+ administers: false,+ operatesGatewaylessServer: true,+ })+ ).toContain('admin');});it('has no page to show, rather than an empty one', () => {