Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

feat(console): guided first-run onboarding checklist (CHOO-2022) (#212)

Louis Amaudruz73965624733b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9bfa2170a..e7092f207 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -426,6 +426,30 @@ version of their own to them without also giving them a release of their own.
repo-agent definition for Claude Code, the launch profile for Codex — and the
main process now routes the read and the write, so the difference is no longer
visible as the shape of the Settings page.
+- **Remote hosts** are a tab of Settings again rather than an entry in the left
+ sidebar. Older saved navigation state, and the host page's way back, both land
+ on the tab.
+- The setup checklist on the welcome screen can now be dismissed. It shares the
+ sidebar checklist's setting, so it goes away in both places at once and comes
+ back from Settings → General.
+- Settings descriptions for an agent's own options are cut back to a line, with
+ the detail behind the ⓘ beside each one.
+- The agent providers list no longer separates out a "recommended" group; each
+ filter is a single list.
+- The sidebar's + opens a menu offering both "Add an agent" and "Create a
+ room", instead of the single action matching the list you were looking at.
+- The remote hosts page explains what a host is for, and links out to the
+ cloud-hosting documentation.
+
+#### Removed
+- A batch of interface settings, along with the toggles for creating a branch
+ and worktree, including issue context, and OS notifications. Each was already
+ on by default and is now simply always on, so nothing changes for anyone who
+ had not turned one off. Several of them — the left-sidebar line-change and
+ PR-status toggles, the context bar, and confirm-on-tab-close — turned out to
+ control nothing at all: no code read them.
+- Keyboard shortcuts are no longer rebindable from Settings, and open-in tools
+ can no longer be hidden. The shortcuts themselves are unchanged.
#### Fixed
- Add Agent no longer stalls with an unset agent type once more than one Switch
diff --git a/console/apps/switch-console-desktop/src/assets/images/switch-console/icon-rounded.png b/console/apps/switch-console-desktop/src/assets/images/switch-console/icon-rounded.png
new file mode 100644
index 000000000..ea7218cb7
Binary files /dev/null and b/console/apps/switch-console-desktop/src/assets/images/switch-console/icon-rounded.png differ
diff --git a/console/apps/switch-console-desktop/src/main/core/agent-hooks/notification.ts b/console/apps/switch-console-desktop/src/main/core/agent-hooks/notification.ts
index 61eba399d..d19424e1d 100644
--- a/console/apps/switch-console-desktop/src/main/core/agent-hooks/notification.ts
+++ b/console/apps/switch-console-desktop/src/main/core/agent-hooks/notification.ts
@@ -54,8 +54,8 @@ async function getSessionName(sessionId: string | undefined): Promise<string | n
export async function maybeShowNotification(event: AgentEvent, appFocused: boolean): Promise<void> {
try {
- const { enabled, osNotifications } = await appSettingsService.get('notifications');
- if (!enabled || !osNotifications || appFocused || !Notification.isSupported()) return;
+ const { enabled } = await appSettingsService.get('notifications');
+ if (!enabled || appFocused || !Notification.isSupported()) return;
const body = getNotificationBody(event);
if (!body) return;
diff --git a/console/apps/switch-console-desktop/src/main/core/resource-monitor/controller.ts b/console/apps/switch-console-desktop/src/main/core/resource-monitor/controller.ts
index 345aafa04..ed5f8f219 100644
--- a/console/apps/switch-console-desktop/src/main/core/resource-monitor/controller.ts
+++ b/console/apps/switch-console-desktop/src/main/core/resource-monitor/controller.ts
@@ -1,15 +1,10 @@
import { ok } from '@switch-console/shared';
-import { appSettingsService } from '@main/core/settings/settings-service';
import { createRPCController } from '@shared/lib/ipc/rpc';
import { sampleOnce, setResourceMonitorOpen } from './resource-sampler';
export const resourceMonitorController = createRPCController({
/** One-shot sample of current PTY resource usage. */
- getSnapshot: async () => {
- const { enabled } = await appSettingsService.get('resourceMonitor');
- if (!enabled) return ok(null);
- return ok(await sampleOnce());
- },
+ getSnapshot: async () => ok(await sampleOnce()),
setOpen: (clientId: string, subscriptionId: string, open: boolean, sequence: number) => {
setResourceMonitorOpen(clientId, subscriptionId, open, sequence);
diff --git a/console/apps/switch-console-desktop/src/main/core/resource-monitor/resource-sampler.ts b/console/apps/switch-console-desktop/src/main/core/resource-monitor/resource-sampler.ts
index 26e4a92cb..08345d8d6 100644
--- a/console/apps/switch-console-desktop/src/main/core/resource-monitor/resource-sampler.ts
+++ b/console/apps/switch-console-desktop/src/main/core/resource-monitor/resource-sampler.ts
@@ -3,7 +3,6 @@ import os from 'node:os';
import { app } from 'electron';
import pidusage from 'pidusage';
import { ptySessionRegistry } from '@main/core/pty/pty-session-registry';
-import { appSettingsService } from '@main/core/settings/settings-service';
import { events } from '@main/lib/events';
import { log } from '@main/lib/logger';
import { parsePtySessionId } from '@shared/core/pty/ptySessionId';
@@ -241,15 +240,10 @@ export function setResourceMonitorOpen(
openSubscriptions.delete(subscriptionId);
latestSequenceByClient.delete(clientId);
}
- void reconcileResourceSampler();
+ reconcileResourceSampler();
}
-export async function reconcileResourceSampler(): Promise<void> {
- try {
- const { enabled } = await appSettingsService.get('resourceMonitor');
- if (enabled && openSubscriptions.size > 0) startResourceSampler();
- else stopResourceSampler();
- } catch (err) {
- log.warn('resource-sampler: failed to read settings', err);
- }
+export function reconcileResourceSampler(): void {
+ if (openSubscriptions.size > 0) startResourceSampler();
+ else stopResourceSampler();
}
diff --git a/console/apps/switch-console-desktop/src/main/core/settings/controller.ts b/console/apps/switch-console-desktop/src/main/core/settings/controller.ts
index 39550a6f9..08882978f 100644
--- a/console/apps/switch-console-desktop/src/main/core/settings/controller.ts
+++ b/console/apps/switch-console-desktop/src/main/core/settings/controller.ts
@@ -1,11 +1,6 @@
-import { reconcileResourceSampler } from '@main/core/resource-monitor/resource-sampler';
import { createRPCController } from '@shared/lib/ipc/rpc';
import { appSettingsService, type AppSettings, type AppSettingsKey } from './settings-service';
-async function reconcileSettingsRuntimeState(key: AppSettingsKey): Promise<void> {
- if (key === 'resourceMonitor') await reconcileResourceSampler();
-}
-
export const appSettingsController = createRPCController({
get: <T extends AppSettingsKey>(key: T): Promise<AppSettings[T]> => appSettingsService.get(key),
@@ -19,18 +14,11 @@ export const appSettingsController = createRPCController({
overrides: Partial<AppSettings[T]>;
}> => appSettingsService.getWithMeta(key),
- update: async <T extends AppSettingsKey>(key: T, value: AppSettings[T]): Promise<void> => {
- await appSettingsService.update(key, value);
- await reconcileSettingsRuntimeState(key);
- },
+ update: <T extends AppSettingsKey>(key: T, value: AppSettings[T]): Promise<void> =>
+ appSettingsService.update(key, value),
- reset: async <T extends AppSettingsKey>(key: T): Promise<void> => {
- await appSettingsService.reset(key);
- await reconcileSettingsRuntimeState(key);
- },
+ reset: <T extends AppSettingsKey>(key: T): Promise<void> => appSettingsService.reset(key),
- resetField: async <T extends AppSettingsKey>(key: T, field: string): Promise<void> => {
- await appSettingsService.resetField(key, field as keyof AppSettings[T]);
- await reconcileSettingsRuntimeState(key);
- },
+ resetField: <T extends AppSettingsKey>(key: T, field: string): Promise<void> =>
+ appSettingsService.resetField(key, field as keyof AppSettings[T]),
});
diff --git a/console/apps/switch-console-desktop/src/main/core/settings/schema.ts b/console/apps/switch-console-desktop/src/main/core/settings/schema.ts
index 95ca101df..b5ba8bce1 100644
--- a/console/apps/switch-console-desktop/src/main/core/settings/schema.ts
+++ b/console/apps/switch-console-desktop/src/main/core/settings/schema.ts
@@ -7,7 +7,6 @@ import {
TERMINAL_SHELL_IDS,
} from '@shared/core/terminals/terminal-settings';
import { openInAppIdSchema } from '@shared/openInApps';
-import { APP_SHORTCUTS } from '@shared/shortcuts';
import { DEFAULT_AGENT_ID } from './settings-registry';
export const locationSettingsSchema = z.object({
@@ -24,16 +23,13 @@ export const notificationSettingsSchema = z.object({
enabled: z.boolean(),
sound: z.boolean(),
customSoundPath: z.string(),
- osNotifications: z.boolean(),
soundFocusMode: z.enum(['always', 'unfocused']),
});
export const sessionSettingsSchema = z.object({
autoGenerateName: z.boolean(),
autoTrustWorktrees: z.boolean(),
- createBranchAndWorktree: z.boolean(),
preserveNameCapitalization: z.boolean(),
- includeIssueContextByDefault: z.boolean(),
});
export const terminalSettingsSchema = z.object({
@@ -53,16 +49,6 @@ export const themeSchema = z
export const defaultAgentSchema = z.optional(z.enum(AGENT_PROVIDER_IDS)).default(DEFAULT_AGENT_ID);
-export const keyboardSettingsSchema = z
- .optional(
- z.object(
- Object.fromEntries(
- Object.keys(APP_SHORTCUTS).map((k) => [k, z.string().nullable().optional()])
- ) as Record<keyof typeof APP_SHORTCUTS, z.ZodOptional<z.ZodNullable<z.ZodString>>>
- )
- )
- .default({});
-
/**
* Per-provider execution settings stored as host-agnostic overrides.
* Installation source/path/cli overrides are now stored host-specifically
@@ -78,11 +64,6 @@ export const providerConfigDefaults: Record<string, unknown> = {};
export const interfaceSettingsSchema = z.object({
sessionHoverAction: z.enum(['delete', 'archive']),
autoRightSidebarBehavior: z.boolean(),
- showLeftSidebarLineChanges: z.boolean(),
- showLeftSidebarPrStatus: z.boolean(),
- showLeftSidebarTimestamps: z.boolean(),
- confirmTabClose: z.boolean(),
- hideContextBar: z.boolean(),
});
export const changesViewModeSchema = z.object({
@@ -121,8 +102,6 @@ export const browserSettingsSchema = z
settings.profiles.some((profile) => profile.id === settings.defaultProfileId)
);
-export const resourceMonitorSettingsSchema = z.object({ enabled: z.boolean() });
-
/**
* How many sessions on one remote host keep a live terminal at once.
*
@@ -139,7 +118,18 @@ export const remoteSettingsSchema = z.object({
export const openInSettingsSchema = z.object({
default: openInAppIdSchema,
- hidden: z.array(openInAppIdSchema),
+});
+
+/**
+ * Whether the first-run setup checklist is shown (CHOO-2022).
+ *
+ * Dismissing the checklist with its ✕ clears this, and the Settings toggle is
+ * the way back — a dismissal that could not be undone would make the checklist
+ * a one-shot, which is the wrong shape for something a user may dismiss before
+ * they know what it was.
+ */
+export const onboardingSettingsSchema = z.object({
+ showChecklist: z.boolean(),
});
export const APP_SETTINGS_SCHEMA_MAP = {
@@ -147,7 +137,6 @@ export const APP_SETTINGS_SCHEMA_MAP = {
location: locationSettingsSchema,
sessions: sessionSettingsSchema,
defaultAgent: defaultAgentSchema,
- keyboard: keyboardSettingsSchema,
notifications: notificationSettingsSchema,
theme: themeSchema,
openIn: openInSettingsSchema,
@@ -155,9 +144,9 @@ export const APP_SETTINGS_SCHEMA_MAP = {
terminal: terminalSettingsSchema,
browserPreview: browserPreviewSettingsSchema,
browser: browserSettingsSchema,
- resourceMonitor: resourceMonitorSettingsSchema,
changesViewMode: changesViewModeSchema,
remote: remoteSettingsSchema,
+ onboarding: onboardingSettingsSchema,
} as const;
export const appSettingsSchema = z.object({
@@ -165,7 +154,6 @@ export const appSettingsSchema = z.object({
location: locationSettingsSchema,
sessions: sessionSettingsSchema,
defaultAgent: defaultAgentSchema,
- keyboard: keyboardSettingsSchema,
notifications: notificationSettingsSchema,
theme: themeSchema,
openIn: openInSettingsSchema,
@@ -173,7 +161,7 @@ export const appSettingsSchema = z.object({
terminal: terminalSettingsSchema,
browserPreview: browserPreviewSettingsSchema,
browser: browserSettingsSchema,
- resourceMonitor: resourceMonitorSettingsSchema,
changesViewMode: changesViewModeSchema,
remote: remoteSettingsSchema,
+ onboarding: onboardingSettingsSchema,
});
diff --git a/console/apps/switch-console-desktop/src/main/core/settings/settings-registry.ts b/console/apps/switch-console-desktop/src/main/core/settings/settings-registry.ts
index f375b0641..91ab8c6a6 100644
--- a/console/apps/switch-console-desktop/src/main/core/settings/settings-registry.ts
+++ b/console/apps/switch-console-desktop/src/main/core/settings/settings-registry.ts
@@ -3,7 +3,6 @@ import { join } from 'node:path';
import { DEFAULT_BROWSER_PROFILE_ID, DEFAULT_BROWSER_PROFILES } from '@shared/browser';
import type { AppSettings, AppSettingsKey } from '@shared/core/app-settings';
import { TERMINAL_FONT_SIZE_DEFAULT } from '@shared/core/terminals/terminal-settings';
-import type { OpenInAppId } from '@shared/openInApps';
import { getDefaultLocalWorktreeDirectory } from './worktree-defaults';
export const DEFAULT_AGENT_ID = 'claude';
@@ -24,15 +23,12 @@ export const SETTINGS_DEFAULTS = {
sessions: {
autoGenerateName: true,
autoTrustWorktrees: true,
- createBranchAndWorktree: true,
preserveNameCapitalization: false,
- includeIssueContextByDefault: true,
},
notifications: {
enabled: true,
sound: true,
customSoundPath: '',
- osNotifications: true,
soundFocusMode: 'always' as const,
},
terminal: {
@@ -43,19 +39,12 @@ export const SETTINGS_DEFAULTS = {
},
theme: null,
defaultAgent: DEFAULT_AGENT_ID,
- keyboard: {},
openIn: {
default: 'terminal' as const,
- hidden: [] as OpenInAppId[],
},
interface: {
sessionHoverAction: 'delete' as const,
autoRightSidebarBehavior: false,
- showLeftSidebarLineChanges: true,
- showLeftSidebarPrStatus: true,
- showLeftSidebarTimestamps: true,
- confirmTabClose: false,
- hideContextBar: false,
},
browserPreview: {
enabled: true,
@@ -65,12 +54,12 @@ export const SETTINGS_DEFAULTS = {
relaxCorsForLocalhost: false,
profiles: DEFAULT_BROWSER_PROFILES,
},
- resourceMonitor: {
- enabled: false,
- },
remote: {
maxAttachedSessionsPerHost: 4,
},
+ onboarding: {
+ showChecklist: true,
+ },
changesViewMode: {
unstaged: 'flat' as const,
staged: 'flat' as const,
diff --git a/console/apps/switch-console-desktop/src/renderer/app/home-view.tsx b/console/apps/switch-console-desktop/src/renderer/app/home-view.tsx
index 7f8d613f9..893757267 100644
--- a/console/apps/switch-console-desktop/src/renderer/app/home-view.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/app/home-view.tsx
@@ -1,28 +1,36 @@
-import { Plus, type LucideIcon } from 'lucide-react';
+import { observer } from 'mobx-react-lite';
import { motion } from 'motion/react';
-import { useArrowKeyNavigation } from '@renderer/lib/hooks/use-arrow-key-navigation';
-import { useTheme } from '@renderer/lib/hooks/useTheme';
-import { useShowModal } from '@renderer/lib/modal/modal-provider';
-import { SwitchConsoleShimmerLogo } from '@renderer/lib/switch-console-shimmer-logo';
-import { ActionListItem } from '@renderer/lib/ui/action-list-item';
+import { OnboardingChecklistCard } from '@renderer/features/onboarding/onboarding-checklist';
+import { useOnboardingChecklist } from '@renderer/features/onboarding/use-onboarding-checklist';
+import { WelcomeFooter, WelcomeLearnMore } from '@renderer/features/onboarding/welcome-learn-more';
+import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
+import { SwitchConsoleAppIcon } from '@renderer/lib/switch-console-app-icon';
-const LOCATION_ACTIONS = [
- {
- label: 'Add Switch agent',
- description: 'Onboard a local directory as a Switch agent — configuring one if needed',
- icon: Plus,
- modalArgs: {},
- },
-] as const;
+const TAGLINE = 'A platform-agnostic framework to bring humans and agents together.';
-export function HomeMainPanel() {
- const showAddLocationModal = useShowModal('addAgentModal');
- const { selectedIndex, setSelectedIndex } = useArrowKeyNavigation(
- LOCATION_ACTIONS.length,
- (index) => showAddLocationModal(LOCATION_ACTIONS[index].modalArgs)
- );
- const { effectiveTheme } = useTheme();
- const isDark = effectiveTheme === 'emdark';
+/**
+ * The welcome screen (CHOO-2022).
+ *
+ * It used to be the logo and a single "Add Switch agent" action, which said
+ * nothing about what the app was or what setting it up involved. It now carries
+ * the same setup checklist as the sidebar — so the main pane answers "what do I
+ * do first" instead of leaving it to the one action that happened to be there.
+ *
+ * The checklist here cannot be collapsed — there is no space to reclaim on a
+ * screen this empty — but it can be dismissed, and does so through the same
+ * setting as the sidebar's, so it goes away everywhere at once and comes back
+ * from Settings → General.
+ */
+export const HomeMainPanel = observer(function HomeMainPanel() {
+ const { steps, complete, startStep } = useOnboardingChecklist();
+ const {
+ value: onboarding,
+ update: updateOnboarding,
+ isLoading,
+ } = useAppSettingsKey('onboarding');
+ // Until the setting has loaded there is no honest answer, and guessing "show"
+ // flashes the checklist at someone who dismissed it launches ago.
+ const showChecklist = !isLoading && onboarding?.showChecklist === true;
return (
// Home registers no TitlebarSlot, so without a drag region here the whole
@@ -35,60 +43,27 @@ export function HomeMainPanel() {
animate={{ opacity: 1 }}
transition={{ duration: 0.5, ease: 'easeOut' }}
>
- <div className="container mx-auto flex min-h-full max-w-6xl flex-1 flex-col justify-center px-8 py-8">
- <div className="mb-3 text-center">
- <div className="mb-3 flex items-center justify-center">
- <SwitchConsoleShimmerLogo
- height={32}
- color={isDark ? 'var(--color-background-2)' : 'var(--color-foreground)'}
- shimmerColor={isDark ? 'white' : 'var(--color-foreground-passive)'}
- />
- </div>
+ <div className="container mx-auto flex min-h-full max-w-2xl flex-1 flex-col justify-center px-8 py-10">
+ <div className="flex flex-col items-center gap-4">
+ <SwitchConsoleAppIcon size={64} className="rounded-2xl" />
+ <p className="max-w-sm text-center text-base text-foreground-muted">{TAGLINE}</p>
</div>
- <div className="mx-auto mt-8 flex w-full max-w-md flex-col gap-1 [-webkit-app-region:no-drag]">
- {LOCATION_ACTIONS.map((action, i) => (
- <HomeLocationAction
- key={action.label}
- label={action.label}
- description={action.description}
- icon={action.icon}
- isSelected={i === selectedIndex}
- onMouseEnter={() => setSelectedIndex(i)}
- onClick={() => showAddLocationModal(action.modalArgs)}
+ <div className="mt-8 flex w-full flex-col gap-4 [-webkit-app-region:no-drag]">
+ {showChecklist && (
+ <OnboardingChecklistCard
+ steps={steps}
+ complete={complete}
+ onStart={startStep}
+ onDismiss={() => updateOnboarding({ showChecklist: false })}
/>
- ))}
+ )}
+ <WelcomeLearnMore />
+ <WelcomeFooter />
</div>
</div>
</motion.div>
);
-}
-
-function HomeLocationAction({
- label,
- description,
- icon,
- isSelected,
- onClick,
- onMouseEnter,
-}: {
- label: string;
- description: string;
- icon: LucideIcon;
- isSelected: boolean;
- onClick: () => void;
- onMouseEnter: () => void;
-}) {
- return (
- <ActionListItem
- label={label}
- description={description}
- icon={icon}
- isSelected={isSelected}
- onClick={onClick}
- onMouseEnter={onMouseEnter}
- />
- );
-}
+});
export const homeView = {
MainPanel: HomeMainPanel,
diff --git a/console/apps/switch-console-desktop/src/renderer/features/command-palette/command-palette-modal.tsx b/console/apps/switch-console-desktop/src/renderer/features/command-palette/command-palette-modal.tsx
index b657fe3f7..558429685 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/command-palette/command-palette-modal.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/command-palette/command-palette-modal.tsx
@@ -15,7 +15,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { agentsStore } from '@renderer/features/locations/stores/agents-store';
import { REMOTE_HOSTS_QUERY_KEY } from '@renderer/features/remote-hosts/views/remote-hosts-view';
import { getSessionStore } from '@renderer/features/sessions/stores/session-selectors';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import { agentExpandKey } from '@renderer/features/sidebar/sidebar-store';
import { switchRoomsStore } from '@renderer/features/switch-servers/switch-rooms-store';
import { switchServersStore } from '@renderer/features/switch-servers/switch-servers-store';
@@ -197,8 +196,6 @@ export function CommandPaletteModal({
const [query, setQuery] = useState('');
const debouncedQuery = useDebounce(query, 100);
const { navigate } = useNavigate();
- const { value: resourceMonitor } = useAppSettingsKey('resourceMonitor');
- const { value: keyboard } = useAppSettingsKey('keyboard');
const queryClient = useQueryClient();
const handleClose = onClose;
@@ -248,7 +245,7 @@ export function CommandPaletteModal({
id: cmd.id,
title: cmd.label,
subtitle: cmd.description,
- shortcut: cmd.shortcutKey ? getEffectiveHotkey(cmd.shortcutKey, keyboard) : null,
+ shortcut: cmd.shortcutKey ? getEffectiveHotkey(cmd.shortcutKey) : null,
icon: getCommandIcon(def?.iconKey),
execute: () => {
handleClose();
@@ -258,21 +255,18 @@ export function CommandPaletteModal({
})
);
- const resourceMonitorAction = useMemo<PaletteAction | null>(
- () =>
- resourceMonitor?.enabled
- ? {
- kind: 'action',
- id: 'resource-monitor',
- title: 'Resource Monitor',
- subtitle: 'Show CPU and memory performance for running agents',
- icon: Activity,
- execute: () => {
- setView('resource-monitor');
- },
- }
- : null,
- [resourceMonitor?.enabled]
+ const resourceMonitorAction = useMemo<PaletteAction>(
+ () => ({
+ kind: 'action',
+ id: 'resource-monitor',
+ title: 'Resource Monitor',
+ subtitle: 'Show CPU and memory performance for running agents',
+ icon: Activity,
+ execute: () => {
+ setView('resource-monitor');
+ },
+ }),
+ []
);
const actions = useMemo(() => {
@@ -282,10 +276,7 @@ export function CommandPaletteModal({
: locationId
? LOCATION_SUGGESTED
: APP_SUGGESTED;
- const pool = resourceMonitorAction
- ? [...registryActions, resourceMonitorAction]
- : registryActions;
- return pool
+ return [...registryActions, resourceMonitorAction]
.filter((a) => suggestedIds.includes(a.id))
.sort((a, b) => suggestedIds.indexOf(a.id) - suggestedIds.indexOf(b.id))
.slice(0, 7);
@@ -313,7 +304,6 @@ export function CommandPaletteModal({
const q = debouncedQuery.toLowerCase();
const matchedResourceMonitor =
- resourceMonitorAction &&
q &&
(resourceMonitorAction.title.toLowerCase().includes(q) ||
resourceMonitorAction.subtitle?.toLowerCase().includes(q))
@@ -470,9 +460,7 @@ export function CommandPaletteModal({
const def = ALL_COMMAND_DEFS.find((d) => d.id === item.id) as
| CommandDef
| undefined;
- const shortcut = def?.shortcutKey
- ? getEffectiveHotkey(def.shortcutKey, keyboard)
- : null;
+ const shortcut = def?.shortcutKey ? getEffectiveHotkey(def.shortcutKey) : null;
const displayItem: PaletteAction = {
kind: 'action',
id: item.id,
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/agent-type-picker.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/agent-type-picker.tsx
index d6c510bd1..6aaa10f00 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/agent-type-picker.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/agent-type-picker.tsx
@@ -84,7 +84,7 @@ export function AgentTypePicker({
) : (
<>
No agent type is set up for Switch on this computer. Install an agent&apos;s Switch
- connector in Settings &rarr; Agents before onboarding it.
+ connector in Settings &rarr; Agent providers before onboarding it.
</>
)}
</span>
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/configure-agent-panel.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/configure-agent-panel.tsx
index eebed1947..e320a6b8c 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/configure-agent-panel.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/configure-agent-panel.tsx
@@ -2,6 +2,7 @@ import { useQuery } from '@tanstack/react-query';
import { CircleAlert } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import { useEffect, useId } from 'react';
+import { InfoTooltip } from '@renderer/features/settings/components/InfoTooltip';
import {
AddressingPolicyEditor,
type OptionItem,
@@ -140,10 +141,15 @@ export const ConfigureAgentPanel = observer(function ConfigureAgentPanel({
<Field>
<label className="flex cursor-pointer items-start justify-between gap-3 rounded-md border border-border px-2 py-1.5">
<span className="flex flex-col gap-0.5">
- <span className="text-sm">Auto-create a session on notify</span>
+ <span className="flex items-center gap-1.5 text-sm">
+ Auto-create a session on notify
+ <InfoTooltip
+ label="More info about auto-creating a session"
+ content="Switch Console watches this agent's Switch rooms and starts a session — connected to the room and ready to reply — whenever it's addressed with no session running."
+ />
+ </span>
<span className="text-xs text-foreground-muted">
- Switch Console watches this agent&apos;s rooms and starts a session automatically when
- it&apos;s addressed with none running.
+ Start a session when this agent is addressed.
</span>
</span>
<Switch
@@ -157,10 +163,15 @@ export const ConfigureAgentPanel = observer(function ConfigureAgentPanel({
<Field>
<label className="flex cursor-pointer items-start justify-between gap-3 rounded-md border border-border px-2 py-1.5">
<span className="flex flex-col gap-0.5">
- <span className="text-sm">Bypass permissions</span>
+ <span className="flex items-center gap-1.5 text-sm">
+ Bypass permissions
+ <InfoTooltip
+ label="More info about bypassing permissions"
+ content="Sessions start with the provider's auto-approve flag, including ones started automatically. Turn it on only for agents you trust to run unattended."
+ />
+ </span>
<span className="text-xs text-foreground-muted">
- Start this agent&apos;s sessions with permission prompts bypassed (the provider&apos;s
- auto-approve flag). Turn on only for agents you trust to run unattended.
+ Run this agent&apos;s sessions without permission prompts.
</span>
</span>
<Switch
@@ -172,10 +183,17 @@ export const ConfigureAgentPanel = observer(function ConfigureAgentPanel({
</Field>
<Field>
- <FieldLabel>Who can address this agent</FieldLabel>
+ <FieldLabel>
+ <span className="flex items-center gap-1.5">
+ Who can address this agent
+ <InfoTooltip
+ label="More info about addressing"
+ content="Addressing means an @mention, a targeted message, or a delegated task. Open allows any room participant; restricted permits only senders matching a rule. You can change this later from the agent's settings."
+ />
+ </span>
+ </FieldLabel>
<span className="text-xs text-foreground-muted">
- Restrict who may @mention, target, or delegate tasks to the agent. Defaults to open
- (anyone in the room). You can change this later from the agent&apos;s settings.
+ Open to everyone, or restricted to matching senders.
</span>
<AddressingPolicyEditor
value={form.addressingPolicy}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/session-view/session-list.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/session-view/session-list.tsx
index 8e1d2f6c2..98d7622d2 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/session-view/session-list.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/session-view/session-list.tsx
@@ -8,7 +8,6 @@ import {
getLocationStore,
} from '@renderer/features/locations/stores/location-selectors';
import { getSessionManagerStore } from '@renderer/features/sessions/stores/session-selectors';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import { ListPopoverCard } from '@renderer/lib/components/list-popover-card';
import {
getEffectiveHotkey,
@@ -140,7 +139,6 @@ export const SessionList = observer(function SessionList() {
const sessionManager = getSessionManagerStore(locationId);
const showDeleteSession = useShowModal('deleteSessionModal');
const showCreateSessionModal = useShowModal('sessionModal');
- const { value: keyboard } = useAppSettingsKey('keyboard');
const sessionView = store?.view.sessionView ?? null;
@@ -194,7 +192,7 @@ export const SessionList = observer(function SessionList() {
};
useHotkey(
- getHotkeyRegistration('deleteSelectedSessions', keyboard),
+ getHotkeyRegistration('deleteSelectedSessions'),
(e) => {
e.preventDefault();
bulkDelete();
@@ -203,7 +201,7 @@ export const SessionList = observer(function SessionList() {
enabled:
(sessionView?.selectedIds.size ?? 0) > 0 &&
!modalStore.isOpen &&
- getEffectiveHotkey('deleteSelectedSessions', keyboard) !== null,
+ getEffectiveHotkey('deleteSelectedSessions') !== null,
ignoreInputs: true,
}
);
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/addressing-policy-settings-section.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/addressing-policy-settings-section.tsx
index 6898cef0a..cb0c7d5f2 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/addressing-policy-settings-section.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/addressing-policy-settings-section.tsx
@@ -1,5 +1,6 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
+import { InfoTooltip } from '@renderer/features/settings/components/InfoTooltip';
import {
AddressingPolicyEditor,
type OptionItem,
@@ -36,10 +37,17 @@ export function AddressingPolicySettingsSection({
return (
<Field>
- <FieldTitle>Who can address this agent</FieldTitle>
+ <FieldTitle>
+ <span className="flex items-center gap-1.5">
+ Who can address this agent
+ <InfoTooltip
+ label="More info about addressing"
+ content="Addressing means an @mention, a targeted message, or a delegated task. Open allows any room participant; restricted permits only senders matching a rule."
+ />
+ </span>
+ </FieldTitle>
<FieldDescription className="text-foreground-muted">
- Restrict who may @mention, target, or delegate tasks to the agent. Open means any room
- participant can; restricted permits only senders matching a rule.
+ Open to everyone, or restricted to matching senders.
</FieldDescription>
<div className="flex flex-col gap-4">
{switchAgents.map((agent) => (
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-approve-settings-section.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-approve-settings-section.tsx
index c6b7c3e9b..6adad32a9 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-approve-settings-section.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-approve-settings-section.tsx
@@ -1,4 +1,5 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
+import { InfoTooltip } from '@renderer/features/settings/components/InfoTooltip';
import { rpc } from '@renderer/lib/ipc';
import { Field, FieldDescription, FieldTitle } from '@renderer/lib/ui/field';
import { Switch } from '@renderer/lib/ui/switch';
@@ -36,7 +37,15 @@ export function AutoApproveSettingsSection({
return (
<Field>
<div className="flex items-center justify-between gap-3">
- <FieldTitle>Bypass permissions</FieldTitle>
+ <FieldTitle>
+ <span className="flex items-center gap-1.5">
+ Bypass permissions
+ <InfoTooltip
+ label="More info about bypassing permissions"
+ content="Sessions start with the provider's auto-approve flag, including ones started automatically. Turn it on only for agents you trust to run unattended."
+ />
+ </span>
+ </FieldTitle>
{single && (
<AutoApproveSwitch
agentId={single.id}
@@ -46,9 +55,7 @@ export function AutoApproveSettingsSection({
)}
</div>
<FieldDescription className="text-foreground-muted">
- When on, Switch Console starts this agent&apos;s sessions with permission prompts bypassed
- (the provider&apos;s auto-approve flag). Off by default; turn it on only for agents you
- trust to run unattended.
+ Run this agent&apos;s sessions without permission prompts.
</FieldDescription>
{!single && (
<div className="flex flex-col gap-2">
diff --git a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-session-settings-section.tsx b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-session-settings-section.tsx
index 5525a9276..e6ee3e13e 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-session-settings-section.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/locations/components/settings-view/sections/auto-session-settings-section.tsx
@@ -1,5 +1,6 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
+import { InfoTooltip } from '@renderer/features/settings/components/InfoTooltip';
import { rpc } from '@renderer/lib/ipc';
import { Field, FieldDescription, FieldTitle } from '@renderer/lib/ui/field';
import { Switch } from '@renderer/lib/ui/switch';
@@ -37,13 +38,19 @@ export function AutoSessionSettingsSection({
return (
<Field>
<div className="flex items-center justify-between gap-3">
- <FieldTitle>Auto-create a session on notify</FieldTitle>
+ <FieldTitle>
+ <span className="flex items-center gap-1.5">
+ Auto-create a session on notify
+ <InfoTooltip
+ label="More info about auto-creating a session"
+ content="Switch Console watches this agent's Switch rooms and starts a session — connected to the room and ready to reply — whenever it's addressed with no session running."
+ />
+ </span>
+ </FieldTitle>
{single && <AutoSessionSwitch agentId={single.id} />}
</div>
<FieldDescription className="text-foreground-muted">
- When on, Switch Console watches this agent&apos;s Switch rooms and automatically starts a
- session — connected to the room and ready to reply — whenever it&apos;s addressed with no
- session running.
+ Start a session when this agent is addressed.
</FieldDescription>
{!single && (
<div className="flex flex-col gap-2">
diff --git a/console/apps/switch-console-desktop/src/renderer/features/onboarding/onboarding-checklist.tsx b/console/apps/switch-console-desktop/src/renderer/features/onboarding/onboarding-checklist.tsx
new file mode 100644
index 000000000..208e84b56
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/onboarding/onboarding-checklist.tsx
@@ -0,0 +1,229 @@
+import { Check, ChevronDown, ChevronRight, X } from 'lucide-react';
+import { observer } from 'mobx-react-lite';
+import { openExternalUrl } from '@renderer/lib/open-external';
+import { MicroLabel } from '@renderer/lib/ui/label';
+import { cn } from '@renderer/utils/utils';
+import type { OnboardingStep, OnboardingStepId } from '@shared/core/onboarding/checklist';
+import { SWITCH_CONSOLE_DOCS_URL } from '@shared/urls';
+
+/**
+ * The first-run setup checklist (CHOO-2022), in two shapes:
+ *
+ * - {@link OnboardingChecklistPanel} — the sidebar panel, collapsible and
+ * dismissible.
+ * - {@link OnboardingChecklistCard} — the same list embedded in the welcome
+ * screen. It cannot be collapsed, which only makes sense against a sidebar
+ * you are reclaiming space in, but it can be dismissed: a user who has set
+ * Switch up their own way should not be told to do it again every time they
+ * land on the welcome screen.
+ */
+
+/**
+ * Where "Learn more" points, for now. These are placeholders agreed with the
+ * dev on CHOO-2022: the docs site does not exist yet, so all three go to the
+ * repository README rather than to a dead page. Repoint them when it does.
+ */
+const LEARN_MORE_LINKS: { label: string; linkText: string; url: string }[] = [
+ {
+ label: 'Remote or cloud ',
+ linkText: 'hosting',
+ url: SWITCH_CONSOLE_DOCS_URL,
+ },
+ {
+ label: 'Connect to ',
+ linkText: 'messaging apps',
+ url: SWITCH_CONSOLE_DOCS_URL,
+ },
+ {
+ label: 'Best ways to use ',
+ linkText: 'Rooms',
+ url: SWITCH_CONSOLE_DOCS_URL,
+ },
+];
+
+const ALL_SET_COPY = 'All set! You can now start collaborating with your agents!';
+
+function OnboardingStepRow({
+ step,
+ onStart,
+}: {
+ step: OnboardingStep;
+ onStart: (id: OnboardingStepId) => void;
+}) {
+ const done = step.status === 'done';
+ // A step you have not reached yet is not startable: doing it out of order
+ // either fails or produces something the earlier steps then contradict. It
+ // stays visible — the list is meant to show what is coming — but it does not
+ // pretend to be a button.
+ const locked = step.status === 'upcoming';
+
+ return (
+ <button
+ type="button"
+ onClick={() => onStart(step.id)}
+ disabled={locked}
+ aria-disabled={locked}
+ title={locked ? 'Finish the step above first' : undefined}
+ className={cn(
+ 'flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm transition-colors',
+ locked && 'cursor-default text-foreground-muted opacity-60',
+ !locked && 'hover:bg-background-secondary-2',
+ done && 'text-foreground-muted',
+ step.status === 'active' && 'text-foreground'
+ )}
+ >
+ <span
+ aria-hidden
+ className={cn(
+ 'flex size-3.5 shrink-0 items-center justify-center rounded-full',
+ done ? 'bg-foreground-success text-white' : 'border border-current opacity-60'
+ )}
+ >
+ {done && <Check className="size-2.5" strokeWidth={3.5} />}
+ </span>
+ <span className={cn('truncate', done && 'line-through')}>{step.label}</span>
+ </button>
+ );
+}
+
+function LearnMore() {
+ return (
+ <div className="flex flex-col gap-1 px-1 pt-1 text-xs text-foreground-muted">
+ <span>Learn more:</span>
+ <ul className="flex list-disc flex-col gap-0.5 pl-4">
+ {LEARN_MORE_LINKS.map((link) => (
+ <li key={link.linkText}>
+ {link.label}
+ <button
+ type="button"
+ className="underline hover:text-foreground"
+ onClick={() =>
+ openExternalUrl(link.url, `Could not open ${link.linkText} documentation`)
+ }
+ >
+ {link.linkText}
+ </button>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
+
+/** The list itself — steps, and the completion block once they are all done. */
+function OnboardingSteps({
+ steps,
+ complete,
+ onStart,
+ showLearnMore,
+}: {
+ steps: OnboardingStep[];
+ complete: boolean;
+ onStart: (id: OnboardingStepId) => void;
+ /** The welcome screen has a Learn more shelf of its own, so the completion
+ * block there is the message alone rather than the same links twice. */
+ showLearnMore: boolean;
+}) {
+ return (
+ <div className="flex flex-col">
+ {steps.map((step) => (
+ <OnboardingStepRow key={step.id} step={step} onStart={onStart} />
+ ))}
+ {complete && (
+ <>
+ <p className="px-1 pt-2 text-sm text-foreground-success">{ALL_SET_COPY}</p>
+ {showLearnMore && <LearnMore />}
+ </>
+ )}
+ </div>
+ );
+}
+
+/**
+ * The sidebar panel. Collapsing hides the steps but keeps the header; the ✕
+ * dismisses the checklist altogether, which is a setting so it can be undone
+ * from Settings → General once the panel is no longer there to undo it from.
+ */
+export const OnboardingChecklistPanel = observer(function OnboardingChecklistPanel({
+ steps,
+ complete,
+ collapsed,
+ onStart,
+ onToggleCollapsed,
+ onDismiss,
+}: {
+ steps: OnboardingStep[];
+ complete: boolean;
+ collapsed: boolean;
+ onStart: (id: OnboardingStepId) => void;
+ onToggleCollapsed: () => void;
+ onDismiss: () => void;
+}) {
+ return (
+ <div className="flex flex-col border-t border-border px-2 py-2">
+ <div className="flex items-center justify-between">
+ <button
+ type="button"
+ onClick={onToggleCollapsed}
+ className="flex min-w-0 items-center gap-1 rounded-md px-1 py-0.5 text-foreground-tertiary-passive hover:text-foreground-tertiary"
+ aria-label={collapsed ? 'Expand setup checklist' : 'Collapse setup checklist'}
+ aria-expanded={!collapsed}
+ >
+ {collapsed ? (
+ <ChevronRight className="size-3.5 shrink-0" />
+ ) : (
+ <ChevronDown className="size-3.5 shrink-0" />
+ )}
+ <MicroLabel className="text-foreground-tertiary-passive">Setting up Switch</MicroLabel>
+ </button>
+ <button
+ type="button"
+ onClick={onDismiss}
+ aria-label="Dismiss setup checklist"
+ className="rounded-md p-0.5 text-foreground-muted hover:text-foreground"
+ >
+ <X className="size-3.5" />
+ </button>
+ </div>
+ {!collapsed && (
+ <div className="pt-1">
+ <OnboardingSteps steps={steps} complete={complete} onStart={onStart} showLearnMore />
+ </div>
+ )}
+ </div>
+ );
+});
+
+/**
+ * The welcome-screen embed: the same list, framed as a card. The ✕ sets the
+ * same setting the sidebar's does, so dismissing it in one place dismisses it
+ * in both and Settings → General brings it back.
+ */
+export function OnboardingChecklistCard({
+ steps,
+ complete,
+ onStart,
+ onDismiss,
+}: {
+ steps: OnboardingStep[];
+ complete: boolean;
+ onStart: (id: OnboardingStepId) => void;
+ onDismiss: () => void;
+}) {
+ return (
+ <div className="flex w-full flex-col gap-2 rounded-xl border border-border p-4">
+ <div className="flex items-center justify-between">
+ <MicroLabel className="text-foreground-tertiary-passive">Setting up Switch</MicroLabel>
+ <button
+ type="button"
+ onClick={onDismiss}
+ aria-label="Dismiss setup checklist"
+ className="rounded-md p-0.5 text-foreground-muted hover:text-foreground"
+ >
+ <X className="size-3.5" />
+ </button>
+ </div>
+ <OnboardingSteps steps={steps} complete={complete} onStart={onStart} showLearnMore={false} />
+ </div>
+ );
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/onboarding/sidebar-onboarding-checklist.tsx b/console/apps/switch-console-desktop/src/renderer/features/onboarding/sidebar-onboarding-checklist.tsx
new file mode 100644
index 000000000..129746573
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/onboarding/sidebar-onboarding-checklist.tsx
@@ -0,0 +1,33 @@
+import { observer } from 'mobx-react-lite';
+import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
+import { appState } from '@renderer/lib/stores/app-state';
+import { OnboardingChecklistPanel } from './onboarding-checklist';
+import { useOnboardingChecklist } from './use-onboarding-checklist';
+
+/**
+ * The sidebar's setup checklist, or nothing at all.
+ *
+ * It hides itself once the user dismisses it, and — separately — once every
+ * step is done AND they have collapsed it, so a finished checklist stops taking
+ * sidebar space without vanishing the moment the last step completes (seeing it
+ * turn green is the point of having it).
+ */
+export const SidebarOnboardingChecklist = observer(function SidebarOnboardingChecklist() {
+ const { value, update, isLoading } = useAppSettingsKey('onboarding');
+ const { steps, complete, startStep } = useOnboardingChecklist();
+
+ // Render nothing until the setting is known, rather than flashing a checklist
+ // at someone who dismissed it three launches ago.
+ if (isLoading || !value?.showChecklist) return null;
+
+ return (
+ <OnboardingChecklistPanel
+ steps={steps}
+ complete={complete}
+ collapsed={appState.sidebar.onboardingChecklistCollapsed}
+ onStart={startStep}
+ onToggleCollapsed={() => appState.sidebar.toggleOnboardingChecklistCollapsed()}
+ onDismiss={() => update({ showChecklist: false })}
+ />
+ );
+});
diff --git a/console/apps/switch-console-desktop/src/renderer/features/onboarding/use-onboarding-checklist.ts b/console/apps/switch-console-desktop/src/renderer/features/onboarding/use-onboarding-checklist.ts
new file mode 100644
index 000000000..8cdb74478
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/onboarding/use-onboarding-checklist.ts
@@ -0,0 +1,82 @@
+import { useCallback } from 'react';
+import { switchRoomsStore } from '@renderer/features/switch-servers/switch-rooms-store';
+import { switchServersStore } from '@renderer/features/switch-servers/switch-servers-store';
+import { useNavigate } from '@renderer/lib/layout/navigation-provider';
+import { useShowModal } from '@renderer/lib/modal/modal-provider';
+import { appState } from '@renderer/lib/stores/app-state';
+import { useAgentTypeAvailability } from '@renderer/lib/stores/use-switch-setup';
+import {
+ deriveOnboardingSteps,
+ isOnboardingComplete,
+ type OnboardingProgress,
+ type OnboardingStep,
+ type OnboardingStepId,
+} from '@shared/core/onboarding/checklist';
+
+/**
+ * Live answer to "which setup steps are done", read from the things the steps
+ * produce rather than from a record of what the user clicked.
+ *
+ * Callers must be MobX `observer`s: server, agent and room state are observable
+ * stores, so a plain component would render once and then miss every change.
+ *
+ * Anything not yet loaded reads as *not done*. That direction is deliberate —
+ * an unfinished step wrongly shown as pending costs a glance, while a finished
+ * one wrongly shown as done sends someone looking for a thing they already have.
+ */
+export function useOnboardingProgress(): OnboardingProgress {
+ const { data: agentTypes } = useAgentTypeAvailability();
+
+ return {
+ addServer: switchServersStore.servers.length > 0,
+ agentProviders: (agentTypes ?? []).some((type) => type.available),
+ onboardAgents: appState.locations.locations.size > 0,
+ createRoom: switchRoomsStore.listedRoomsOnAllServers.length > 0,
+ };
+}
+
+export type OnboardingChecklist = {
+ steps: OnboardingStep[];
+ complete: boolean;
+ /** Opens whatever that step asks for — a dialog, or the settings tab. */
+ startStep: (id: OnboardingStepId) => void;
+};
+
+/**
+ * The checklist as the UI consumes it: the derived steps plus the action each
+ * one runs. Every destination already exists in the app; the checklist is a
+ * second, always-visible way in, not a new flow.
+ */
+export function useOnboardingChecklist(): OnboardingChecklist {
+ const progress = useOnboardingProgress();
+ const showAddServerModal = useShowModal('addServerModal');
+ const showAddAgentModal = useShowModal('addAgentModal');
+ const showCreateRoomModal = useShowModal('createRoomModal');
+ const { navigate } = useNavigate();
+
+ const startStep = useCallback(
+ (id: OnboardingStepId) => {
+ switch (id) {
+ case 'addServer':
+ showAddServerModal({});
+ return;
+ case 'agentProviders':
+ navigate('settings', { tab: 'clis-models' });
+ return;
+ case 'onboardAgents':
+ showAddAgentModal({});
+ return;
+ case 'createRoom':
+ showCreateRoomModal({});
+ return;
+ }
+ },
+ [showAddServerModal, showAddAgentModal, showCreateRoomModal, navigate]
+ );
+
+ return {
+ steps: deriveOnboardingSteps(progress),
+ complete: isOnboardingComplete(progress),
+ startStep,
+ };
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/onboarding/welcome-learn-more.tsx b/console/apps/switch-console-desktop/src/renderer/features/onboarding/welcome-learn-more.tsx
new file mode 100644
index 000000000..1b0113d3e
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/onboarding/welcome-learn-more.tsx
@@ -0,0 +1,79 @@
+import { ArrowUpRight } from 'lucide-react';
+import { openExternalUrl } from '@renderer/lib/open-external';
+import { MicroLabel } from '@renderer/lib/ui/label';
+import { SWITCH_CONSOLE_DOCS_URL } from '@shared/urls';
+
+/**
+ * The welcome screen's "Learn more" shelf (CHOO-2022).
+ *
+ * Every card points at the repository README for now — the docs site does not
+ * exist yet, and a card that opens nothing is worse than one that opens the
+ * README. Give each its own URL when there is one.
+ */
+const LEARN_MORE_CARDS: { title: string; url: string }[] = [
+ { title: 'Hosting Switch on a SSH device or a cloud', url: SWITCH_CONSOLE_DOCS_URL },
+ { title: 'Connecting to message apps', url: SWITCH_CONSOLE_DOCS_URL },
+ { title: 'Best ways to use Rooms', url: SWITCH_CONSOLE_DOCS_URL },
+];
+
+export function WelcomeLearnMore() {
+ return (
+ <div className="flex w-full flex-col gap-3 rounded-xl border border-border p-4">
+ <div className="flex items-center justify-between">
+ <MicroLabel className="text-foreground-tertiary-passive">Learn more</MicroLabel>
+ <button
+ type="button"
+ onClick={() => openExternalUrl(SWITCH_CONSOLE_DOCS_URL, 'Could not open documentation')}
+ className="flex items-center gap-0.5 text-xs text-foreground-muted hover:text-foreground"
+ >
+ Docs
+ <ArrowUpRight className="size-3" />
+ </button>
+ </div>
+ <div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
+ {LEARN_MORE_CARDS.map((card) => (
+ <button
+ key={card.title}
+ type="button"
+ onClick={() => openExternalUrl(card.url, `Could not open “${card.title}”`)}
+ // `background-secondary` is the same colour as `background` in the
+ // dark theme, so a card painted with it reads as three floating
+ // strings of text. The elevated tone differs in both themes, and
+ // the border keeps the card's edge legible either way.
+ className="flex h-28 items-start rounded-lg border border-border bg-background-secondary-2 p-3 text-left text-sm font-medium text-foreground transition-colors hover:bg-background-secondary-3"
+ >
+ {card.title}
+ </button>
+ ))}
+ </div>
+ </div>
+ );
+}
+
+/** Attribution strip along the bottom of the welcome screen. */
+export function WelcomeFooter() {
+ return (
+ <div className="flex items-center justify-center gap-2 pt-6 text-xs text-foreground-muted">
+ <span>
+ Switch is an open source project of <span className="text-foreground">Flint AI</span> by
+ SandboxAQ
+ </span>
+ <span aria-hidden>|</span>
+ <button
+ type="button"
+ className="hover:text-foreground"
+ onClick={() => openExternalUrl(SWITCH_CONSOLE_DOCS_URL, 'Could not open documentation')}
+ >
+ Docs
+ </button>
+ <span aria-hidden>|</span>
+ <button
+ type="button"
+ className="hover:text-foreground"
+ onClick={() => openExternalUrl(SWITCH_CONSOLE_DOCS_URL, 'Could not open the repository')}
+ >
+ GitHub
+ </button>
+ </div>
+ );
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
index a0467eb38..dc54a5b61 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
@@ -148,7 +148,7 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
size="sm"
variant="ghost"
className="-ml-2"
- onClick={() => navigate('remoteHosts')}
+ onClick={() => navigate('settings', { tab: 'remote-hosts' })}
>
<ArrowLeft className="size-4" /> All hosts
</Button>
@@ -303,7 +303,7 @@ export const remoteHostView = {
? (params as { sshHost?: unknown }).sshHost
: undefined;
if (typeof sshHost !== 'string' || sshHost.length === 0) {
- return { ok: false, redirect: 'remoteHosts' };
+ return { ok: false, redirect: 'settings', params: { tab: 'remote-hosts' } };
}
return { ok: true };
},
diff --git a/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx
index 937719eb6..fed7407ad 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/remote-hosts/views/remote-hosts-view.tsx
@@ -15,11 +15,12 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { ChevronRight, Plus, Server, Trash2 } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import { useEffect, useMemo, useState } from 'react';
-import type { ViewDefinition } from '@renderer/app/view-registry';
+import type { GuardResult, ViewDefinition } from '@renderer/app/view-registry';
import { PageHeader } from '@renderer/lib/components/page-header';
import { rpc } from '@renderer/lib/ipc';
import { useNavigate } from '@renderer/lib/layout/navigation-provider';
import { useShowModal } from '@renderer/lib/modal/modal-provider';
+import { openExternalUrl } from '@renderer/lib/open-external';
import { Button } from '@renderer/lib/ui/button';
import { Label } from '@renderer/lib/ui/label';
import { Spinner } from '@renderer/lib/ui/spinner';
@@ -33,6 +34,9 @@ import { useAllHostSetupPlans } from '../setup/use-host-setup';
export const REMOTE_HOSTS_QUERY_KEY = ['remote-hosts'];
+/** Same destination as the Docs tab in Settings, until a cloud-hosting page exists to point at. */
+const CLOUD_HOSTING_DOC_URL = 'https://github.com/sandbox-quantum/switch';
+
type HostFilter = 'all' | 'ready' | 'attention';
type RemoteHost = { sshHost: string; name: string };
@@ -93,7 +97,7 @@ const HostRow = observer(function HostRow({
);
});
-export const RemoteHostsMainPanel = observer(function RemoteHostsMainPanel() {
+export const RemoteHostsSettingsPage = observer(function RemoteHostsSettingsPage() {
const queryClient = useQueryClient();
const { navigate } = useNavigate();
const [filter, setFilter] = useState<HostFilter>('all');
@@ -152,90 +156,102 @@ export const RemoteHostsMainPanel = observer(function RemoteHostsMainPanel() {
</div>
));
- // Same reason as the host page: the workspace's main panel is a fixed
- // `overflow-hidden` box, so the list has to own its own scrolling or it clips
- // once there are more hosts than fit.
+ // Scrolling and width belong to the settings shell this now sits in, so the
+ // list contributes neither.
return (
- <div className="relative z-10 flex min-h-0 flex-1 flex-col overflow-auto bg-background">
- <div className="space-y-4 px-8 pb-10">
- <PageHeader
- sticky
- title="Remote hosts"
- description="SSH hosts that can run agents. Each host has its own page for setup and for the agent types installed on it."
- >
- <div className="flex items-center justify-between gap-2">
- <ToggleGroup
- multiple={false}
- value={[filter]}
- onValueChange={([value]) => {
- if (value) setFilter(value as HostFilter);
- }}
- >
- <ToggleGroupItem value="all">All</ToggleGroupItem>
- <ToggleGroupItem value="ready">Ready</ToggleGroupItem>
- <ToggleGroupItem value="attention">Needs setup</ToggleGroupItem>
- </ToggleGroup>
- <Button
- size="sm"
- variant="outline"
+ <div className="space-y-4 pb-10">
+ <PageHeader
+ sticky
+ title="Remote hosts"
+ description={
+ <>
+ Host your agents on any SSH devices, allowing your team to work with them 24/7. Check
+ out this{' '}
+ <button
+ type="button"
+ className="cursor-pointer underline underline-offset-2 hover:text-foreground"
onClick={() =>
- void showAddHost({
- onboarded: sshHosts,
- onAdded: (sshHost) => {
- invalidate();
- openHost(sshHost);
- },
- })
+ void openExternalUrl(CLOUD_HOSTING_DOC_URL, 'Could not open the documentation')
}
>
- <Plus className="size-4" /> Add host
- </Button>
- </div>
- </PageHeader>
+ doc for cloud hosting ↗︎
+ </button>
+ .
+ </>
+ }
+ >
+ <div className="flex items-center justify-between gap-2">
+ <ToggleGroup
+ multiple={false}
+ value={[filter]}
+ onValueChange={([value]) => {
+ if (value) setFilter(value as HostFilter);
+ }}
+ >
+ <ToggleGroupItem value="all">All</ToggleGroupItem>
+ <ToggleGroupItem value="ready">Ready</ToggleGroupItem>
+ <ToggleGroupItem value="attention">Needs setup</ToggleGroupItem>
+ </ToggleGroup>
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={() =>
+ void showAddHost({
+ onboarded: sshHosts,
+ onAdded: (sshHost) => {
+ invalidate();
+ openHost(sshHost);
+ },
+ })
+ }
+ >
+ <Plus className="size-4" /> Add host
+ </Button>
+ </div>
+ </PageHeader>
- {isLoading ? (
- <div className="flex items-center gap-2 text-sm text-foreground-muted">
- <Spinner /> Loading hosts…
+ {isLoading ? (
+ <div className="flex items-center gap-2 text-sm text-foreground-muted">
+ <Spinner /> Loading hosts…
+ </div>
+ ) : list.length === 0 ? (
+ <p className="text-sm text-foreground-muted">
+ No remote hosts yet. Add one above to get started.
+ </p>
+ ) : filter === 'ready' ? (
+ ready.length > 0 ? (
+ <div>
+ <SectionLabel count={ready.length}>Ready</SectionLabel>
+ {renderRows(ready)}
</div>
- ) : list.length === 0 ? (
- <p className="text-sm text-foreground-muted">
- No remote hosts yet. Add one above to get started.
- </p>
- ) : filter === 'ready' ? (
- ready.length > 0 ? (
- <div>
- <SectionLabel count={ready.length}>Ready</SectionLabel>
- {renderRows(ready)}
- </div>
- ) : (
- <p className="text-sm text-foreground-muted">No host is ready yet.</p>
- )
- ) : filter === 'attention' ? (
- attention.length > 0 ? (
- <div>
- <SectionLabel count={attention.length}>Needs setup</SectionLabel>
- {renderRows(attention)}
- </div>
- ) : (
- <p className="text-sm text-foreground-muted">Every host is ready.</p>
- )
) : (
- <div className="flex flex-col">
- {attention.length > 0 && (
- <section>
- <SectionLabel count={attention.length}>Needs setup</SectionLabel>
- {renderRows(attention)}
- </section>
- )}
- {ready.length > 0 && (
- <section className="pt-2">
- <SectionLabel count={ready.length}>Ready</SectionLabel>
- {renderRows(ready)}
- </section>
- )}
+ <p className="text-sm text-foreground-muted">No host is ready yet.</p>
+ )
+ ) : filter === 'attention' ? (
+ attention.length > 0 ? (
+ <div>
+ <SectionLabel count={attention.length}>Needs setup</SectionLabel>
+ {renderRows(attention)}
</div>
- )}
- </div>
+ ) : (
+ <p className="text-sm text-foreground-muted">Every host is ready.</p>
+ )
+ ) : (
+ <div className="flex flex-col">
+ {attention.length > 0 && (
+ <section>
+ <SectionLabel count={attention.length}>Needs setup</SectionLabel>
+ {renderRows(attention)}
+ </section>
+ )}
+ {ready.length > 0 && (
+ <section className="pt-2">
+ <SectionLabel count={ready.length}>Ready</SectionLabel>
+ {renderRows(ready)}
+ </section>
+ )}
+ </div>
+ )}
</div>
);
});
@@ -300,6 +316,18 @@ function RemoveHostButton({
);
}
+/**
+ * Remote hosts are a tab of Settings, not a view of their own. This entry
+ * survives only to catch persisted snapshots and older navigation that still
+ * name the standalone view, and send them to the tab. `discardParams` stops the
+ * stale entry being fed back on the next attempt.
+ */
export const remoteHostsView = {
- MainPanel: RemoteHostsMainPanel,
+ MainPanel: RemoteHostsSettingsPage,
+ canActivate: (): GuardResult => ({
+ ok: false,
+ redirect: 'settings',
+ params: { tab: 'remote-hosts' },
+ discardParams: true,
+ }),
} satisfies ViewDefinition;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sessions/hooks/useSessionSettings.ts b/console/apps/switch-console-desktop/src/renderer/features/sessions/hooks/useSessionSettings.ts
index 68234f3c1..376963dc9 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sessions/hooks/useSessionSettings.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/sessions/hooks/useSessionSettings.ts
@@ -3,29 +3,18 @@ import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-
export interface SessionSettingsModel {
autoGenerateName: boolean;
autoTrustWorktrees: boolean;
- createBranchAndWorktree: boolean;
preserveNameCapitalization: boolean;
- includeIssueContextByDefault: boolean;
loading: boolean;
saving: boolean;
isFieldOverridden: (
- field:
- | 'autoGenerateName'
- | 'autoTrustWorktrees'
- | 'createBranchAndWorktree'
- | 'preserveNameCapitalization'
- | 'includeIssueContextByDefault'
+ field: 'autoGenerateName' | 'autoTrustWorktrees' | 'preserveNameCapitalization'
) => boolean;
updateAutoGenerateName: (next: boolean) => void;
updateAutoTrustWorktrees: (next: boolean) => void;
- updateCreateBranchAndWorktree: (next: boolean) => void;
updatePreserveNameCapitalization: (next: boolean) => void;
- updateIncludeIssueContextByDefault: (next: boolean) => void;
resetAutoGenerateName: () => void;
resetAutoTrustWorktrees: () => void;
- resetCreateBranchAndWorktree: () => void;
resetPreserveNameCapitalization: () => void;
- resetIncludeIssueContextByDefault: () => void;
}
export function useSessionSettings(): SessionSettingsModel {
@@ -41,21 +30,15 @@ export function useSessionSettings(): SessionSettingsModel {
return {
autoGenerateName: sessions?.autoGenerateName ?? false,
autoTrustWorktrees: sessions?.autoTrustWorktrees ?? false,
- createBranchAndWorktree: sessions?.createBranchAndWorktree ?? true,
preserveNameCapitalization: sessions?.preserveNameCapitalization ?? false,
- includeIssueContextByDefault: sessions?.includeIssueContextByDefault ?? true,
loading,
saving,
isFieldOverridden,
updateAutoGenerateName: (next) => update({ autoGenerateName: next }),
updateAutoTrustWorktrees: (next) => update({ autoTrustWorktrees: next }),
- updateCreateBranchAndWorktree: (next) => update({ createBranchAndWorktree: next }),
updatePreserveNameCapitalization: (next) => update({ preserveNameCapitalization: next }),
- updateIncludeIssueContextByDefault: (next) => update({ includeIssueContextByDefault: next }),
resetAutoGenerateName: () => resetField('autoGenerateName'),
resetAutoTrustWorktrees: () => resetField('autoTrustWorktrees'),
- resetCreateBranchAndWorktree: () => resetField('createBranchAndWorktree'),
resetPreserveNameCapitalization: () => resetField('preserveNameCapitalization'),
- resetIncludeIssueContextByDefault: () => resetField('includeIssueContextByDefault'),
};
}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/AgentsSettingsPage.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/AgentsSettingsPage.tsx
index 0a64f3580..2500d46ff 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/AgentsSettingsPage.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/AgentsSettingsPage.tsx
@@ -22,7 +22,11 @@ export function AgentsSettingsPage() {
return (
<>
- <PageHeader sticky title="Agents" description="Manage CLI agents and model configurations.">
+ <PageHeader
+ sticky
+ title="Agent providers"
+ description="Manage CLI agents and model configurations."
+ >
{/* <DefaultAgentSelector /> */}
<div className="flex items-center justify-between gap-2">
<ToggleGroup
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/CliAgentsList.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/CliAgentsList.tsx
index 73cc2a21b..ee1cbc675 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/CliAgentsList.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/agents-page/CliAgentsList.tsx
@@ -1,7 +1,6 @@
import React, { useMemo, useState } from 'react';
import { useAgents } from '@renderer/lib/stores/use-agents';
import { Label } from '@renderer/lib/ui/label';
-import { Separator } from '@renderer/lib/ui/separator';
import { AgentDetailSheet } from './AgentDetailSheet';
import { AgentRow } from './AgentRow';
@@ -19,8 +18,6 @@ const SectionLabel: React.FC<{ children: React.ReactNode; totalCount: number }>
export type AgentFilter = 'all' | 'installed' | 'uninstalled';
-const RECOMMENDED_IDS = new Set(['claude', 'codex', 'gemini', 'pi']);
-
type CliAgentsListProps = {
searchQuery?: string;
filter?: AgentFilter;
@@ -50,95 +47,28 @@ export const CliAgentsList: React.FC<CliAgentsListProps> = ({
const uninstalled = useMemo(() => allAgents.filter((a) => a.status !== 'available'), [allAgents]);
- // "All" tab: recommended agents (any install status) + all others alphabetically
- const allRecommended = useMemo(
- () => allAgents.filter((a) => RECOMMENDED_IDS.has(a.id)),
- [allAgents]
- );
- const allOthers = useMemo(() => allAgents.filter((a) => !RECOMMENDED_IDS.has(a.id)), [allAgents]);
+ const visible =
+ filter === 'installed' ? installed : filter === 'uninstalled' ? uninstalled : allAgents;
- // "Uninstalled" tab: recommended uninstalled first, then the rest
- const uninstalledRecommended = useMemo(
- () => uninstalled.filter((a) => RECOMMENDED_IDS.has(a.id)),
- [uninstalled]
- );
- const uninstalledRest = useMemo(
- () => uninstalled.filter((a) => !RECOMMENDED_IDS.has(a.id)),
- [uninstalled]
- );
+ const sectionLabel =
+ filter === 'installed'
+ ? 'Installed'
+ : filter === 'uninstalled'
+ ? 'Not installed'
+ : 'All agents';
- if (filter === 'all') {
- return (
- <div className="pb-4">
- {allRecommended.length > 0 && (
- <div className="pt-4">
- <SectionLabel totalCount={allRecommended.length}>Recommended</SectionLabel>
- {allRecommended.map((agent) => (
- <div key={agent.id} className="w-full py-0.5">
- <AgentRow agent={agent} onClick={() => setSelectedAgentId(agent.id)} />
- </div>
- ))}
- </div>
- )}
- {allOthers.length > 0 && (
- <div className="pt-4">
- <SectionLabel totalCount={allOthers.length}>All agents</SectionLabel>
- {allOthers.map((agent) => (
- <div key={agent.id} className="w-full py-0.5">
- <AgentRow agent={agent} onClick={() => setSelectedAgentId(agent.id)} />
- </div>
- ))}
- </div>
- )}
- <AgentDetailSheet agentId={selectedAgentId} onClose={() => setSelectedAgentId(null)} />
- </div>
- );
- }
-
- if (filter === 'installed') {
- return (
- <div className="pb-4">
- {installed.length > 0 && (
- <div className="pt-4">
- <SectionLabel totalCount={installed.length}>Installed</SectionLabel>
- {installed.map((agent) => (
- <div key={agent.id} className="w-full py-0.5">
- <AgentRow agent={agent} onClick={() => setSelectedAgentId(agent.id)} />
- </div>
- ))}
- </div>
- )}
- <AgentDetailSheet agentId={selectedAgentId} onClose={() => setSelectedAgentId(null)} />
- </div>
- );
- }
-
- // filter === 'uninstalled'
return (
<div className="pb-4">
- {uninstalledRecommended.length > 0 && (
+ {visible.length > 0 && (
<div className="pt-4">
- <SectionLabel totalCount={uninstalledRecommended.length}>Recommended</SectionLabel>
- {uninstalledRecommended.map((agent) => (
+ <SectionLabel totalCount={visible.length}>{sectionLabel}</SectionLabel>
+ {visible.map((agent) => (
<div key={agent.id} className="w-full py-0.5">
<AgentRow agent={agent} onClick={() => setSelectedAgentId(agent.id)} />
</div>
))}
</div>
)}
- {uninstalledRest.length > 0 && (
- <>
- {uninstalledRecommended.length > 0 && <Separator />}
- <div className="pt-4">
- <SectionLabel totalCount={uninstalledRest.length}>Not installed</SectionLabel>
- {uninstalledRest.map((agent) => (
- <div key={agent.id} className="w-full py-0.5">
- <AgentRow agent={agent} onClick={() => setSelectedAgentId(agent.id)} />
- </div>
- ))}
- </div>
- </>
- )}
<AgentDetailSheet agentId={selectedAgentId} onClose={() => setSelectedAgentId(null)} />
</div>
);
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/HiddenToolsSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/HiddenToolsSettingsCard.tsx
deleted file mode 100644
index 3b293cae4..000000000
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/HiddenToolsSettingsCard.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { useMemo } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
-import { useOpenInApps } from '@renderer/lib/hooks/useOpenInApps';
-import { Switch } from '@renderer/lib/ui/switch';
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@renderer/lib/ui/tooltip';
-import { OPEN_IN_APPS, type OpenInAppId } from '@shared/openInApps';
-import IntegrationRow from './IntegrationRow';
-
-export default function HiddenToolsSettingsCard() {
- const { value: openIn, update, isLoading, isSaving } = useAppSettingsKey('openIn');
- const { icons, labels, availability } = useOpenInApps();
-
- const hiddenApps: OpenInAppId[] = openIn?.hidden ?? [];
-
- const toggle = (appId: OpenInAppId, visible: boolean) => {
- const next = visible ? hiddenApps.filter((id) => id !== appId) : [...hiddenApps, appId];
- update({ hidden: next });
- };
-
- const sortedApps = useMemo(() => {
- return Object.values(OPEN_IN_APPS).sort((a, b) => {
- const aDetected = availability[a.id] ?? a.alwaysAvailable ?? false;
- const bDetected = availability[b.id] ?? b.alwaysAvailable ?? false;
- if (aDetected && !bDetected) return -1;
- if (!aDetected && bDetected) return 1;
- return (labels[a.id] ?? a.label).localeCompare(labels[b.id] ?? b.label);
- });
- }, [availability, labels]);
-
- return (
- <div className="bg-muted/10 rounded-xl border border-border/60 p-2">
- <div className="space-y-2">
- {sortedApps.map((app) => {
- const isDetected = availability[app.id] ?? app.alwaysAvailable ?? false;
- const isVisible = isDetected && !hiddenApps.includes(app.id);
- const canToggleVisibility = isDetected;
- const label = labels[app.id] ?? app.label;
- const icon = icons[app.id];
- const indicatorClass = isDetected ? 'bg-foreground-success' : 'bg-foreground-passive/50';
- const statusLabel = isDetected ? 'Detected' : 'Not detected';
-
- return (
- <IntegrationRow
- key={app.id}
- logoSrc={icon}
- name={label}
- status={isDetected ? 'connected' : 'missing'}
- showStatusPill={false}
- middle={
- <span className="text-muted-foreground flex items-center gap-2 text-sm">
- <span className={`h-1.5 w-1.5 rounded-full ${indicatorClass}`} />
- {statusLabel}
- </span>
- }
- rightExtra={
- <TooltipProvider delay={150}>
- <Tooltip>
- <TooltipTrigger>
- <span>
- <Switch
- checked={isVisible}
- disabled={isLoading || isSaving || !canToggleVisibility}
- onCheckedChange={(checked) => toggle(app.id, checked)}
- aria-label={`${isVisible ? 'Hide' : 'Show'} ${label} in open menu`}
- />
- </span>
- </TooltipTrigger>
- <TooltipContent side="top" className="text-xs">
- {!isDetected
- ? 'Install this tool to show it in menu'
- : isVisible
- ? 'Hide from menu'
- : 'Show in menu'}
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- }
- />
- );
- })}
- </div>
- </div>
- );
-}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/InfoTooltip.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/InfoTooltip.tsx
new file mode 100644
index 000000000..d58933402
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/components/InfoTooltip.tsx
@@ -0,0 +1,24 @@
+import { Info } from 'lucide-react';
+import React from 'react';
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@renderer/lib/ui/tooltip';
+
+export function InfoTooltip({ label, content }: { label: string; content: React.ReactNode }) {
+ return (
+ <TooltipProvider delay={150}>
+ <Tooltip>
+ <TooltipTrigger>
+ <button
+ type="button"
+ className="text-muted-foreground inline-flex h-4 w-4 items-center justify-center hover:text-foreground"
+ aria-label={label}
+ >
+ <Info className="h-3.5 w-3.5" />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="top" className="max-w-xs text-xs">
+ {content}
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/InterfaceSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/InterfaceSettingsCard.tsx
deleted file mode 100644
index 05eee0930..000000000
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/InterfaceSettingsCard.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import React from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
-import { Switch } from '@renderer/lib/ui/switch';
-import { ResetToDefaultButton } from './ResetToDefaultButton';
-import { SettingRow } from './SettingRow';
-
-const InterfaceSettingsCard: React.FC = () => {
- const {
- value: interfaceSettings,
- update,
- isLoading: loading,
- isSaving: saving,
- isFieldOverridden,
- resetField,
- } = useAppSettingsKey('interface');
-
- const confirmTabClose = interfaceSettings?.confirmTabClose ?? false;
- const hideContextBar = interfaceSettings?.hideContextBar ?? false;
-
- return (
- <div className="flex flex-col gap-4">
- <SettingRow
- title="Context bar"
- description="Hide the on-screen context trigger. The keyboard shortcut still works."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('hideContextBar')}
- defaultLabel="shown"
- onReset={() => resetField('hideContextBar')}
- disabled={loading || saving}
- />
- <Switch
- checked={hideContextBar}
- disabled={loading || saving}
- onCheckedChange={(checked) => update({ hideContextBar: checked })}
- />
- </>
- }
- />
- <SettingRow
- title="Confirm tab close"
- description="Ask for confirmation before closing a tab."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('confirmTabClose')}
- defaultLabel="off"
- onReset={() => resetField('confirmTabClose')}
- disabled={loading || saving}
- />
- <Switch
- checked={confirmTabClose}
- disabled={loading || saving}
- onCheckedChange={(checked) => update({ confirmTabClose: checked })}
- />
- </>
- }
- />
- </div>
- );
-};
-
-export default InterfaceSettingsCard;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/KeyboardSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/KeyboardSettingsCard.tsx
deleted file mode 100644
index d49fa3ea0..000000000
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/KeyboardSettingsCard.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import { useHotkeyRecorder, type Hotkey } from '@tanstack/react-hotkeys';
-import { RotateCcw, X } from 'lucide-react';
-import React, { useState } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
-import { toast } from '@renderer/lib/hooks/use-toast';
-import {
- APP_SHORTCUTS,
- getEffectiveHotkey,
- resolveDefaultHotkey,
- type ShortcutSettingsKey,
-} from '@renderer/lib/hooks/useKeyboardShortcuts';
-import { Button } from '@renderer/lib/ui/button';
-import { Shortcut } from '@renderer/lib/ui/shortcut';
-import { describeHotkey } from '@renderer/lib/ui/shortcut-format';
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@renderer/lib/ui/tooltip';
-
-const CONFIGURABLE_SHORTCUTS = (
- Object.entries(APP_SHORTCUTS) as [
- ShortcutSettingsKey,
- (typeof APP_SHORTCUTS)[ShortcutSettingsKey],
- ][]
-).filter(([, def]) => !def.hideFromSettings);
-
-const SHORTCUTS_BY_CATEGORY = CONFIGURABLE_SHORTCUTS.reduce<
- Record<string, [ShortcutSettingsKey, (typeof APP_SHORTCUTS)[ShortcutSettingsKey]][]>
->((acc, entry) => {
- const category = entry[1].category;
- if (!acc[category]) acc[category] = [];
- acc[category].push(entry);
- return acc;
-}, {});
-
-const KeyboardSettingsCard: React.FC = () => {
- const {
- value: keyboard,
- update,
- isLoading: loading,
- isSaving: saving,
- resetField,
- } = useAppSettingsKey('keyboard');
-
- const [editingKey, setEditingKey] = useState<ShortcutSettingsKey | null>(null);
-
- const recorder = useHotkeyRecorder({
- onRecord: (hotkey: Hotkey) => {
- if (!editingKey) return;
-
- const conflict = CONFIGURABLE_SHORTCUTS.find(([key]) => {
- if (key === editingKey) return false;
- return getEffectiveHotkey(key, keyboard) === hotkey;
- });
-
- if (conflict) {
- const [, def] = conflict;
- const msg = `Conflicts with "${def.label}". Choose a different shortcut.`;
- toast({ title: 'Shortcut conflict', description: msg, variant: 'destructive' });
- recorder.cancelRecording();
- setEditingKey(null);
- return;
- }
-
- update({ [editingKey]: hotkey });
- toast({
- title: 'Shortcut updated',
- description: `${APP_SHORTCUTS[editingKey].label} is now ${describeHotkey(hotkey)}`,
- });
- setEditingKey(null);
- },
- onCancel: () => setEditingKey(null),
- });
-
- const startCapture = (key: ShortcutSettingsKey) => {
- setEditingKey(key);
- recorder.startRecording();
- };
-
- const handleReset = (key: ShortcutSettingsKey) => {
- resetField(key);
- toast({
- title: 'Shortcut reset',
- description: `${APP_SHORTCUTS[key].label} reset to default.`,
- });
- };
-
- const handleClear = (key: ShortcutSettingsKey) => {
- update({ [key]: null });
- toast({
- title: 'Shortcut removed',
- description: `${APP_SHORTCUTS[key].label} no longer has a key binding.`,
- });
- };
-
- return (
- <div className="bg-muted/10 rounded-xl border border-border/60 p-4">
- <div className="space-y-6">
- {Object.entries(SHORTCUTS_BY_CATEGORY).map(([category, shortcuts]) => (
- <div key={category}>
- <div className="text-muted-foreground mb-3 text-xs font-medium tracking-wide uppercase">
- {category}
- </div>
- <div className="space-y-3">
- {shortcuts.map(([key, def]) => {
- const effectiveHotkey = getEffectiveHotkey(key, keyboard);
- const capturing = editingKey === key && recorder.isRecording;
- const cleared = keyboard?.[key] === null;
- const showClear = !cleared;
- const defaultHotkey = resolveDefaultHotkey(def);
- const showReset = defaultHotkey != null && effectiveHotkey !== defaultHotkey;
- const showActions = showClear || showReset;
-
- return (
- <div
- key={key}
- className="group/shortcut flex min-w-0 flex-wrap items-start justify-between gap-x-2 gap-y-2"
- >
- <div className="min-w-0 flex-1 basis-64 space-y-1">
- <div className="text-sm break-words">{def.label}</div>
- <div className="text-muted-foreground text-xs break-words">
- {def.description}
- </div>
- </div>
- <div className="ml-auto flex shrink-0 items-center gap-2">
- {capturing ? (
- <>
- <Button
- type="button"
- variant="outline"
- size="sm"
- className="min-w-[80px] animate-pulse"
- onClick={() => recorder.cancelRecording()}
- disabled={saving}
- >
- Press keys...
- </Button>
- <Button
- type="button"
- variant="ghost"
- size="sm"
- onClick={() => recorder.cancelRecording()}
- disabled={saving}
- >
- Cancel
- </Button>
- </>
- ) : (
- <>
- {showActions && (
- <div className="pointer-events-none flex items-center gap-1 opacity-0 transition-opacity group-hover/shortcut:pointer-events-auto group-hover/shortcut:opacity-100">
- <TooltipProvider delay={150}>
- {showReset && (
- <Tooltip>
- <TooltipTrigger>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- className="text-muted-foreground hover:text-foreground"
- onClick={() => handleReset(key)}
- disabled={loading || saving}
- aria-label="Reset to default"
- >
- <RotateCcw className="h-3.5 w-3.5" />
- </Button>
- </TooltipTrigger>
- <TooltipContent side="top">Reset to default</TooltipContent>
- </Tooltip>
- )}
- {showClear && (
- <Tooltip>
- <TooltipTrigger>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- className="text-muted-foreground hover:text-foreground"
- onClick={() => handleClear(key)}
- disabled={loading || saving}
- aria-label="Remove shortcut"
- >
- <X className="h-3.5 w-3.5" />
- </Button>
- </TooltipTrigger>
- <TooltipContent side="top">Remove shortcut</TooltipContent>
- </Tooltip>
- )}
- </TooltipProvider>
- </div>
- )}
- <Button
- type="button"
- variant="ghost"
- size="sm"
- className="min-w-[80px] justify-end px-0 hover:bg-transparent dark:hover:bg-transparent"
- onClick={() => startCapture(key)}
- disabled={loading || saving}
- >
- <Shortcut hotkey={effectiveHotkey} variant="keycaps" />
- </Button>
- </>
- )}
- </div>
- </div>
- );
- })}
- </div>
- </div>
- ))}
- </div>
- </div>
- );
-};
-
-export default KeyboardSettingsCard;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/NotificationSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/NotificationSettingsCard.tsx
index e18516037..74af79e80 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/NotificationSettingsCard.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/components/NotificationSettingsCard.tsx
@@ -69,7 +69,6 @@ const NotificationSettingsCard: React.FC = () => {
enabled: true,
sound: true,
customSoundPath: '',
- osNotifications: true,
soundFocusMode: 'always',
};
const customSoundPath = currentNotifications.customSoundPath?.trim() ?? '';
@@ -213,26 +212,6 @@ const NotificationSettingsCard: React.FC = () => {
</>
}
/>
-
- <SettingRow
- title="OS notifications"
- description="Show system banners when agents need attention or finish (while Switch Console is unfocused)."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('osNotifications')}
- defaultLabel="on"
- onReset={() => resetNotificationField('osNotifications', true)}
- disabled={loading}
- />
- <Switch
- checked={notifications?.osNotifications ?? true}
- disabled={loading}
- onCheckedChange={(next) => updateNotifications({ osNotifications: next })}
- />
- </>
- }
- />
</div>
</div>
);
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/OnboardingSettingsRow.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/OnboardingSettingsRow.tsx
new file mode 100644
index 000000000..9275784af
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/components/OnboardingSettingsRow.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
+import { Switch } from '@renderer/lib/ui/switch';
+import { ResetToDefaultButton } from './ResetToDefaultButton';
+import { SettingRow } from './SettingRow';
+
+/**
+ * The way back after dismissing the setup checklist (CHOO-2022). Dismissal
+ * removes the only control that could restore it, so it has to live somewhere
+ * else — here.
+ */
+export const OnboardingChecklistRow: React.FC = () => {
+ const {
+ value,
+ update,
+ isLoading: loading,
+ isSaving: saving,
+ isFieldOverridden,
+ resetField,
+ } = useAppSettingsKey('onboarding');
+
+ const showChecklist = value?.showChecklist ?? true;
+
+ return (
+ <SettingRow
+ title="Onboarding checklist"
+ description="Show the “Setting up Switch” checklist in the sidebar, with the steps left to finish setting up."
+ control={
+ <>
+ <ResetToDefaultButton
+ visible={isFieldOverridden('showChecklist')}
+ defaultLabel="on"
+ onReset={() => resetField('showChecklist')}
+ disabled={loading || saving}
+ />
+ <Switch
+ checked={showChecklist}
+ disabled={loading || saving}
+ onCheckedChange={(checked) => update({ showChecklist: checked })}
+ />
+ </>
+ }
+ />
+ );
+};
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/ResourceMonitorSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/ResourceMonitorSettingsCard.tsx
deleted file mode 100644
index 1b1e6c6f8..000000000
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/ResourceMonitorSettingsCard.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React, { useCallback } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
-import { Switch } from '@renderer/lib/ui/switch';
-import { SettingRow } from './SettingRow';
-
-const ResourceMonitorSettingsCard: React.FC = () => {
- const {
- value: resourceMonitor,
- update,
- isLoading: loading,
- isSaving: saving,
- } = useAppSettingsKey('resourceMonitor');
-
- const enabled = resourceMonitor?.enabled ?? false;
-
- const toggle = useCallback(
- (next: boolean) => {
- update({ enabled: next });
- },
- [update]
- );
-
- return (
- <SettingRow
- title="Resource monitor"
- description="Track CPU and memory usage for running agents. When enabled, open it from the command palette."
- control={<Switch checked={enabled} disabled={loading || saving} onCheckedChange={toggle} />}
- />
- );
-};
-
-export default ResourceMonitorSettingsCard;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SessionSettingsRows.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/SessionSettingsRows.tsx
index 83501e95f..e1912aad7 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SessionSettingsRows.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/components/SessionSettingsRows.tsx
@@ -1,33 +1,11 @@
-import { Info } from 'lucide-react';
import React from 'react';
import { useSessionSettings } from '@renderer/features/sessions/hooks/useSessionSettings';
import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import { Switch } from '@renderer/lib/ui/switch';
-import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@renderer/lib/ui/tooltip';
+import { InfoTooltip } from './InfoTooltip';
import { ResetToDefaultButton } from './ResetToDefaultButton';
import { SettingRow } from './SettingRow';
-function InfoTooltip({ label, content }: { label: string; content: React.ReactNode }) {
- return (
- <TooltipProvider delay={150}>
- <Tooltip>
- <TooltipTrigger>
- <button
- type="button"
- className="text-muted-foreground inline-flex h-4 w-4 items-center justify-center hover:text-foreground"
- aria-label={label}
- >
- <Info className="h-3.5 w-3.5" />
- </button>
- </TooltipTrigger>
- <TooltipContent side="top" className="max-w-xs text-xs">
- {content}
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- );
-}
-
export const AutoGenerateSessionNamesRow: React.FC = () => {
const sessionSettings = useSessionSettings();
@@ -88,32 +66,6 @@ export const AutoTrustWorktreesRow: React.FC = () => {
);
};
-export const CreateBranchAndWorktreeRow: React.FC = () => {
- const sessionSettings = useSessionSettings();
-
- return (
- <SettingRow
- title="Create branch and worktree by default"
- description="Start new From Branch sessions in a dedicated session branch and worktree unless changed in the session modal."
- control={
- <>
- <ResetToDefaultButton
- visible={sessionSettings.isFieldOverridden('createBranchAndWorktree')}
- defaultLabel="on"
- onReset={sessionSettings.resetCreateBranchAndWorktree}
- disabled={sessionSettings.loading || sessionSettings.saving}
- />
- <Switch
- checked={sessionSettings.createBranchAndWorktree}
- disabled={sessionSettings.loading || sessionSettings.saving}
- onCheckedChange={sessionSettings.updateCreateBranchAndWorktree}
- />
- </>
- }
- />
- );
-};
-
export const PreserveSessionNameCapitalizationRow: React.FC = () => {
const sessionSettings = useSessionSettings();
@@ -140,32 +92,6 @@ export const PreserveSessionNameCapitalizationRow: React.FC = () => {
);
};
-export const IncludeIssueContextByDefaultRow: React.FC = () => {
- const sessionSettings = useSessionSettings();
-
- return (
- <SettingRow
- title="Include issue context by default"
- description="Add the selected issue to the initial agent prompt when creating a session from an issue."
- control={
- <>
- <ResetToDefaultButton
- visible={sessionSettings.isFieldOverridden('includeIssueContextByDefault')}
- defaultLabel="on"
- onReset={sessionSettings.resetIncludeIssueContextByDefault}
- disabled={sessionSettings.loading || sessionSettings.saving}
- />
- <Switch
- checked={sessionSettings.includeIssueContextByDefault}
- disabled={sessionSettings.loading || sessionSettings.saving}
- onCheckedChange={sessionSettings.updateIncludeIssueContextByDefault}
- />
- </>
- }
- />
- );
-};
-
export const EnableTmuxRow: React.FC = () => {
const {
value: locations,
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SettingsPage.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/SettingsPage.tsx
index c53b8f49c..f2dfdb9a6 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SettingsPage.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/components/SettingsPage.tsx
@@ -1,23 +1,18 @@
import React, { useCallback } from 'react';
+import { RemoteHostsSettingsPage } from '@renderer/features/remote-hosts/views/remote-hosts-view';
import { PageHeader } from '@renderer/lib/components/page-header';
import { PageContent, PageLayout, PageSidebarMenu } from '@renderer/lib/components/page-layout';
import { openExternalUrl } from '@renderer/lib/open-external';
import { AgentsSettingsPage } from '../agents-page/AgentsSettingsPage';
-import HiddenToolsSettingsCard from './HiddenToolsSettingsCard';
-import InterfaceSettingsCard from './InterfaceSettingsCard';
-import KeyboardSettingsCard from './KeyboardSettingsCard';
import NotificationSettingsCard from './NotificationSettingsCard';
+import { OnboardingChecklistRow } from './OnboardingSettingsRow';
import RemoteAttachmentSettingsCard from './RemoteAttachmentSettingsCard';
-import ResourceMonitorSettingsCard from './ResourceMonitorSettingsCard';
import {
AutoGenerateSessionNamesRow,
AutoTrustWorktreesRow,
- CreateBranchAndWorktreeRow,
EnableTmuxRow,
- IncludeIssueContextByDefaultRow,
PreserveSessionNameCapitalizationRow,
} from './SessionSettingsRows';
-import SidebarMetadataSettingsCard from './SidebarMetadataSettingsCard';
import TerminalSettingsCard from './TerminalSettingsCard';
import ThemeCard from './ThemeCard';
import { UpdateCard } from './UpdateCard';
@@ -29,6 +24,7 @@ export type SettingsPageTab =
| 'connections'
| 'browser'
| 'interface'
+ | 'remote-hosts'
| 'docs';
// ---------------------------------------------------------------------------
@@ -46,11 +42,10 @@ function GeneralSettingsPage() {
<UpdateCard />
<AutoGenerateSessionNamesRow />
<AutoTrustWorktreesRow />
- <CreateBranchAndWorktreeRow />
<PreserveSessionNameCapitalizationRow />
- <IncludeIssueContextByDefaultRow />
<EnableTmuxRow />
<NotificationSettingsCard />
+ <OnboardingChecklistRow />
</div>
);
}
@@ -65,18 +60,7 @@ function InterfaceSettingsPage() {
/>
<ThemeCard />
<TerminalSettingsCard />
- <SidebarMetadataSettingsCard />
- <ResourceMonitorSettingsCard />
<RemoteAttachmentSettingsCard />
- <InterfaceSettingsCard />
- <div className="flex flex-col gap-3">
- <h3 className="text-sm font-normal text-foreground">Keyboard shortcuts</h3>
- <KeyboardSettingsCard />
- </div>
- <div className="flex flex-col gap-3">
- <h3 className="text-sm font-normal text-foreground">Tools</h3>
- <HiddenToolsSettingsCard />
- </div>
</div>
);
}
@@ -93,6 +77,7 @@ const TAB_CONTENT: Partial<Record<SettingsPageTab, () => React.ReactNode>> = {
general: () => <GeneralSettingsPage />,
'clis-models': () => <AgentsSettingsPage />,
interface: () => <InterfaceSettingsPage />,
+ 'remote-hosts': () => <RemoteHostsSettingsPage />,
};
/**
@@ -127,7 +112,8 @@ export function SettingsPage({
}> = [
// Switch Console v0 hides Account, Integrations, Connections (SSH), and Browser tabs.
{ id: 'general', label: 'General' },
- { id: 'clis-models', label: 'Agents' },
+ { id: 'clis-models', label: 'Agent providers' },
+ { id: 'remote-hosts', label: 'Remote hosts' },
{ id: 'interface', label: 'Interface' },
{ id: 'docs', label: 'Docs', isExternal: true },
];
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SidebarMetadataSettingsCard.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/components/SidebarMetadataSettingsCard.tsx
deleted file mode 100644
index a4a00416c..000000000
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/components/SidebarMetadataSettingsCard.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import React from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
-import { Switch } from '@renderer/lib/ui/switch';
-import { ResetToDefaultButton } from './ResetToDefaultButton';
-import { SettingRow } from './SettingRow';
-
-const SidebarMetadataSettingsCard: React.FC = () => {
- const {
- value: interfaceSettings,
- update,
- isLoading,
- isSaving,
- isFieldOverridden,
- resetField,
- } = useAppSettingsKey('interface');
-
- const busy = isLoading || isSaving;
- const showLineChanges = interfaceSettings?.showLeftSidebarLineChanges ?? true;
- const showPrStatus = interfaceSettings?.showLeftSidebarPrStatus ?? true;
- const showTimestamps = interfaceSettings?.showLeftSidebarTimestamps ?? true;
-
- return (
- <div className="grid gap-4">
- <SettingRow
- title="Left sidebar line changes"
- description="Show added and removed line counts for sessions in the left sidebar."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('showLeftSidebarLineChanges')}
- defaultLabel="on"
- onReset={() => resetField('showLeftSidebarLineChanges')}
- disabled={busy}
- />
- <Switch
- checked={showLineChanges}
- onCheckedChange={(checked) => update({ showLeftSidebarLineChanges: checked })}
- disabled={busy}
- aria-label="Show left sidebar line changes"
- />
- </>
- }
- />
- <SettingRow
- title="Left sidebar PR status"
- description="Show GitHub PR merge and status icons for sessions in the left sidebar."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('showLeftSidebarPrStatus')}
- defaultLabel="on"
- onReset={() => resetField('showLeftSidebarPrStatus')}
- disabled={busy}
- />
- <Switch
- checked={showPrStatus}
- onCheckedChange={(checked) => update({ showLeftSidebarPrStatus: checked })}
- disabled={busy}
- aria-label="Show left sidebar PR status"
- />
- </>
- }
- />
- <SettingRow
- title="Left sidebar timestamps"
- description="Show the relative session timestamp in the left sidebar."
- control={
- <>
- <ResetToDefaultButton
- visible={isFieldOverridden('showLeftSidebarTimestamps')}
- defaultLabel="on"
- onReset={() => resetField('showLeftSidebarTimestamps')}
- disabled={busy}
- />
- <Switch
- checked={showTimestamps}
- onCheckedChange={(checked) => update({ showLeftSidebarTimestamps: checked })}
- disabled={busy}
- aria-label="Show left sidebar timestamps"
- />
- </>
- }
- />
- </div>
- );
-};
-
-export default SidebarMetadataSettingsCard;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/settings/settings-view.tsx b/console/apps/switch-console-desktop/src/renderer/features/settings/settings-view.tsx
index 51025039e..ddba564ae 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/settings/settings-view.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/settings/settings-view.tsx
@@ -1,5 +1,4 @@
import { createContext, useCallback, useContext, type ReactNode } from 'react';
-import type { GuardResult } from '@renderer/app/view-registry';
import {
resolveSettingsTab,
SettingsPage,
@@ -68,19 +67,4 @@ export function SettingsMainPanel() {
export const settingsView = {
WrapView: SettingsViewWrapper,
MainPanel: SettingsMainPanel,
- /**
- * Remote hosts moved out of Settings to their own view (CHOO-1809). A
- * persisted snapshot from an older build can still name that tab, so send it
- * to the new view once. `discardParams` is what keeps that to once: without
- * it the stale tab stays in the store, `navigate('settings')` falls back to
- * it, and every later attempt to open Settings redirects here too.
- */
- canActivate: (params: unknown): GuardResult => {
- const tab =
- typeof params === 'object' && params !== null ? (params as { tab?: unknown }).tab : undefined;
- if (tab === 'remote-hosts') {
- return { ok: false, redirect: 'remoteHosts', discardParams: true };
- }
- return { ok: true };
- },
};
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.tsx
index 92ec3c6ba..25a4f543f 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,10 +1,14 @@
-import { FolderInput, Server, Settings } from 'lucide-react';
+import { ArrowUpRight, BookOpen, FolderInput, Settings } 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 { 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 { ServersSidebarSection } from '../switch-servers/ServersSidebarSection';
import { LocationsGroupLabel } from './locations-group-label';
import { SidebarPinnedSessionList } from './pinned-session-list';
@@ -60,38 +64,51 @@ export const LeftSidebar: React.FC = observer(function LeftSidebar() {
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
+ <SidebarOnboardingChecklist />
<SidebarFooter>
<SidebarMenu>
<SidebarSearchTrigger />
<SidebarMenuButton
isActive={
- isCurrentView(currentView, 'remoteHosts') ||
- isCurrentView(currentView, 'remoteHost')
+ isCurrentView(currentView, 'settings') || isCurrentView(currentView, 'remoteHost')
}
- onClick={() => navigate('remoteHosts')}
- aria-label="Remote hosts"
+ onClick={() => navigate('settings')}
+ aria-label="Settings"
className="w-full justify-between"
>
<span className="flex items-center gap-2">
- <Server className="h-5 w-5 sm:h-4 sm:w-4" />
- Remote hosts
+ <Settings className="h-5 w-5 sm:h-4 sm:w-4" />
+ Settings
</span>
+ <BoundShortcut settingsKey="settings" />
</SidebarMenuButton>
<SidebarMenuButton
- isActive={isCurrentView(currentView, 'settings')}
- onClick={() => navigate('settings')}
- aria-label="Settings"
+ 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">
- <Settings className="h-5 w-5 sm:h-4 sm:w-4" />
- Settings
+ <BookOpen className="h-5 w-5 sm:h-4 sm:w-4" />
+ Docs
</span>
- <BoundShortcut settingsKey="settings" />
+ <ArrowUpRight className="size-3 text-foreground-muted" />
</SidebarMenuButton>
</SidebarMenu>
</SidebarFooter>
- <div className="flex items-center justify-end gap-2 border-t border-border px-3 py-2">
+ <div className="flex items-center justify-between gap-2 border-t border-border px-3 py-2">
+ {/* The mark doubles as the way back to the welcome screen — the one
+ view with no other entry point once you have navigated away. */}
+ <button
+ type="button"
+ onClick={() => navigate('home')}
+ aria-label="Go to home"
+ title="Home"
+ className="rounded-md text-foreground-passive transition-colors hover:text-foreground"
+ >
+ <SwitchConsoleMark size={18} />
+ </button>
<UpdateSection />
</div>
</SidebarContainer>
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/locations-group-label.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/locations-group-label.tsx
index b21edb3e5..1bac8df01 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/locations-group-label.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/locations-group-label.tsx
@@ -1,4 +1,4 @@
-import { DoorOpen, Filter, Laptop, ListFilter, Plus, Server, Users } from 'lucide-react';
+import { DoorOpen, Filter, Laptop, ListFilter, Plus, Server, UserPlus, Users } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import type { ComponentType } from 'react';
import { switchRoomsStore } from '@renderer/features/switch-servers/switch-rooms-store';
@@ -19,7 +19,6 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@renderer/lib/ui/dropdown-menu';
-import { BoundShortcut } from '@renderer/lib/ui/shortcut';
import { ToggleGroup, ToggleGroupItem } from '@renderer/lib/ui/toggle-group';
import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/lib/ui/tooltip';
import { cn } from '@renderer/utils/utils';
@@ -245,11 +244,11 @@ const FilterDropdown = observer(function FilterDropdown() {
export const LocationsGroupLabel = observer(function LocationsGroupLabel() {
const showAddLocationModal = useShowModal('addAgentModal');
const showCreateRoomModal = useShowModal('createRoomModal');
- // The add button acts on whatever the section is currently listing: adding an
- // agent while looking at a list of rooms is not what the button appears to
- // offer (CHOO-1875).
+ // The add button offers both actions rather than the one matching the current
+ // view. Which grouping you are looking at says how you want the list
+ // arranged, not which thing you next want to make, and reaching the other
+ // action used to mean switching view first.
const roomMode = sidebarStore.grouping === 'room';
- const addLabel = roomMode ? 'New Room' : 'Add Agent';
return (
<div className="flex h-[40px] items-center justify-between pr-2.5 pl-2.5">
@@ -326,28 +325,41 @@ export const LocationsGroupLabel = observer(function LocationsGroupLabel() {
</DropdownMenuContent>
</DropdownMenu>
<FilterDropdown />
- <Tooltip>
- <TooltipTrigger
- render={
- <button
- type="button"
- onClick={() => (roomMode ? showCreateRoomModal({}) : showAddLocationModal({}))}
- aria-label={addLabel}
- className={buttonVariants({
- size: 'icon-xs',
- variant: 'ghost',
- className: 'hover:bg-transparent text-foreground-muted hover:text-foreground',
- })}
- >
- <Plus />
- </button>
- }
- />
- <TooltipContent>
- {addLabel}
- {!roomMode && <BoundShortcut settingsKey="newLocation" variant="badge" />}
- </TooltipContent>
- </Tooltip>
+ <DropdownMenu>
+ <Tooltip>
+ <DropdownMenuTrigger
+ render={
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ aria-label="Add"
+ className={buttonVariants({
+ size: 'icon-xs',
+ variant: 'ghost',
+ className:
+ 'hover:bg-transparent text-foreground-muted hover:text-foreground',
+ })}
+ >
+ <Plus />
+ </button>
+ }
+ />
+ }
+ />
+ <TooltipContent>Add</TooltipContent>
+ </Tooltip>
+ <DropdownMenuContent className="min-w-48" align="start">
+ <DropdownMenuItem onClick={() => showAddLocationModal({})}>
+ <UserPlus className="mr-1.5 h-4 w-4" />
+ Add an agent
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => showCreateRoomModal({})}>
+ <DoorOpen className="mr-1.5 h-4 w-4" />
+ Create a room
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
</div>
</div>
);
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-item.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-item.tsx
index 983dc5bee..a9c89b7a1 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-item.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-item.tsx
@@ -10,7 +10,6 @@ import { useNavigate, useParams } from '@renderer/lib/layout/navigation-provider
import { useWorkspaceSlots } from '@renderer/lib/layout/workspace-slots';
import { useShowModal } from '@renderer/lib/modal/modal-provider';
import { cn } from '@renderer/utils/utils';
-import { useAppSettingsKey } from '../settings/use-app-settings-key';
import { SidebarMenuAction, SidebarMenuRow } from './sidebar-primitives';
import { depthIndent } from './sidebar-store';
@@ -36,7 +35,6 @@ export const SidebarSessionItem = observer(function SidebarSessionItem({
const { currentView } = useWorkspaceSlots();
const { params } = useParams('session');
- const { value: interfaceSettings } = useAppSettingsKey('interface');
const isActive =
currentView === 'session' && params.sessionId === sessionId && params.locationId === locationId;
@@ -74,8 +72,6 @@ export const SidebarSessionItem = observer(function SidebarSessionItem({
const canPin = session.state !== 'unregistered';
- const showTimestamps = interfaceSettings?.showLeftSidebarTimestamps ?? true;
-
return (
<SessionContextMenu
isPinned={session.data.isPinned}
@@ -116,7 +112,7 @@ export const SidebarSessionItem = observer(function SidebarSessionItem({
</span>
</SidebarMenuAction>
<div className="ml-2 flex shrink-0 items-center justify-end gap-1.5">
- <SessionSidebarTrailingSlot session={session} showTimestamp={showTimestamps} />
+ <SessionSidebarTrailingSlot session={session} />
</div>
</SidebarMenuRow>
</SessionContextMenu>
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-sidebar-agent-status.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-sidebar-agent-status.tsx
index c812c4dd8..8be90191f 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-sidebar-agent-status.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/session-sidebar-agent-status.tsx
@@ -22,10 +22,8 @@ function Slot({ children }: { children: React.ReactNode }) {
export const SessionSidebarTrailingSlot = observer(function SessionSidebarTrailingSlot({
session,
- showTimestamp,
}: {
session: SessionStore;
- showTimestamp: boolean;
}) {
const delayedIsBootstrapping = useDelayedBoolean(session.isBootstrapping, 500);
@@ -54,8 +52,6 @@ export const SessionSidebarTrailingSlot = observer(function SessionSidebarTraili
);
}
- if (!showTimestamp) return null;
-
const instant = getSortInstant(session, sortKindFor(sidebarStore.sessionSortBy));
if (!instant) return null;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
index 7a9048e9e..7264d8096 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
@@ -2,7 +2,6 @@ import { AlertTriangle } from 'lucide-react';
import { reaction } from 'mobx';
import { observer } from 'mobx-react-lite';
import { useEffect, useRef } from 'react';
-import { agentsStore } from '@renderer/features/locations/stores/agents-store';
import { hostReachabilityStore } from '@renderer/features/remote-hosts/host-reachability-store';
import { switchRoomsStore as roomConnectionsStore } from '@renderer/features/switch-rooms/switch-rooms-store';
import { switchRoomsStore } from '@renderer/features/switch-servers/switch-rooms-store';
@@ -12,7 +11,7 @@ import { sidebarStore } from '@renderer/lib/stores/app-state';
import { AgentTree } from './agent-tree';
import { RoomTree } from './room-tree';
import { useScrollSelectionIntoView } from './sidebar-auto-scroll';
-import { switchIdentities } from './sidebar-tree-data';
+import { refreshSidebarRoomState } from './sidebar-tree-data';
/**
* How often the room state is reconciled against the servers while the window
@@ -21,22 +20,9 @@ import { switchIdentities } from './sidebar-tree-data';
*/
const ROOM_STATE_RECONCILE_MS = 60_000;
-/**
- * Re-read everything the sidebar's trees are built from: this install's agents,
- * their room membership, and the room catalogue.
- *
- * One function for every "catch up with the world" trigger — first paint, window
- * focus, signing in to a server, the background reconcile, the retry button. The
- * bug being fixed here is triggers refreshing different subsets, so they share
- * one.
- */
-async function loadSidebarState(force: boolean): Promise<void> {
- await agentsStore.load();
- await Promise.all([
- switchRoomsStore.ensureMembershipsFor(switchIdentities(), { force }),
- switchRoomsStore.loadRoomNames(),
- ]);
-}
+/** @see refreshSidebarRoomState — shared so every trigger, including the
+ * mutations in other components, refreshes the same set. */
+const loadSidebarState = refreshSidebarRoomState;
/**
* The sidebar body: loads what both trees read, then hands over to whichever
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-store.ts b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-store.ts
index 90528499e..0d5edf657 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-store.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-store.ts
@@ -187,6 +187,9 @@ export class SidebarStore implements Snapshottable<SidebarSnapshot> {
filterBridgeTypes = observable.set<string>();
filterRoomHasLiveSession = false;
+ /** Whether the first-run setup checklist is collapsed to its header row. */
+ onboardingChecklistCollapsed = false;
+
constructor(private readonly locationManager: LocationManagerStore) {
makeAutoObservable(this, {
expandedLocationIds: false,
@@ -467,6 +470,7 @@ export class SidebarStore implements Snapshottable<SidebarSnapshot> {
roomSortBy: this.roomSortBy,
filterBridgeTypes: [...this.filterBridgeTypes],
filterRoomHasLiveSession: this.filterRoomHasLiveSession,
+ onboardingChecklistCollapsed: this.onboardingChecklistCollapsed,
};
}
@@ -512,6 +516,13 @@ export class SidebarStore implements Snapshottable<SidebarSnapshot> {
if (snapshot.filterRoomHasLiveSession !== undefined) {
this.filterRoomHasLiveSession = snapshot.filterRoomHasLiveSession;
}
+ if (snapshot.onboardingChecklistCollapsed !== undefined) {
+ this.onboardingChecklistCollapsed = snapshot.onboardingChecklistCollapsed;
+ }
+ }
+
+ toggleOnboardingChecklistCollapsed(): void {
+ this.onboardingChecklistCollapsed = !this.onboardingChecklistCollapsed;
}
/** Called on first load when no snapshot exists — expand all known locations. */
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-tree-data.ts b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-tree-data.ts
index 4b33f49ef..5282a1d3f 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-tree-data.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-tree-data.ts
@@ -1,6 +1,7 @@
import { agentsStore } from '@renderer/features/locations/stores/agents-store';
import type { LocationStore } from '@renderer/features/locations/stores/location';
import type { SessionStore } from '@renderer/features/sessions/stores/session-store';
+import { switchRoomsStore } from '@renderer/features/switch-servers/switch-rooms-store';
import { switchServersStore } from '@renderer/features/switch-servers/switch-servers-store';
import { sidebarStore } from '@renderer/lib/stores/app-state';
import type { Agent } from '@shared/core/agents/agents';
@@ -95,3 +96,25 @@ export function switchIdentities(): { serverId: string; switchAgentId: string }[
}
return identities;
}
+
+/**
+ * Re-read everything the sidebar's trees are built from: this install's agents,
+ * their room membership, and the room catalogue.
+ *
+ * One function for every "catch up with the world" trigger — first paint, window
+ * focus, signing in to a server, the background reconcile, the retry button, and
+ * any mutation here that changes membership. The bug this exists to prevent is
+ * triggers refreshing different subsets of the same state.
+ *
+ * It re-reads the agent list *first* and derives the identities from that, which
+ * is what makes it correct after a room is created with an agent onboarded
+ * moments earlier: refreshing membership for the previously-known identities
+ * would skip the new agent, and it would surface only at the next reconcile.
+ */
+export async function refreshSidebarRoomState(force: boolean): Promise<void> {
+ await agentsStore.load();
+ await Promise.all([
+ switchRoomsStore.ensureMembershipsFor(switchIdentities(), { force }),
+ switchRoomsStore.loadRoomNames(),
+ ]);
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/AddServerModal.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/AddServerModal.tsx
index d1f419db7..a38b2459f 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/AddServerModal.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/AddServerModal.tsx
@@ -1,4 +1,4 @@
-import { CircleCheck, Globe, HardDrive, Server, TriangleAlert } from 'lucide-react';
+import { CircleCheck, Globe, Laptop, Server, TriangleAlert } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import { useCallback, useEffect, useRef, useState } from 'react';
import { HostReachabilityNotice } from '@renderer/features/remote-hosts/host-reachability-notice';
@@ -130,7 +130,7 @@ function ChooseStep({
<DialogContentArea className="pt-0">
<div className="grid gap-3">
<ChoiceCard
- icon={<HardDrive className="size-5" />}
+ icon={<Laptop className="size-5" />}
title="Run a server on this computer"
description="Switch Console sets up and runs the full Switch stack here with Docker. Best for trying Switch out."
onClick={onLocal}
@@ -234,7 +234,7 @@ const LocalSetupStep = observer(function LocalSetupStep({
<DialogContentArea className="space-y-4 pt-0">
<div className="flex items-center gap-3">
<div className="flex size-10 shrink-0 items-center justify-center rounded-lg bg-background-tertiary text-foreground-muted">
- <HardDrive className="size-5" />
+ <Laptop className="size-5" />
</div>
<div className="min-w-0">
<p className="text-sm font-medium text-foreground">Switch server · this computer</p>
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/CreateRoomModal.tsx b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/CreateRoomModal.tsx
index 7d589e413..83de0c03e 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/CreateRoomModal.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/CreateRoomModal.tsx
@@ -2,8 +2,11 @@ import { useQuery } from '@tanstack/react-query';
import { ChevronDown, X } from 'lucide-react';
import { observer } from 'mobx-react-lite';
import { useCallback, useState } from 'react';
+import { openRoomView } from '@renderer/features/sidebar/sidebar-room-grouping';
+import { refreshSidebarRoomState } from '@renderer/features/sidebar/sidebar-tree-data';
import { rpc } from '@renderer/lib/ipc';
import { type BaseModalProps, useModalContext } from '@renderer/lib/modal/modal-provider';
+import { sidebarStore } from '@renderer/lib/stores/app-state';
import { Button } from '@renderer/lib/ui/button';
import {
Combobox,
@@ -33,7 +36,6 @@ import {
import { Textarea } from '@renderer/lib/ui/textarea';
import { cn } from '@renderer/utils/utils';
import type { RemoteAgentSummary, RemoteBridge } from '@shared/core/switch-servers/switch-servers';
-import { switchRoomsStore } from './switch-rooms-store';
import { switchServersStore } from './switch-servers-store';
type CreateRoomModalArgs = {
@@ -114,8 +116,19 @@ export const CreateRoomModal = observer(function CreateRoomModal({
}
// Re-read the room state so the sidebar shows the room straight away
- // rather than at the next window focus.
- await switchRoomsStore.refreshRoomState();
+ // rather than at the next window focus. This goes through the sidebar's
+ // own refresh rather than `refreshRoomState`, which only re-reads
+ // membership for the agents the sidebar knew about when it last loaded —
+ // an agent onboarded moments ago is not among them, so the room would
+ // appear with nothing under it until the next reconcile.
+ await refreshSidebarRoomState(true);
+
+ // Open what was just created: expanded in the tree, and shown in the main
+ // panel. Creating a room and being left where you were reads as if
+ // nothing happened.
+ sidebarStore.ensureRoomExpanded(result.room.id);
+ openRoomView(result.room.id);
+
onSuccess({ roomId: result.room.id });
} catch (cause) {
setError(cause instanceof Error ? cause.message : String(cause));
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/commands/command-shortcut-binder.tsx b/console/apps/switch-console-desktop/src/renderer/lib/commands/command-shortcut-binder.tsx
index 10612f3e0..4bb2abe65 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/commands/command-shortcut-binder.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/commands/command-shortcut-binder.tsx
@@ -1,6 +1,5 @@
import { useHotkey } from '@tanstack/react-hotkeys';
import { observer } from 'mobx-react-lite';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import {
APP_SHORTCUTS,
getEffectiveHotkey,
@@ -15,15 +14,13 @@ import { commandRegistry } from './registry';
* as commands come and go from the registry.
*/
function SingleKeyBinder({ shortcutKey }: { shortcutKey: ShortcutSettingsKey }) {
- const { value: keyboard } = useAppSettingsKey('keyboard');
-
useHotkey(
- getHotkeyRegistration(shortcutKey, keyboard),
+ getHotkeyRegistration(shortcutKey),
() => {
commandRegistry.dispatch(shortcutKey);
},
{
- enabled: getEffectiveHotkey(shortcutKey, keyboard) !== null,
+ enabled: getEffectiveHotkey(shortcutKey) !== null,
}
);
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/components/app-keyboard-shortcuts.tsx b/console/apps/switch-console-desktop/src/renderer/lib/components/app-keyboard-shortcuts.tsx
index a4315ec24..0dbe75bb8 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/components/app-keyboard-shortcuts.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/components/app-keyboard-shortcuts.tsx
@@ -1,5 +1,4 @@
import { useHotkey } from '@tanstack/react-hotkeys';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import {
getEffectiveHotkey,
getHotkeyRegistration,
@@ -11,14 +10,13 @@ import { useShowModal } from '@renderer/lib/modal/modal-provider';
import { modalStore } from '@renderer/lib/modal/modal-store';
export function AppKeyboardShortcuts() {
- const { value: keyboard } = useAppSettingsKey('keyboard');
const showCommandPalette = useShowModal('commandPaletteModal');
const { toggleLeft } = useWorkspaceLayoutContext();
const { navigate } = useNavigate();
- const commandPaletteHotkey = getEffectiveHotkey('commandPalette', keyboard);
- const closeModalHotkey = getEffectiveHotkey('closeModal', keyboard);
- const toggleLeftSidebarHotkey = getEffectiveHotkey('toggleLeftSidebar', keyboard);
+ const commandPaletteHotkey = getEffectiveHotkey('commandPalette');
+ const closeModalHotkey = getEffectiveHotkey('closeModal');
+ const toggleLeftSidebarHotkey = getEffectiveHotkey('toggleLeftSidebar');
const { currentView, lastNonSettingsView } = useWorkspaceSlots();
const { params: sessionParams } = useParams('session');
@@ -33,7 +31,7 @@ export function AppKeyboardShortcuts() {
const currentSessionId = currentView === 'session' ? sessionParams.sessionId : undefined;
useHotkey(
- getHotkeyRegistration('commandPalette', keyboard),
+ getHotkeyRegistration('commandPalette'),
() =>
showCommandPalette({
locationId: currentLocationId,
@@ -43,7 +41,7 @@ export function AppKeyboardShortcuts() {
);
useHotkey(
- getHotkeyRegistration('closeModal', keyboard),
+ getHotkeyRegistration('closeModal'),
() => {
if (currentView === 'settings' && !modalStore.isOpen) {
(navigate as (viewId: typeof lastNonSettingsView) => void)(lastNonSettingsView);
@@ -52,7 +50,7 @@ export function AppKeyboardShortcuts() {
{ enabled: currentView === 'settings' && closeModalHotkey !== null }
);
- useHotkey(getHotkeyRegistration('toggleLeftSidebar', keyboard), () => toggleLeft(), {
+ useHotkey(getHotkeyRegistration('toggleLeftSidebar'), () => toggleLeft(), {
enabled: toggleLeftSidebarHotkey !== null,
});
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/components/monaco-keyboard-bridge.tsx b/console/apps/switch-console-desktop/src/renderer/lib/components/monaco-keyboard-bridge.tsx
index 778806a7b..4d0302224 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/components/monaco-keyboard-bridge.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/components/monaco-keyboard-bridge.tsx
@@ -1,6 +1,5 @@
import { detectPlatform, normalizeHotkey } from '@tanstack/hotkeys';
import { useEffect, useMemo } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import {
APP_SHORTCUTS,
getEffectiveHotkey,
@@ -24,7 +23,6 @@ function isMonacoFocused(): boolean {
* bubbling-phase handling takes over unchanged.
*/
export function MonacoKeyboardBridge() {
- const { value: keyboard } = useAppSettingsKey('keyboard');
const ignoredHotkeys = useMemo(() => {
const platform = detectPlatform();
const next = new Set<string>();
@@ -35,12 +33,12 @@ export function MonacoKeyboardBridge() {
for (const [key, def] of shortcuts) {
if (!def.ignoreWhenMonacoFocused) continue;
- const hotkey = getEffectiveHotkey(key, keyboard);
+ const hotkey = getEffectiveHotkey(key);
if (hotkey !== null) next.add(normalizeHotkey(hotkey, platform));
}
return next;
- }, [keyboard]);
+ }, []);
useEffect(() => {
const platform = detectPlatform();
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/components/page-header.tsx b/console/apps/switch-console-desktop/src/renderer/lib/components/page-header.tsx
index c894566a7..123844787 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/components/page-header.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/components/page-header.tsx
@@ -8,7 +8,7 @@ export function PageHeader({
sticky = false,
}: {
title: string;
- description?: string;
+ description?: React.ReactNode;
children?: React.ReactNode;
/**
* Navigation out of this page, rendered above the title at the top left.
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/open-in-menu.tsx b/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/open-in-menu.tsx
index dc23b44e1..2f68721b2 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/open-in-menu.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/components/titlebar/open-in-menu.tsx
@@ -33,8 +33,7 @@ export const OpenInMenu: React.FC<OpenInMenuProps> = ({
const { toast } = useToast();
const { icons, labels, installedApps, availability, platform, loading } = useOpenInApps();
const { value: openIn, update } = useAppSettingsKey('openIn');
- const { value: keyboard } = useAppSettingsKey('keyboard');
- const openInHotkey = getEffectiveHotkey('openInEditor', keyboard);
+ const openInHotkey = getEffectiveHotkey('openInEditor');
const defaultApp: OpenInAppId | null =
openIn?.default && isValidOpenInAppId(openIn.default) ? openIn.default : null;
@@ -111,7 +110,7 @@ export const OpenInMenu: React.FC<OpenInMenuProps> = ({
const buttonAppLabel = buttonAppId ? (labels[buttonAppId] ?? buttonAppId) : null;
useHotkey(
- getHotkeyRegistration('openInEditor', keyboard),
+ getHotkeyRegistration('openInEditor'),
() => {
if (!buttonAppId) return;
void triggerOpenIn(buttonAppId);
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/hooks/useKeyboardShortcuts.ts b/console/apps/switch-console-desktop/src/renderer/lib/hooks/useKeyboardShortcuts.ts
index 2eb670814..36398c788 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/hooks/useKeyboardShortcuts.ts
+++ b/console/apps/switch-console-desktop/src/renderer/lib/hooks/useKeyboardShortcuts.ts
@@ -4,21 +4,12 @@ import { APP_SHORTCUTS, resolveDefaultHotkey, type ShortcutSettingsKey } from '@
export type { AppShortcutDef, ShortcutSettingsKey } from '@shared/shortcuts';
export { APP_SHORTCUTS, resolveDefaultHotkey } from '@shared/shortcuts';
-type ShortcutOverrides = Partial<Record<ShortcutSettingsKey, string | null>>;
-
/**
- * Returns the currently assigned hotkey for an action.
- * - `undefined` override -> falls back to default
- * - `null` override -> unassigned (disabled)
- * - no `defaultHotkey` and no override -> `null` (not bound)
+ * Returns the hotkey assigned to an action, or `null` when it has no
+ * `defaultHotkey` on the current platform (not bound).
*/
-export function getEffectiveHotkey(
- key: ShortcutSettingsKey,
- custom?: ShortcutOverrides
-): Hotkey | null {
- const configured = custom?.[key];
- if (configured === null) return null;
- const resolved = configured ?? resolveDefaultHotkey(APP_SHORTCUTS[key]);
+export function getEffectiveHotkey(key: ShortcutSettingsKey): Hotkey | null {
+ const resolved = resolveDefaultHotkey(APP_SHORTCUTS[key]);
return resolved != null ? (resolved as Hotkey) : null;
}
@@ -26,11 +17,6 @@ export function getEffectiveHotkey(
* Always returns a valid hotkey string for hook registration.
* Pair this with `getEffectiveHotkey(...) !== null` in `enabled`.
*/
-export function getHotkeyRegistration(
- key: ShortcutSettingsKey,
- custom?: ShortcutOverrides
-): Hotkey {
- return (getEffectiveHotkey(key, custom) ??
- resolveDefaultHotkey(APP_SHORTCUTS[key]) ??
- '') as Hotkey;
+export function getHotkeyRegistration(key: ShortcutSettingsKey): Hotkey {
+ return (getEffectiveHotkey(key) ?? '') as Hotkey;
}
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/hooks/useOpenInApps.ts b/console/apps/switch-console-desktop/src/renderer/lib/hooks/useOpenInApps.ts
index 2571f120e..664b866fb 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/hooks/useOpenInApps.ts
+++ b/console/apps/switch-console-desktop/src/renderer/lib/hooks/useOpenInApps.ts
@@ -1,6 +1,5 @@
import { useQuery } from '@tanstack/react-query';
import { useMemo } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import { rpc } from '@renderer/lib/ipc';
import {
getResolvedIconPath,
@@ -35,8 +34,6 @@ function supportsPlatform(app: OpenInAppConfig, platform: PlatformKey): boolean
}
export function useOpenInApps(): UseOpenInAppsResult {
- const { value: openIn, isLoading: settingsLoading } = useAppSettingsKey('openIn');
-
const { data: platform, isLoading: platformLoading } = useQuery({
queryKey: ['app', 'platform'],
queryFn: () => rpc.app.getPlatform() as Promise<PlatformKey>,
@@ -52,7 +49,7 @@ export function useOpenInApps(): UseOpenInAppsResult {
staleTime: 5 * 60 * 1000,
});
- const loading = settingsLoading || platformLoading || availabilityLoading;
+ const loading = platformLoading || availabilityLoading;
const labels = useMemo(() => {
const result: Partial<Record<OpenInAppId, string>> = {};
@@ -75,14 +72,13 @@ export function useOpenInApps(): UseOpenInAppsResult {
}, [platform]);
const installedApps = useMemo(() => {
- const hiddenApps: OpenInAppId[] = openIn?.hidden ?? [];
if (!platform) return [];
- const platformApps = Object.values(OPEN_IN_APPS).filter(
- (app) => supportsPlatform(app, platform) && !hiddenApps.includes(app.id)
+ const platformApps = Object.values(OPEN_IN_APPS).filter((app) =>
+ supportsPlatform(app, platform)
);
if (loading) return platformApps;
- return platformApps.filter((app) => availability[app.id] && !hiddenApps.includes(app.id));
- }, [availability, loading, openIn?.hidden, platform]);
+ return platformApps.filter((app) => availability[app.id]);
+ }, [availability, loading, platform]);
return { icons, labels, availability, installedApps, platform, loading };
}
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/stores/resource-monitor-store.test.ts b/console/apps/switch-console-desktop/src/renderer/lib/stores/resource-monitor-store.test.ts
index a431de323..74d4aa029 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/stores/resource-monitor-store.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/lib/stores/resource-monitor-store.test.ts
@@ -43,7 +43,10 @@ describe('ResourceMonitorStore', () => {
it('opens once and disposes idempotently with the same subscription', async () => {
const { ResourceMonitorStore } = await import('./resource-monitor-store');
const { rpc } = await import('@renderer/lib/ipc');
- vi.mocked(rpc.resourceMonitor.getSnapshot).mockResolvedValue({ success: true, data: null });
+ vi.mocked(rpc.resourceMonitor.getSnapshot).mockResolvedValue({
+ success: true,
+ data: snapshot(1),
+ });
const store = new ResourceMonitorStore();
store.start();
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/switch-console-app-icon.tsx b/console/apps/switch-console-desktop/src/renderer/lib/switch-console-app-icon.tsx
new file mode 100644
index 000000000..35fbf0e9a
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/lib/switch-console-app-icon.tsx
@@ -0,0 +1,29 @@
+import iconRounded from '@/assets/images/switch-console/icon-rounded.png';
+
+/**
+ * The Switch Console mark, pre-rounded.
+ *
+ * The rounding is baked into the artwork rather than applied with a CSS radius:
+ * the OS app icon is only rounded by the platform on macOS, so anywhere the app
+ * draws its own icon it has to supply a shape that looks right on Windows and
+ * Linux too (CHOO-2022).
+ */
+export function SwitchConsoleAppIcon({
+ size = 64,
+ className,
+}: {
+ size?: number;
+ className?: string;
+}) {
+ return (
+ <img
+ src={iconRounded}
+ width={size}
+ height={size}
+ alt=""
+ aria-hidden
+ className={className}
+ draggable={false}
+ />
+ );
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/switch-console-mark.tsx b/console/apps/switch-console-desktop/src/renderer/lib/switch-console-mark.tsx
new file mode 100644
index 000000000..aa676b950
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/lib/switch-console-mark.tsx
@@ -0,0 +1,44 @@
+/**
+ * The flat Switch mark, for use as a control's icon.
+ *
+ * Distinct from {@link SwitchConsoleAppIcon}, which is the full-colour rounded
+ * app artwork. This one is a single-colour glyph drawn in `currentColor`, so it
+ * inherits the text colour of whatever it sits in — the source artwork is black,
+ * which would disappear against the dark theme.
+ */
+export function SwitchConsoleMark({ size = 18, className }: { size?: number; className?: string }) {
+ return (
+ <svg
+ width={size}
+ height={size}
+ viewBox="0 0 18 18"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ className={className}
+ aria-hidden
+ >
+ <path
+ d="M4.33311 11.6015C4.77245 11.6015 5.1286 11.9577 5.1286 12.397V13.6344C5.1286 14.0738 4.77245 14.4299 4.33311 14.4299C3.89377 14.4299 3.53761 14.0738 3.53761 13.6344V12.397C3.53761 11.9577 3.89377 11.6015 4.33311 11.6015Z"
+ fill="currentColor"
+ />
+ <path
+ d="M7.51509 11.6015C7.95443 11.6015 8.31059 11.9577 8.31059 12.397V13.6344C8.31059 14.0738 7.95443 14.4299 7.51509 14.4299C7.07575 14.4299 6.71959 14.0738 6.71959 13.6344V12.397C6.71959 11.9577 7.07575 11.6015 7.51509 11.6015Z"
+ fill="currentColor"
+ />
+ <path
+ d="M10.4859 3.56782C10.9253 3.56782 11.2814 3.92398 11.2814 4.36332V5.60076C11.2814 6.0401 10.9253 6.39625 10.4859 6.39625C10.0466 6.39625 9.69045 6.0401 9.69045 5.60076V4.36332C9.69045 3.92398 10.0466 3.56782 10.4859 3.56782Z"
+ fill="currentColor"
+ />
+ <path
+ d="M13.6679 3.56782C14.1073 3.56782 14.4634 3.92398 14.4634 4.36332V5.60076C14.4634 6.0401 14.1073 6.39625 13.6679 6.39625C13.2286 6.39625 12.8724 6.0401 12.8724 5.60076V4.36332C12.8724 3.92398 13.2286 3.56782 13.6679 3.56782Z"
+ fill="currentColor"
+ />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M15.8787 0C17.0503 0 18 0.949749 18 2.12132V13.1214C18 13.684 17.7765 14.2236 17.3787 14.6214L14.6214 17.3787C14.2236 17.7765 13.684 18 13.1214 18H2.12132C0.94975 18 0 17.0503 0 15.8787V4.87863C0 4.31602 0.22349 3.77644 0.621309 3.37861L3.37861 0.621309C3.77644 0.22349 4.31602 0 4.87863 0H15.8787ZM2.82843 9.97236C2.34027 9.97236 1.94455 10.3681 1.94455 10.8562V14.9948C1.94455 15.5806 2.41942 16.0555 3.00521 16.0555H12.3159C12.8785 16.0555 13.4181 15.832 13.8159 15.4341L15.4341 13.8159C15.832 13.4181 16.0555 12.8785 16.0555 12.3159V10.8562C16.0555 10.3681 15.6597 9.97236 15.1716 9.97236H2.82843ZM5.68414 1.94455C5.12153 1.94455 4.58195 2.16804 4.18412 2.56586L2.56586 4.18412C2.16804 4.58195 1.94455 5.12153 1.94455 5.68414V7.14393C1.94455 7.63208 2.34027 8.02781 2.82843 8.02781H15.1716C15.6597 8.02781 16.0555 7.63208 16.0555 7.14393V3.00521C16.0555 2.41942 15.5806 1.94455 14.9948 1.94455H5.68414Z"
+ fill="currentColor"
+ />
+ </svg>
+ );
+}
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/ui/confirm-button.tsx b/console/apps/switch-console-desktop/src/renderer/lib/ui/confirm-button.tsx
index f64e3492c..053b3f0e6 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/ui/confirm-button.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/ui/confirm-button.tsx
@@ -2,7 +2,6 @@ import type { Button as ButtonPrimitive } from '@base-ui/react/button';
import { useHotkey } from '@tanstack/react-hotkeys';
import type { VariantProps } from 'class-variance-authority';
import { useRef } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import {
getEffectiveHotkey,
getHotkeyRegistration,
@@ -14,10 +13,9 @@ type ConfirmButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVari
export function ConfirmButton({ disabled, children, ...props }: ConfirmButtonProps) {
const ref = useRef<HTMLButtonElement>(null);
- const { value: keyboard } = useAppSettingsKey('keyboard');
- const confirmHotkey = getEffectiveHotkey('confirm', keyboard);
+ const confirmHotkey = getEffectiveHotkey('confirm');
- useHotkey(getHotkeyRegistration('confirm', keyboard), () => ref.current?.click(), {
+ useHotkey(getHotkeyRegistration('confirm'), () => ref.current?.click(), {
enabled: !disabled && confirmHotkey !== null,
});
diff --git a/console/apps/switch-console-desktop/src/renderer/lib/ui/shortcut.tsx b/console/apps/switch-console-desktop/src/renderer/lib/ui/shortcut.tsx
index 4db91731d..00f0a6e5e 100644
--- a/console/apps/switch-console-desktop/src/renderer/lib/ui/shortcut.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/lib/ui/shortcut.tsx
@@ -1,6 +1,5 @@
import { detectPlatform, parseHotkey, type Hotkey } from '@tanstack/react-hotkeys';
import { useMemo } from 'react';
-import { useAppSettingsKey } from '@renderer/features/settings/use-app-settings-key';
import {
getEffectiveHotkey,
type ShortcutSettingsKey,
@@ -83,8 +82,7 @@ interface BoundShortcutProps {
/** Display a shortcut directly from an app shortcut settings key. */
function BoundShortcut({ settingsKey, className, variant }: BoundShortcutProps) {
- const { value: keyboard } = useAppSettingsKey('keyboard');
- const hotkey = getEffectiveHotkey(settingsKey, keyboard);
+ const hotkey = getEffectiveHotkey(settingsKey);
return <Shortcut hotkey={hotkey} className={className} variant={variant} />;
}
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/browser/home-drag-region.test.tsx b/console/apps/switch-console-desktop/src/renderer/tests/browser/home-drag-region.test.tsx
index 1b9c0f3c2..0fc52b666 100644
--- a/console/apps/switch-console-desktop/src/renderer/tests/browser/home-drag-region.test.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/tests/browser/home-drag-region.test.tsx
@@ -1,7 +1,9 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { act } from 'react';
import { createRoot } from 'react-dom/client';
import { afterEach, describe, expect, it } from 'vitest';
import { HomeMainPanel } from '@renderer/app/home-view';
+import { appSettingsMetaQueryKey } from '@renderer/features/settings/app-settings-client';
import { ThemeContext } from '@renderer/lib/providers/theme-provider';
/**
@@ -20,22 +22,39 @@ import { ThemeContext } from '@renderer/lib/providers/theme-provider';
let container: HTMLDivElement | null = null;
-async function renderHome(): Promise<HTMLDivElement> {
+async function renderHome({
+ showChecklist = true,
+}: { showChecklist?: boolean } = {}): Promise<HTMLDivElement> {
container = document.createElement('div');
document.body.appendChild(container);
const root = createRoot(container);
+ // The welcome screen reads onboarding progress through React Query, so it
+ // needs a client even though nothing here resolves.
+ const queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ });
+ // The checklist is hidden until the setting says otherwise, and the test
+ // bridge answers every IPC call with `undefined` — so without seeding this
+ // there is no checklist on screen to make assertions about.
+ queryClient.setQueryData(appSettingsMetaQueryKey('onboarding'), {
+ value: { showChecklist },
+ defaults: { showChecklist: true },
+ overrides: {},
+ });
await act(async () =>
root.render(
- <ThemeContext.Provider
- value={{
- theme: null,
- setTheme: () => {},
- toggleTheme: () => {},
- effectiveTheme: 'emlight',
- }}
- >
- <HomeMainPanel />
- </ThemeContext.Provider>
+ <QueryClientProvider client={queryClient}>
+ <ThemeContext.Provider
+ value={{
+ theme: null,
+ setTheme: () => {},
+ toggleTheme: () => {},
+ effectiveTheme: 'emlight',
+ }}
+ >
+ <HomeMainPanel />
+ </ThemeContext.Provider>
+ </QueryClientProvider>
)
);
return container;
@@ -55,11 +74,21 @@ describe('home view drag region', () => {
expect(surface?.className).toContain('[-webkit-app-region:drag]');
});
- it('opts the action list out so its buttons stay clickable', async () => {
+ it('opts the checklist out so its steps stay clickable', async () => {
const el = await renderHome();
- const action = el.querySelector('button[aria-label="Add Switch agent"]');
+ const step = [...el.querySelectorAll('button')].find(
+ (button) => button.textContent?.trim() === 'Add a server'
+ );
+
+ expect(step).toBeDefined();
+ expect(step?.closest('[class*="[-webkit-app-region:no-drag]"]')).not.toBeNull();
+ });
+
+ it('drops the checklist once it has been dismissed', async () => {
+ const el = await renderHome({ showChecklist: false });
- expect(action).not.toBeNull();
- expect(action?.closest('[class*="[-webkit-app-region:no-drag]"]')).not.toBeNull();
+ expect(el.textContent).not.toContain('Setting up Switch');
+ // The rest of the welcome screen is not the checklist's to take with it.
+ expect(el.textContent).toContain('Learn more');
});
});
diff --git a/console/apps/switch-console-desktop/src/renderer/tests/browser/onboarding-checklist.test.tsx b/console/apps/switch-console-desktop/src/renderer/tests/browser/onboarding-checklist.test.tsx
new file mode 100644
index 000000000..8f58e7b37
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/renderer/tests/browser/onboarding-checklist.test.tsx
@@ -0,0 +1,213 @@
+import { act } from 'react';
+import { createRoot } from 'react-dom/client';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import {
+ OnboardingChecklistCard,
+ OnboardingChecklistPanel,
+} from '@renderer/features/onboarding/onboarding-checklist';
+import { deriveOnboardingSteps } from '@shared/core/onboarding/checklist';
+
+/**
+ * The sidebar setup checklist's rendered states (CHOO-2022). The panel is
+ * presentational — progress and actions are passed in — so these assertions are
+ * about what a given progress actually puts on screen.
+ */
+
+let container: HTMLDivElement | null = null;
+
+async function renderPanel(
+ options: {
+ progress?: Partial<Record<string, boolean>>;
+ collapsed?: boolean;
+ onStart?: (id: string) => void;
+ onDismiss?: () => void;
+ onToggleCollapsed?: () => void;
+ } = {}
+): Promise<HTMLDivElement> {
+ const progress = {
+ addServer: false,
+ agentProviders: false,
+ onboardAgents: false,
+ createRoom: false,
+ ...options.progress,
+ };
+ container = document.createElement('div');
+ document.body.appendChild(container);
+ const root = createRoot(container);
+ await act(async () =>
+ root.render(
+ <OnboardingChecklistPanel
+ steps={deriveOnboardingSteps(progress)}
+ complete={Object.values(progress).every(Boolean)}
+ collapsed={options.collapsed ?? false}
+ onStart={options.onStart ?? (() => {})}
+ onToggleCollapsed={options.onToggleCollapsed ?? (() => {})}
+ onDismiss={options.onDismiss ?? (() => {})}
+ />
+ )
+ );
+ return container;
+}
+
+async function renderCard(
+ options: {
+ progress?: Partial<Record<string, boolean>>;
+ onStart?: (id: string) => void;
+ onDismiss?: () => void;
+ } = {}
+): Promise<HTMLDivElement> {
+ const progress = {
+ addServer: true,
+ agentProviders: true,
+ onboardAgents: true,
+ createRoom: true,
+ ...options.progress,
+ };
+ container = document.createElement('div');
+ document.body.appendChild(container);
+ const root = createRoot(container);
+ await act(async () =>
+ root.render(
+ <OnboardingChecklistCard
+ steps={deriveOnboardingSteps(progress)}
+ complete={Object.values(progress).every(Boolean)}
+ onStart={options.onStart ?? (() => {})}
+ onDismiss={options.onDismiss ?? (() => {})}
+ />
+ )
+ );
+ return container;
+}
+
+function stepButton(el: HTMLElement, label: string): HTMLButtonElement | undefined {
+ return [...el.querySelectorAll('button')].find(
+ (button) => button.textContent?.trim() === label
+ ) as HTMLButtonElement | undefined;
+}
+
+afterEach(() => {
+ container?.remove();
+ container = null;
+});
+
+describe('onboarding checklist panel', () => {
+ it('lists every step on a fresh install', async () => {
+ const el = await renderPanel();
+
+ for (const label of [
+ 'Add a server',
+ 'Set up agent providers',
+ 'Onboard your agents',
+ 'Create a room',
+ ]) {
+ expect(stepButton(el, label), label).toBeDefined();
+ }
+ });
+
+ it('strikes through a completed step and leaves the rest alone', async () => {
+ const el = await renderPanel({ progress: { addServer: true } });
+
+ expect(stepButton(el, 'Add a server')?.innerHTML).toContain('line-through');
+ expect(stepButton(el, 'Set up agent providers')?.innerHTML).not.toContain('line-through');
+ });
+
+ it('withholds the completion message until every step is done', async () => {
+ const partial = await renderPanel({
+ progress: { addServer: true, agentProviders: true, onboardAgents: true },
+ });
+ expect(partial.textContent).not.toContain('All set!');
+ partial.remove();
+
+ const done = await renderPanel({
+ progress: {
+ addServer: true,
+ agentProviders: true,
+ onboardAgents: true,
+ createRoom: true,
+ },
+ });
+ expect(done.textContent).toContain('All set!');
+ expect(done.textContent).toContain('Learn more');
+ });
+
+ it('hides the steps when collapsed but keeps the header', async () => {
+ const el = await renderPanel({ collapsed: true });
+
+ expect(el.textContent).toContain('Setting up Switch');
+ expect(stepButton(el, 'Add a server')).toBeUndefined();
+ });
+
+ it('reports which step was started', async () => {
+ const onStart = vi.fn();
+ const el = await renderPanel({
+ progress: { addServer: true, agentProviders: true, onboardAgents: true },
+ onStart,
+ });
+
+ await act(async () => stepButton(el, 'Create a room')?.click());
+
+ expect(onStart).toHaveBeenCalledWith('createRoom');
+ });
+
+ it('refuses to start a step behind an unfinished one', async () => {
+ const onStart = vi.fn();
+ const el = await renderPanel({ onStart });
+
+ const locked = stepButton(el, 'Create a room');
+ expect(locked?.disabled).toBe(true);
+
+ await act(async () => locked?.click());
+ expect(onStart).not.toHaveBeenCalled();
+ });
+
+ it('keeps a completed step startable so it can be revisited', async () => {
+ const onStart = vi.fn();
+ const el = await renderPanel({ progress: { addServer: true }, onStart });
+
+ const done = stepButton(el, 'Add a server');
+ expect(done?.disabled).toBe(false);
+
+ await act(async () => done?.click());
+ expect(onStart).toHaveBeenCalledWith('addServer');
+ });
+
+ it('does not repeat the doc links on the welcome card, which has its own', async () => {
+ const el = await renderCard();
+
+ expect(el.textContent).toContain('All set!');
+ expect(el.textContent).not.toContain('Learn more');
+ });
+
+ it('lets the welcome card be dismissed too, not just the sidebar panel', async () => {
+ const onDismiss = vi.fn();
+ const el = await renderCard({ onDismiss });
+
+ const dismiss = el.querySelector<HTMLButtonElement>(
+ 'button[aria-label="Dismiss setup checklist"]'
+ );
+ expect(dismiss, 'the welcome card needs a dismiss control of its own').not.toBeNull();
+
+ await act(async () => dismiss?.click());
+ expect(onDismiss).toHaveBeenCalledOnce();
+ });
+
+ it('offers no collapse on the welcome card, where there is no space to reclaim', async () => {
+ const el = await renderCard();
+
+ expect(el.querySelector('button[aria-label="Collapse setup checklist"]')).toBeNull();
+ });
+
+ it('dismisses through its own control rather than collapsing', async () => {
+ const onDismiss = vi.fn();
+ const onToggleCollapsed = vi.fn();
+ const el = await renderPanel({ onDismiss, onToggleCollapsed });
+
+ const dismiss = el.querySelector<HTMLButtonElement>(
+ 'button[aria-label="Dismiss setup checklist"]'
+ );
+ await act(async () => dismiss?.click());
+
+ expect(onDismiss).toHaveBeenCalledOnce();
+ expect(onToggleCollapsed).not.toHaveBeenCalled();
+ });
+});
diff --git a/console/apps/switch-console-desktop/src/renderer/utils/soundPlayer.ts b/console/apps/switch-console-desktop/src/renderer/utils/soundPlayer.ts
index 60d8c8105..dca21a03d 100644
--- a/console/apps/switch-console-desktop/src/renderer/utils/soundPlayer.ts
+++ b/console/apps/switch-console-desktop/src/renderer/utils/soundPlayer.ts
@@ -8,7 +8,6 @@ let settings: NotificationSettings = {
enabled: true,
sound: true,
customSoundPath: '',
- osNotifications: true,
soundFocusMode: 'always',
};
const customAudioCache = new Map<string, string>();
diff --git a/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.test.ts b/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.test.ts
new file mode 100644
index 000000000..67216d68a
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.test.ts
@@ -0,0 +1,102 @@
+import { describe, expect, it } from 'vitest';
+import {
+ countCompletedSteps,
+ deriveOnboardingSteps,
+ EMPTY_ONBOARDING_PROGRESS,
+ isOnboardingComplete,
+ type OnboardingProgress,
+} from './checklist';
+
+function progress(overrides: Partial<OnboardingProgress> = {}): OnboardingProgress {
+ return { ...EMPTY_ONBOARDING_PROGRESS, ...overrides };
+}
+
+describe('deriveOnboardingSteps', () => {
+ it('makes the first step active on a fresh install', () => {
+ const steps = deriveOnboardingSteps(progress());
+ expect(steps.map((s) => s.status)).toEqual(['active', 'upcoming', 'upcoming', 'upcoming']);
+ });
+
+ it('advances the active step as earlier ones complete', () => {
+ const steps = deriveOnboardingSteps(progress({ addServer: true }));
+ expect(steps.map((s) => s.status)).toEqual(['done', 'active', 'upcoming', 'upcoming']);
+ });
+
+ it('marks a step done even when an earlier one is not', () => {
+ // Someone who already had Claude Code installed satisfies the provider step
+ // before they ever add a server. Showing it as pending would be a lie.
+ const steps = deriveOnboardingSteps(progress({ agentProviders: true }));
+ expect(steps.map((s) => s.status)).toEqual(['active', 'done', 'upcoming', 'upcoming']);
+ });
+
+ it('leaves no step active once everything is done', () => {
+ const steps = deriveOnboardingSteps(
+ progress({
+ addServer: true,
+ agentProviders: true,
+ onboardAgents: true,
+ createRoom: true,
+ })
+ );
+ expect(steps.every((s) => s.status === 'done')).toBe(true);
+ });
+
+ it('keeps the steps in their declared order with their labels', () => {
+ const steps = deriveOnboardingSteps(progress());
+ expect(steps.map((s) => s.id)).toEqual([
+ 'addServer',
+ 'agentProviders',
+ 'onboardAgents',
+ 'createRoom',
+ ]);
+ expect(steps.map((s) => s.label)).toEqual([
+ 'Add a server',
+ 'Set up agent providers',
+ 'Onboard your agents',
+ 'Create a room',
+ ]);
+ });
+
+ it('reverts to active when the thing a step produced is removed', () => {
+ const done = deriveOnboardingSteps(progress({ addServer: true, agentProviders: true }));
+ expect(done[0].status).toBe('done');
+
+ const serverDeleted = deriveOnboardingSteps(progress({ agentProviders: true }));
+ expect(serverDeleted[0].status).toBe('active');
+ });
+});
+
+describe('isOnboardingComplete', () => {
+ it('is false while any step is unmet', () => {
+ expect(isOnboardingComplete(progress())).toBe(false);
+ expect(
+ isOnboardingComplete(
+ progress({
+ addServer: true,
+ agentProviders: true,
+ onboardAgents: true,
+ })
+ )
+ ).toBe(false);
+ });
+
+ it('is true only when every step is met', () => {
+ expect(
+ isOnboardingComplete(
+ progress({
+ addServer: true,
+ agentProviders: true,
+ onboardAgents: true,
+ createRoom: true,
+ })
+ )
+ ).toBe(true);
+ });
+});
+
+describe('countCompletedSteps', () => {
+ it('counts met steps regardless of order', () => {
+ expect(countCompletedSteps(progress())).toBe(0);
+ expect(countCompletedSteps(progress({ agentProviders: true, createRoom: true }))).toBe(2);
+ });
+});
diff --git a/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.ts b/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.ts
new file mode 100644
index 000000000..058026539
--- /dev/null
+++ b/console/apps/switch-console-desktop/src/shared/core/onboarding/checklist.ts
@@ -0,0 +1,84 @@
+/**
+ * Model of the first-run onboarding checklist (CHOO-2022).
+ *
+ * A new install is functional but unexplained: every piece of setup exists as
+ * its own dialog, reachable from somewhere, in an order nobody states. The
+ * checklist names that order and says where you are in it.
+ *
+ * Completion is **derived from what the app can actually see** — a server is
+ * registered, a provider is installed, an agent is onboarded, a room exists —
+ * and never from "the user clicked this once". A remembered click would keep
+ * claiming a step was done after the thing it produced was deleted, which is
+ * exactly the stale-green lie the rest of this app avoids.
+ *
+ * Because progress is observed rather than recorded, steps can complete out of
+ * order: a user who already had Claude Code installed satisfies the provider
+ * step before adding a server. The ordering is guidance, not a gate.
+ */
+
+export const ONBOARDING_STEP_IDS = [
+ 'addServer',
+ 'agentProviders',
+ 'onboardAgents',
+ 'createRoom',
+] as const;
+
+export type OnboardingStepId = (typeof ONBOARDING_STEP_IDS)[number];
+
+/** Whether each step's requirement is currently met. */
+export type OnboardingProgress = Record<OnboardingStepId, boolean>;
+
+/**
+ * How a step reads in the list:
+ *
+ * - `done` — its requirement is met.
+ * - `active` — the first unmet step: the one thing to do next.
+ * - `upcoming` — unmet, but not next. Rendered muted so the list reads as a
+ * sequence rather than four equal demands.
+ */
+export type OnboardingStepStatus = 'done' | 'active' | 'upcoming';
+
+export type OnboardingStep = {
+ id: OnboardingStepId;
+ label: string;
+ status: OnboardingStepStatus;
+};
+
+export const ONBOARDING_STEP_LABELS: Record<OnboardingStepId, string> = {
+ addServer: 'Add a server',
+ agentProviders: 'Set up agent providers',
+ onboardAgents: 'Onboard your agents',
+ createRoom: 'Create a room',
+};
+
+/** No progress at all — the state a fresh install starts in. */
+export const EMPTY_ONBOARDING_PROGRESS: OnboardingProgress = {
+ addServer: false,
+ agentProviders: false,
+ onboardAgents: false,
+ createRoom: false,
+};
+
+/**
+ * The list as rendered: every step in fixed order, each labelled and given a
+ * status. Exactly one step is `active` unless everything is done, in which case
+ * none is.
+ */
+export function deriveOnboardingSteps(progress: OnboardingProgress): OnboardingStep[] {
+ const firstUnmet = ONBOARDING_STEP_IDS.find((id) => !progress[id]);
+ return ONBOARDING_STEP_IDS.map((id) => ({
+ id,
+ label: ONBOARDING_STEP_LABELS[id],
+ status: progress[id] ? 'done' : id === firstUnmet ? 'active' : 'upcoming',
+ }));
+}
+
+/** Whether every step's requirement is met, which is what shows "All set!". */
+export function isOnboardingComplete(progress: OnboardingProgress): boolean {
+ return ONBOARDING_STEP_IDS.every((id) => progress[id]);
+}
+
+/** How many steps are done, for the collapsed header's progress read-out. */
+export function countCompletedSteps(progress: OnboardingProgress): number {
+ return ONBOARDING_STEP_IDS.filter((id) => progress[id]).length;
+}
diff --git a/console/apps/switch-console-desktop/src/shared/view-state.ts b/console/apps/switch-console-desktop/src/shared/view-state.ts
index 7ffd90e24..e4f40344e 100644
--- a/console/apps/switch-console-desktop/src/shared/view-state.ts
+++ b/console/apps/switch-console-desktop/src/shared/view-state.ts
@@ -61,6 +61,13 @@ export type SidebarSnapshot = {
roomSortBy?: SidebarRoomSortBy;
filterBridgeTypes?: string[];
filterRoomHasLiveSession?: boolean;
+ /**
+ * Whether the first-run setup checklist is collapsed to its header row.
+ * Collapsing is a "not now", distinct from dismissing it entirely — that is a
+ * setting (`onboarding.showChecklist`), because it has to be undoable from
+ * somewhere the checklist itself no longer occupies.
+ */
+ onboardingChecklistCollapsed?: boolean;
};
/** `filterBridgeTypes` entry standing for "no messaging app", which has no
diff --git a/console/apps/switch-console-desktop/tooling/fixtures/baseline.db b/console/apps/switch-console-desktop/tooling/fixtures/baseline.db
index 20e733efb..200cd30a2 100644
Binary files a/console/apps/switch-console-desktop/tooling/fixtures/baseline.db and b/console/apps/switch-console-desktop/tooling/fixtures/baseline.db differ
diff --git a/console/apps/switch-console-desktop/tooling/fixtures/empty.db b/console/apps/switch-console-desktop/tooling/fixtures/empty.db
index cbdddee6e..159b6be1f 100644
Binary files a/console/apps/switch-console-desktop/tooling/fixtures/empty.db and b/console/apps/switch-console-desktop/tooling/fixtures/empty.db differ