Skip to content

The agent that grows with you

feat(desktop): restore main's first-run intro machinery under onboarding/first-run

alt-glitchb50e71d550a1
diff --git a/apps/desktop/src/app/chat/chat-swap-overlay.tsx b/apps/desktop/src/app/chat/chat-swap-overlay.tsx
index 4e8068f2a45..0dd4757b41e 100644
--- a/apps/desktop/src/app/chat/chat-swap-overlay.tsx
+++ b/apps/desktop/src/app/chat/chat-swap-overlay.tsx
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react'
+import { useOnboardingChatActive } from '@/components/onboarding/first-run/assembly'
import { GlyphSpinner } from '@/components/ui/glyph-spinner'
import { useI18n } from '@/i18n'
import { cn } from '@/lib/utils'
@@ -9,6 +10,7 @@ import { cn } from '@/lib/utils'
// the label doesn't blank. Purely visual — pointer-events-none.
export function ChatSwapOverlay({ profile }: { profile: string | null }) {
const { t } = useI18n()
+ const onboarding = useOnboardingChatActive()
const [label, setLabel] = useState<null | string>(profile)
useEffect(() => {
@@ -17,6 +19,12 @@ export function ChatSwapOverlay({ profile }: { profile: string | null }) {
}
}, [profile])
+ // The first run may swap into the default profile, which the user did not ask for.
+ // "Waking up default…" over the greeting reads as a stall in the moment that has to feel instant.
+ if (onboarding) {
+ return null
+ }
+
return (
<div
aria-hidden
diff --git a/apps/desktop/src/app/chat/composer/controls.tsx b/apps/desktop/src/app/chat/composer/controls.tsx
index 8cecbee42fc..dc278982791 100644
--- a/apps/desktop/src/app/chat/composer/controls.tsx
+++ b/apps/desktop/src/app/chat/composer/controls.tsx
@@ -45,6 +45,7 @@ export function ComposerControls({
disabled,
foldVoice = false,
hasComposerPayload,
+ hideModelPill = false,
minimal = false,
state,
voiceStatus,
@@ -61,6 +62,7 @@ export function ComposerControls({
disabled: boolean
foldVoice?: boolean
hasComposerPayload: boolean
+ hideModelPill?: boolean
minimal?: boolean
state: ChatBarState
voiceStatus: VoiceStatus
@@ -115,8 +117,12 @@ export function ComposerControls({
<div className="flex min-w-0 shrink items-center gap-(--composer-control-gap)">
{minimal ? null : (
<>
- <ModelPill compact={compactModelPill} disabled={disabled} model={state.model} />
- {compactModelPill ? null : <ReasoningPill disabled={disabled} model={state.model} />}
+ {hideModelPill ? null : (
+ <>
+ <ModelPill compact={compactModelPill} disabled={disabled} model={state.model} />
+ {compactModelPill ? null : <ReasoningPill disabled={disabled} model={state.model} />}
+ </>
+ )}
{voiceControls}
</>
)}
diff --git a/apps/desktop/src/app/chat/composer/index.tsx b/apps/desktop/src/app/chat/composer/index.tsx
index b0677d8bc7e..42dd963cbc8 100644
--- a/apps/desktop/src/app/chat/composer/index.tsx
+++ b/apps/desktop/src/app/chat/composer/index.tsx
@@ -14,6 +14,7 @@ import {
import { useTourMarker } from '@/app/chat/tour-marker'
import { useHudComposerDrag } from '@/app/hud/composer-drag'
import { composerFloatingStrip, composerInputBacking } from '@/components/chat/composer-dock'
+import { useSetupChatView } from '@/components/onboarding/first-run/assembly'
import { OnboardingSkip } from '@/components/onboarding/skip-setup'
import { Button } from '@/components/ui/button'
import { Slot as ContribSlot } from '@/contrib/react/slot'
@@ -31,6 +32,7 @@ import { POPOUT_WIDTH_REM } from '@/store/composer-popout'
import { parkQueuedPrompts, removeQueuedPrompt, unparkQueuedPrompts } from '@/store/composer-queue'
import { $hudMode } from '@/store/hud'
import { $showsAdvancedChrome } from '@/store/interface-mode'
+import { $chatOnboardingSolo } from '@/store/onboarding-intro'
import { sessionBlockingPrompt } from '@/store/prompts'
import { toggleReview } from '@/store/review'
import { $gatewayState } from '@/store/session'
@@ -181,9 +183,15 @@ export function ChatBar({
// queue uses the stored-session fallback key (prompts can queue pre-resume).
const statusSessionId = sessionId ?? null
- // The git row (branch / worktree / PR / review) is a coding instrument;
- // Simple mode hides it everywhere.
- const codingRowShown = useStore($showsAdvancedChrome)
+ // The guide's conversational steps have no use for the model pill and git
+ // controls. Solo covers startup before the guide's session ids are known.
+ // Once the intro has ended the onboarding chat is a normal chat again.
+ const guidedChat = useSetupChatView()
+ const chatOnboardingSolo = useStore($chatOnboardingSolo)
+ // The git row (branch / worktree / PR / review) is the coding instrument the
+ // guide already hides; Simple mode hides it for the same reason, everywhere.
+ const showsAdvancedChrome = useStore($showsAdvancedChrome)
+ const codingRowShown = !guidedChat && showsAdvancedChrome
const composerTourMarker = useTourMarker('composer')
@@ -1114,7 +1122,8 @@ export function ChatBar({
disabled={disabled}
foldVoice={foldVoice}
hasComposerPayload={hasComposerPayload}
- minimal={minimal}
+ hideModelPill={guidedChat}
+ minimal={minimal || chatOnboardingSolo}
onDictate={dictate}
onQueue={queueDraft}
onToggleAutoSpeak={handleToggleAutoSpeak}
@@ -1424,7 +1433,7 @@ export function ChatBar({
/>
)}
<div className="relative w-full rounded-[inherit]">
- {!hudMode && (
+ {!hudMode && !guidedChat && (
<StatusDrawerToggle
collapsed={statusDrawerCollapsed}
controls={`${statusDrawerId} ${codingDrawerId}`}
diff --git a/apps/desktop/src/app/chat/index.tsx b/apps/desktop/src/app/chat/index.tsx
index 730ce13c3cd..08ca23341c5 100644
--- a/apps/desktop/src/app/chat/index.tsx
+++ b/apps/desktop/src/app/chat/index.tsx
@@ -11,6 +11,9 @@ import { Thread } from '@/components/assistant-ui/thread'
import { TranscriptWindowProvider } from '@/components/assistant-ui/thread/transcript-window'
import { Backdrop } from '@/components/Backdrop'
import { COMPOSER_HEART_CONFIG, HeartField } from '@/components/chat/vibe-hearts'
+import { useSetupChatView } from '@/components/onboarding/first-run/assembly'
+import { $introHoldsThread } from '@/components/onboarding/first-run/intro'
+import { IntroCopy } from '@/components/onboarding/first-run/intro-copy'
import { usePaneGroup, usePaneVisible } from '@/components/pane-shell/pane-visibility'
import { $hoveredTreeGroup, $sessionTileDragging, $sessionTileEdgeHover } from '@/components/pane-shell/tree/store'
import { PromptOverlays } from '@/components/prompt-overlays'
@@ -26,6 +29,7 @@ import { migrateSessionDraft } from '@/store/composer'
import { migrateQueuedPrompts, parkQueuedPrompts } from '@/store/composer-queue'
import { $introSplash } from '@/store/intro-splash'
import { $pinnedSessionIds } from '@/store/layout'
+import { $introView } from '@/store/onboarding-intro'
import { $petActive } from '@/store/pet'
import { $petOverlayActive } from '@/store/pet-overlay'
import { $activeGatewayProfile, $gatewaySwapTarget, $hydrationSyncProfile, $profiles } from '@/store/profile'
@@ -48,7 +52,7 @@ import {
import { $focusedStoredSessionId } from '@/store/session-focus'
import { $sessionStates, sessionTileDelegate } from '@/store/session-states'
import { $transcriptTailBySessionId, transcriptTailState } from '@/store/transcript-tail'
-import { isAuxiliaryWindow } from '@/store/windows'
+import { isAuxiliaryWindow, isMainWindow } from '@/store/windows'
import { primaryRouteSelectedSessionId, routeSessionId } from '../routes'
import { titlebarHeaderBaseClass, titlebarHeaderShadowClass, titlebarHeaderTitleClass } from '../shell/titlebar'
@@ -517,6 +521,8 @@ const ChatViewContent = memo(function ChatViewContent({
const composerScope = useComposerScope()
const composerSurfaceId = useComposerSurfaceId()
const isPrimary = view.kind === 'primary'
+ const introHoldsThread = useStore($introHoldsThread) && isPrimary && isMainWindow()
+ const guideStarted = useStoreSelector($introView, introView => introView === 'intro' || introView === 'ended')
const activeSessionId = useStore(view.$runtimeId)
const transcriptStoredSessionId = useStoreSelector($sessionStates, states =>
@@ -524,6 +530,7 @@ const ChatViewContent = memo(function ChatViewContent({
)
const storedId = useStore(view.$storedId)
+ const setupChat = useSetupChatView()
// Multi-pane dimming: only the focused surface paints at full strength, so
// two sessions side by side read as "this one, and that one over there".
// A selector, not a plain useStore — the focused id changes on click, and a
@@ -746,7 +753,9 @@ const ChatViewContent = memo(function ChatViewContent({
data-chat-unfocused={surfaceFocused || surfaceHovered ? undefined : ''}
data-composer-surface-id={composerSurfaceId}
data-composer-target={composerScope.target}
+ data-guide-arrived={isPrimary && guideStarted ? '' : undefined}
data-session-anchor={sessionAnchor}
+ data-setup-chat={setupChat ? '' : undefined}
>
<Backdrop />
{/* Tiles get their chrome from the layout zone (chip strip); the modal
@@ -776,6 +785,7 @@ const ChatViewContent = memo(function ChatViewContent({
>
<div
className="relative min-h-0 max-w-full flex-1 overflow-hidden bg-(--ui-chat-surface-background) contain-[layout_paint]"
+ data-intro-holding={introHoldsThread ? '' : undefined}
data-slot="composer-bounds"
{...dropHandlers}
>
@@ -793,6 +803,7 @@ const ChatViewContent = memo(function ChatViewContent({
sessionId={activeSessionId}
sessionKey={threadKey}
/>
+ {isPrimary && isMainWindow() && <IntroCopy />}
{resumeExhausted && routedSessionId && (
<ResumeExhaustedOverlay onRetryResume={onRetryResume} sessionId={routedSessionId} />
)}
diff --git a/apps/desktop/src/app/command-palette/index.tsx b/apps/desktop/src/app/command-palette/index.tsx
index 3ca47539459..1c62d1c8548 100644
--- a/apps/desktop/src/app/command-palette/index.tsx
+++ b/apps/desktop/src/app/command-palette/index.tsx
@@ -14,6 +14,7 @@ import {
HUD_TEXT
} from '@/app/floating-hud'
import { SESSION_IMPORT_ROUTE } from '@/app/routes'
+import { leaveIntro } from '@/components/onboarding/first-run/intro'
import { codiconIcon } from '@/components/ui/codicon'
import { Command, CommandGroup, CommandInput, CommandItem, CommandList } from '@/components/ui/command'
import { HighlightMatches } from '@/components/ui/highlight-matches'
@@ -1586,6 +1587,8 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
completeFlow('command_palette')
recordAction(item.action ?? 'other', 'palette')
+ // A Cmd-K command or layout is a way out of the first-run intro.
+ leaveIntro()
if (item.runWithEvent) {
item.runWithEvent(lastSelectMods.current)
diff --git a/apps/desktop/src/app/contrib/layout-presets.ts b/apps/desktop/src/app/contrib/layout-presets.ts
index 0ed3dafa14a..f66c0faef23 100644
--- a/apps/desktop/src/app/contrib/layout-presets.ts
+++ b/apps/desktop/src/app/contrib/layout-presets.ts
@@ -81,6 +81,12 @@ const TERMINAL_TREE = split(
// reading open while nothing shows.
const TERMINAL_RESTING = ['terminal', 'files', 'review'] as const
+// The first-run intro's borrowed layout: the chat alone, no tab strip. Unlisted,
+// and applied while layout persistence is held (onboarding/first-run/assembly.ts).
+export const DEMO_LAYOUT_ID = 'demo'
+
+export const DEMO_TREE = group(['workspace'], { tabStrip: 'never' })
+
const QUAD_TREE = split(
'column',
[
@@ -114,6 +120,7 @@ export function registerLayoutPresets() {
resting: TERMINAL_RESTING,
tier: 'advanced'
},
- { id: 'quad', title: 'Quad', order: 30, tree: QUAD_TREE, tier: 'advanced' }
+ { id: 'quad', title: 'Quad', order: 30, tree: QUAD_TREE, tier: 'advanced' },
+ { id: DEMO_LAYOUT_ID, listed: false, title: 'Demo', order: 40, tree: DEMO_TREE }
])
}
diff --git a/apps/desktop/src/app/contrib/surfaces.tsx b/apps/desktop/src/app/contrib/surfaces.tsx
index e96c7435838..1308c69291e 100644
--- a/apps/desktop/src/app/contrib/surfaces.tsx
+++ b/apps/desktop/src/app/contrib/surfaces.tsx
@@ -15,6 +15,7 @@ import { ContribBoundary, ContribRender } from '@/contrib/react/boundary'
import { useContributions } from '@/contrib/react/use-contributions'
import { $activeConnectionId } from '@/store/connections'
import { $gateway } from '@/store/gateway'
+import { $chatOnboardingSolo } from '@/store/onboarding-intro'
import { $activeGatewayProfile } from '@/store/profile'
import { $freshDraftReady, $gatewayState } from '@/store/session'
@@ -82,6 +83,7 @@ export const StatusbarSurface = memo(function StatusbarSurface({
const activeConnectionId = useStore($activeConnectionId)
const activeGatewayProfile = useStore($activeGatewayProfile)
const gatewayState = useStore($gatewayState)
+ const demoLayout = useStore($chatOnboardingSolo)
const freshDraftReady = useStore($freshDraftReady)
const gatewayScope = `${activeConnectionId ?? ''}\0${activeGatewayProfile}`
const { inferenceStatus, statusSnapshot } = useStatusSnapshot(gatewayState, actions.requestGateway, gatewayScope)
@@ -105,7 +107,8 @@ export const StatusbarSurface = memo(function StatusbarSurface({
toggleCommandCenter: actions.toggleCommandCenter
})
- return <StatusbarControls items={statusbarItems} leftItems={leftStatusbarItems} />
+ // The demo layout (first-run intro) has no status bar.
+ return demoLayout ? null : <StatusbarControls items={statusbarItems} leftItems={leftStatusbarItems} />
})
/** The workspace pane: the real route table (chat + full-page views + plugin
diff --git a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
index 6d8bde8b858..747bf6739db 100644
--- a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
@@ -26,6 +26,7 @@ import { formatElapsed, useElapsedSeconds, useMeasuredDuration } from '@/compone
import { ActivityTimerText } from '@/components/chat/activity-timer-text'
import { GeneratedImage } from '@/components/chat/generated-image-result'
import { SCAFFOLD_LABEL_CLASS, SCAFFOLD_META_CLASS, ScaffoldRow } from '@/components/chat/scaffold-row'
+import { useOnboardingChatActive } from '@/components/onboarding/first-run/assembly'
import { useI18n } from '@/i18n'
import { mcpTargets, toolLabels } from '@/lib/connector-tools'
import { generatedImageFromResult } from '@/lib/generated-images'
@@ -367,6 +368,10 @@ const ReasoningAccordionGroup: FC<{ children?: ReactNode; endIndex: number; star
const showReasoning = useStore($showReasoning)
const messageId = useAuiState(s => s.message.id)
const messageRunning = useAuiState(s => s.message.status?.type === 'running')
+ // The guide's reasoning is it reading its own runbook ("Now step 4: offer
+ // the layout picker"), and a first-time user reading that alongside the
+ // greeting breaks the one conversation the guide is trying to have.
+ const guidedChat = useOnboardingChatActive()
const pending = useAuiState(
s =>
@@ -405,7 +410,7 @@ const ReasoningAccordionGroup: FC<{ children?: ReactNode; endIndex: number; star
}, undefined)
)
- if (!hasContent || !showReasoning) {
+ if (!hasContent || guidedChat || !showReasoning) {
return null
}
diff --git a/apps/desktop/src/components/assistant-ui/thread/status.tsx b/apps/desktop/src/components/assistant-ui/thread/status.tsx
index d9ebf1575f4..8c9431d4c61 100644
--- a/apps/desktop/src/components/assistant-ui/thread/status.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/status.tsx
@@ -8,6 +8,7 @@ import { toolPresentVerb } from '@/components/assistant-ui/tool/run-summary'
import { useElapsedSeconds } from '@/components/chat/activity-timer'
import { ActivityTimerText } from '@/components/chat/activity-timer-text'
import { SCAFFOLD_LABEL_CLASS } from '@/components/chat/scaffold-row'
+import { useOnboardingChatActive } from '@/components/onboarding/first-run/assembly'
import { Codicon } from '@/components/ui/codicon'
import { Loader } from '@/components/ui/loader'
import { StatusPulse } from '@/components/ui/status-pulse'
@@ -369,7 +370,9 @@ const TurnActivityRow: FC<TurnActivityRowProps> = ({ active, elapsed, hint, loca
export const TurnActivityIndicator: FC<{ thinking?: boolean }> = ({ thinking = false }) => {
// Same rule the reasoning disclosure renders by (message-parts.tsx).
const showReasoning = useStore($showReasoning)
- const activity = useAuiState(s => activitySignature(s.message.content, showReasoning))
+ const guidedChat = useOnboardingChatActive()
+ const reasoningShown = showReasoning && !guidedChat
+ const activity = useAuiState(s => activitySignature(s.message.content, reasoningShown))
// Timestamp of the last visible progress, held from the moment the quiet
// spell qualifies. Holding the timestamp (not a boolean) is what lets the
@@ -443,7 +446,7 @@ export const TurnActivityIndicator: FC<{ thinking?: boolean }> = ({ thinking = f
// A reply that has only thought so far, with the thinking not drawn, has
// still put nothing on screen: it keeps the pre-first-token row.
- if (thinking && !showReasoning) {
+ if (thinking && !reasoningShown) {
return <ResponseLoadingIndicator />
}
diff --git a/apps/desktop/src/components/gateway-connecting-overlay.tsx b/apps/desktop/src/components/gateway-connecting-overlay.tsx
index b43e18c78f8..5ddc8db3e90 100644
--- a/apps/desktop/src/components/gateway-connecting-overlay.tsx
+++ b/apps/desktop/src/components/gateway-connecting-overlay.tsx
@@ -2,11 +2,14 @@ import type { ConnectionState } from '@hermes/shared'
import { useStore } from '@nanostores/react'
import { useEffect, useRef, useState } from 'react'
+import { Button } from '@/components/ui/button'
import { DecodeText } from '@/components/ui/decode-text'
import { prefersReducedMotion } from '@/hooks/use-media-query'
+import { useI18n } from '@/i18n'
import { cn } from '@/lib/utils'
import { $desktopBoot, type DesktopBootState } from '@/store/boot'
import { $gatewaySwitching } from '@/store/gateway-switch'
+import { $introStartExit, $introView } from '@/store/onboarding-intro'
import { $onboardingDecided, ONBOARDING_DECIDE_DEADLINE_MS } from '@/store/onboarding-presence'
import { $gatewayState } from '@/store/session'
import { isMainWindow } from '@/store/windows'
@@ -57,10 +60,26 @@ function isInitialConnect(
interface ConnectingOverlayViewProps {
decoding: boolean
+ onExit: (() => void) | null
phase: Phase
}
-function ConnectingOverlayView({ decoding, phase }: ConnectingOverlayViewProps) {
+/** The first-run start outlasted the boot budget: it keeps waiting, and the person may go on without setup. */
+function SlowSetupStart({ onExit }: { onExit: () => void }) {
+ const { t } = useI18n()
+
+ return (
+ <div className="grid max-w-xs justify-items-center gap-3 text-center" role="status">
+ <div className="text-sm font-medium text-foreground">{t.onboarding.setupSlowTitle}</div>
+ <div className="text-xs text-muted-foreground">{t.onboarding.setupSlowBody}</div>
+ <Button onClick={onExit} size="sm" type="button" variant="secondary">
+ {t.onboarding.continueWithoutSetup}
+ </Button>
+ </div>
+ )
+}
+
+function ConnectingOverlayView({ decoding, onExit, phase }: ConnectingOverlayViewProps) {
const leaving = phase !== 'live'
const overlayHidden = phase === 'overlay-out' || phase === 'gone'
@@ -75,28 +94,61 @@ function ConnectingOverlayView({ decoding, phase }: ConnectingOverlayViewProps)
// in styles.css.
data-glass-opaque=""
>
- <DecodeText
- active={decoding}
- className={cn(
- 'pl-[0.4em] text-(--theme-primary) transition duration-300 ease-out',
- leaving ? 'translate-y-2 opacity-0 saturate-0' : 'translate-y-0 opacity-100 saturate-100'
- )}
- cursor
- loop
- prefix={4}
- text={TEXT}
- />
+ {onExit ? (
+ <SlowSetupStart onExit={onExit} />
+ ) : (
+ <DecodeText
+ active={decoding}
+ className={cn(
+ 'pl-[0.4em] text-(--theme-primary) transition duration-300 ease-out',
+ leaving ? 'translate-y-2 opacity-0 saturate-0' : 'translate-y-0 opacity-100 saturate-100'
+ )}
+ cursor
+ loop
+ prefix={4}
+ text={TEXT}
+ />
+ )}
</div>
)
}
+/**
+ * Held until the app knows whether onboarding runs, so the chat never flashes before it: a short
+ * deadline, never the free account. Once onboarding runs, the first-run intro's `starting` screen is
+ * this overlay and stays up until its chat is open, offering a way out when the start is slow.
+ */
+function useOnboardingHold(gatewayState: ConnectionState, previewing: boolean) {
+ const onboardingDecided = useStore($onboardingDecided)
+ const introView = useStore($introView)
+ const introStartExit = useStore($introStartExit)
+ const [decideExpired, setDecideExpired] = useState(false)
+
+ useEffect(() => {
+ if (gatewayState !== 'open' || onboardingDecided) {
+ return
+ }
+
+ const id = window.setTimeout(() => setDecideExpired(true), ONBOARDING_DECIDE_DEADLINE_MS)
+
+ return () => window.clearTimeout(id)
+ }, [gatewayState, onboardingDecided])
+
+ const watching = !previewing && isMainWindow()
+ const introStarting = watching && introView === 'starting'
+
+ return {
+ holds: introStarting || (watching && !onboardingDecided && !decideExpired),
+ onExit: introStarting ? introStartExit : null
+ }
+}
+
export function GatewayConnectingOverlay() {
const gatewayState = useStore($gatewayState)
const boot = useStore($desktopBoot)
const gatewaySwitching = useStore($gatewaySwitching)
- const onboardingDecided = useStore($onboardingDecided)
- const [decideExpired, setDecideExpired] = useState(false)
const [previewing] = useState(forcedPreview)
+ const { holds: onboardingHolds, onExit } = useOnboardingHold(gatewayState, previewing)
const reduce = prefersReducedMotion()
// Under reduced motion, skip the multi-phase exit choreography (text-out →
// hold → overlay fade) and jump straight to gone so the overlay unmounts
@@ -122,20 +174,6 @@ export function GatewayConnectingOverlay() {
shownRef.current = true
}
- // Held until the app knows whether onboarding runs, so the chat never flashes before it.
- // A short deadline, never the free account: onboarding does not wait for the mint.
- const onboardingHolds = !previewing && isMainWindow() && !onboardingDecided && !decideExpired
-
- useEffect(() => {
- if (gatewayState !== 'open' || onboardingDecided) {
- return
- }
-
- const id = window.setTimeout(() => setDecideExpired(true), ONBOARDING_DECIDE_DEADLINE_MS)
-
- return () => window.clearTimeout(id)
- }, [gatewayState, onboardingDecided])
-
// Kick off the exit when connected: real connect, or a faked timer in preview.
useEffect(() => {
if (phase !== 'live') {
@@ -197,6 +235,7 @@ export function GatewayConnectingOverlay() {
return (
<ConnectingOverlayView
decoding={phase === 'live' && (previewing || connecting)}
+ onExit={onExit}
phase={phase}
/>
)
diff --git a/apps/desktop/src/components/onboarding/first-run/assembly.ts b/apps/desktop/src/components/onboarding/first-run/assembly.ts
new file mode 100644
index 00000000000..29ddfd09cd1
--- /dev/null
+++ b/apps/desktop/src/components/onboarding/first-run/assembly.ts
@@ -0,0 +1,223 @@
+import { useStore } from '@nanostores/react'
+import { atom } from 'nanostores'
+
+import { useSessionView } from '@/app/chat/session-view'
+import { DEMO_LAYOUT_ID, DEMO_TREE } from '@/app/contrib/layout-presets'
+import { allPaneIds, isLayoutNode, type LayoutNode } from '@/components/pane-shell/tree/model'
+import { applyLayoutPreset } from '@/components/pane-shell/tree/presets'
+import {
+ $activePresetId,
+ $layoutTree,
+ $userPlacedPanes,
+ adoptContributedPanes,
+ dismissTreePane,
+ markActivePreset,
+ persistTree,
+ resetEnforcedDocks,
+ undismissTreePanes
+} from '@/components/pane-shell/tree/store'
+import { registry } from '@/contrib/registry'
+import { isOnboardingEnabled } from '@/lib/onboarding-enabled'
+import { useStoreSelector } from '@/lib/use-session-slice'
+import { $interfaceMode, type InterfaceMode, modeLayout, setInterfaceMode } from '@/store/interface-mode'
+import { setSidebarOpen } from '@/store/layout'
+import { $chatOnboardingSolo, $introView } from '@/store/onboarding-intro'
+import { $paneStates, type PaneStateSnapshot } from '@/store/panes'
+import { $activeSessionId, $selectedStoredSessionId } from '@/store/session'
+
+// The demo is borrowed: nothing it changes is persisted as the user's layout.
+$chatOnboardingSolo.subscribe(solo => {
+ modeLayout.hold(solo)
+ document.documentElement.toggleAttribute('data-onboarding-demo', solo)
+})
+
+export const $chatOnboardingThreadIds = atom<readonly string[]>([])
+
+export const $chatLayoutPicked = atom(false)
+
+let previousLayout: {
+ id: string
+ tree: LayoutNode | null
+ panes: Record<string, PaneStateSnapshot>
+ placed: ReadonlySet<string>
+} | null = null
+
+export function openDemoLayout(): void {
+ if ($chatOnboardingSolo.get()) {
+ return
+ }
+
+ startChatOnboardingSolo()
+
+ if ($chatOnboardingSolo.get()) {
+ window.hermesDesktop?.chatOnboarding?.size('onboarding')
+ }
+}
+
+function startChatOnboardingSolo(): void {
+ if (!isOnboardingEnabled() || $chatOnboardingSolo.get()) {
+ return
+ }
+
+ previousLayout = {
+ id: $activePresetId.get(),
+ tree: $layoutTree.get(),
+ panes: $paneStates.get(),
+ placed: $userPlacedPanes.get()
+ }
+ $chatOnboardingSolo.set(true)
+ $chatLayoutPicked.set(false)
+ applyLayoutPreset(DEMO_LAYOUT_ID, DEMO_TREE)
+}
+
+/** Leave the demo for the user's own layout at the normal window size. */
+export function endChatOnboardingSolo(): void {
+ if ($chatOnboardingSolo.get()) {
+ window.hermesDesktop?.chatOnboarding?.size('normal')
+ }
+
+ $chatOnboardingSolo.set(false)
+ restorePreviousLayout()
+}
+
+/** Leave the demo on the layout just picked in it: drop the snapshot, release the hold, save the pick. */
+export function keepChatOnboardingLayout(): void {
+ previousLayout = null
+
+ if ($chatOnboardingSolo.get()) {
+ window.hermesDesktop?.chatOnboarding?.size('normal')
+ }
+
+ $chatOnboardingSolo.set(false)
+ persistTree()
+}
+
+function restorePreviousLayout() {
+ const previous = previousLayout
+ previousLayout = null
+
+ if (previous) {
+ const tree = previous.tree ?? registry.getArea('layouts').find(preset => preset.id === 'default')?.data
+
+ if (isLayoutNode(tree)) {
+ $layoutTree.set(tree)
+ $paneStates.set(previous.panes)
+ $userPlacedPanes.set(previous.placed)
+ markActivePreset(previous.tree ? previous.id : 'default')
+ persistTree()
+ }
+ }
+}
+
+function reconcileLayout(id: string, tree: LayoutNode): void {
+ applyLayoutPreset(id, tree)
+
+ const declared = new Set(allPaneIds(tree))
+
+ undismissTreePanes(declared)
+
+ const dismissUndeclared = () => {
+ for (const paneId of new Set([
+ ...allPaneIds($layoutTree.get() ?? tree),
+ ...registry.getArea('panes').map(pane => pane.id)
+ ])) {
+ if (!declared.has(paneId)) {
+ dismissTreePane(paneId)
+ }
+ }
+ }
+
+ setSidebarOpen(true)
+
+ resetEnforcedDocks()
+ adoptContributedPanes()
+
+ dismissUndeclared()
+}
+
+export function assembleChatOnboarding(id: string, tree: LayoutNode, mode?: InterfaceMode): void {
+ $chatOnboardingSolo.set(false)
+
+ if (mode && mode !== $interfaceMode.get()) {
+ restorePreviousLayout()
+ setInterfaceMode(mode)
+ }
+
+ previousLayout = null
+
+ window.hermesDesktop?.chatOnboarding?.size('normal')
+
+ reconcileLayout(id, tree)
+}
+
+export function snapshotChatLayout(): () => void {
+ const snapshot = {
+ id: $activePresetId.get(),
+ mode: $interfaceMode.get(),
+ panes: $paneStates.get(),
+ picked: $chatLayoutPicked.get(),
+ placed: $userPlacedPanes.get(),
+ previous: previousLayout,
+ solo: $chatOnboardingSolo.get(),
+ tree: $layoutTree.get()
+ }
+
+ return () => {
+ if (snapshot.mode !== $interfaceMode.get()) {
+ setInterfaceMode(snapshot.mode)
+ }
+
+ // A pick made in the demo ended the intro, so undoing it lands on the user's own layout.
+ if (snapshot.solo) {
+ previousLayout = snapshot.previous
+ restorePreviousLayout()
+ $chatLayoutPicked.set(snapshot.picked)
+
+ return
+ }
+
+ if (snapshot.tree) {
+ $layoutTree.set(snapshot.tree)
+ $paneStates.set(snapshot.panes)
+ $userPlacedPanes.set(snapshot.placed)
+ markActivePreset(snapshot.id)
+ persistTree()
+ }
+
+ previousLayout = snapshot.previous
+ $chatLayoutPicked.set(snapshot.picked)
+ }
+}
+
+/** The setup chat is guided only while the intro runs; in `ended` or `off` it is a normal chat. The
+ * thread ids outlive the intro so a later `start_chat` from that chat is still recognized. */
+export function useOnboardingChatActive(): boolean {
+ const solo = useStore($chatOnboardingSolo)
+ const intro = useStore($introView) === 'intro'
+ const threadIds = useStore($chatOnboardingThreadIds)
+ const runtimeId = useStore($activeSessionId)
+ const storedId = useStore($selectedStoredSessionId)
+
+ return (
+ solo ||
+ (intro &&
+ ((runtimeId != null && threadIds.includes(runtimeId)) || (storedId != null && threadIds.includes(storedId))))
+ )
+}
+
+/** Whether the chat view this renders in (primary or a tile) shows the setup
+ * chat while the intro runs. Solo covers the primary view before the guide's
+ * session ids are known; in `ended` or `off` the setup chat is a normal chat. */
+export function useSetupChatView(): boolean {
+ const view = useSessionView()
+ const solo = useStore($chatOnboardingSolo)
+ const intro = useStore($introView) === 'intro'
+ const runtimeId = useStore(view.$runtimeId)
+ const storedId = useStore(view.$storedId)
+
+ const inThread = useStoreSelector($chatOnboardingThreadIds, ids =>
+ [runtimeId, storedId].some(id => id != null && ids.includes(id))
+ )
+
+ return (view.kind === 'primary' && solo) || (intro && inThread)
+}
diff --git a/apps/desktop/src/components/onboarding/first-run/intro-copy.css b/apps/desktop/src/components/onboarding/first-run/intro-copy.css
new file mode 100644
index 00000000000..f3d5ec2cba2
--- /dev/null
+++ b/apps/desktop/src/components/onboarding/first-run/intro-copy.css
@@ -0,0 +1,91 @@
+/* The demo layout's narrower reading column (the landed column read a tad too wide). */
+:root[data-onboarding-demo] {
+ --composer-width: 36rem;
+}
+
+/* Covers the empty setup chat above the composer until the first assistant row lands. */
+[data-slot='intro-copy'] {
+ position: absolute;
+ inset: 0 0 var(--composer-measured-height);
+ z-index: 20;
+ pointer-events: none;
+ background: var(--ui-chat-surface-background);
+}
+
+/* The thread waits under the copy until the spring settles (`$introHoldsThread`). */
+[data-intro-holding] > [data-slot='thread'] {
+ visibility: hidden;
+}
+
+/* Same column as the thread content, so the risen copy sits where the first message lands. */
+.intro-copy-text {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ display: grid;
+ gap: 0.35rem;
+ width: min(var(--composer-width), 100%);
+ padding-inline: 1.5rem;
+ color: var(--ui-text-primary);
+ font-size: 1.125rem;
+ font-weight: 500;
+ line-height: 1.45;
+ text-align: center;
+ transform: translate(-50%, -50%);
+ transition:
+ top 530ms cubic-bezier(0.34, 1.45, 0.64, 1),
+ transform 530ms cubic-bezier(0.34, 1.45, 0.64, 1),
+ font-size 530ms ease,
+ gap 530ms ease;
+}
+
+.intro-copy-text p {
+ min-height: 1lh;
+ margin: 0;
+}
+
+.intro-copy-second {
+ color: var(--ui-text-secondary);
+ transition: color 530ms ease;
+}
+
+[data-slot='intro-copy'][data-risen] .intro-copy-text {
+ top: calc(var(--titlebar-height) - 0.5rem);
+ gap: var(--paragraph-gap);
+ font-size: var(--conversation-text-font-size);
+ font-weight: 400;
+ line-height: var(--conversation-line-height);
+ text-align: left;
+ transform: translate(-50%, 0);
+}
+
+[data-slot='intro-copy'][data-risen] .intro-copy-second {
+ color: inherit;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .intro-copy-text,
+ .intro-copy-second {
+ transition: none;
+ }
+}
+
+/* The composer dock fades in once the setup guide has arrived (data-guide-arrived on the chat). */
+@keyframes guide-controls-arrive {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+[data-guide-arrived] [data-slot='composer-dock'] {
+ animation: guide-controls-arrive 100ms ease-out;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ [data-guide-arrived] [data-slot='composer-dock'] {
+ animation: none;
+ }
+}
diff --git a/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx b/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx
new file mode 100644
index 00000000000..4b1da494beb
--- /dev/null
+++ b/apps/desktop/src/components/onboarding/first-run/intro-copy.tsx
@@ -0,0 +1,118 @@
+import './intro-copy.css'
+
+import { useStore } from '@nanostores/react'
+import { useEffect, useState } from 'react'
+
+import { useSessionView } from '@/app/chat/session-view'
+import { useMediaQuery } from '@/hooks/use-media-query'
+import { chatMessageText } from '@/lib/chat-messages'
+import { useStoreSelector } from '@/lib/use-session-slice'
+
+import { $introCopy, $introTurnSent } from './intro'
+
+// App-owned, English only. The backend's prelude writes the same words (GREETING in
+// agent/onboarding_text.py; keep the two equal) as the onboarding chat's first assistant row, which
+// replaces this copy once it lands.
+const LINES = ["Hi, I'm Hermes.", "Let's set things up for you. Then we'll get something cool done."] as const
+
+// The boot overlay (the `starting` screen) clears its text before it fades; typing starts under the fade.
+const START_MS = 660
+const LINE_1_MS = (LINES[0].length * 1000) / 26
+const LINE_GAP_MS = 300
+const LINE_2_MS = (LINES[1].length * 1000) / 48
+// Typing never runs past 2.5 s: a throttled frame snaps the rest in.
+const TYPED_MS = Math.min(LINE_1_MS + LINE_GAP_MS + LINE_2_MS, 2500)
+const HOLD_MS = 250
+const SPRING_MS = 530
+
+function typedAt(elapsed: number): readonly [string, string] {
+ if (elapsed >= TYPED_MS) {
+ return LINES
+ }
+
+ const first = Math.floor((Math.min(elapsed, LINE_1_MS) / LINE_1_MS) * LINES[0].length)
+ const second = Math.floor((Math.max(0, elapsed - LINE_1_MS - LINE_GAP_MS) / LINE_2_MS) * LINES[1].length)
+
+ return [LINES[0].slice(0, first), LINES[1].slice(0, Math.min(second, LINES[1].length))]
+}
+
+/** Centred intro copy that springs up into the empty setup chat. Primary chat view only. */
+export function IntroCopy() {
+ const stage = useStore($introCopy)
+ const view = useSessionView()
+ const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')
+ const [elapsed, setElapsed] = useState(0)
+ const [risen, setRisen] = useState(false)
+
+ // The first visible assistant words land here; a turn that ended without any (an error) shows itself.
+ const landed = useStoreSelector(view.$messages, messages =>
+ messages.some(message => message.role === 'assistant' && !message.hidden && chatMessageText(message).trim())
+ )
+
+ const busy = useStore(view.$busy)
+ const awaiting = useStore(view.$awaitingResponse)
+ const turnSent = useStore($introTurnSent)
+ const settledWithoutWords = turnSent && !busy && !awaiting
+
+ useEffect(() => {
+ if (stage !== 'playing') {
+ return
+ }
+
+ if (reducedMotion) {
+ setElapsed(TYPED_MS)
+ setRisen(true)
+ $introCopy.set('landed')
+
+ return
+ }
+
+ const started = performance.now() + START_MS
+ let frame = 0
+ let timer = 0
+
+ const tick = () => {
+ const now = Math.max(0, performance.now() - started)
+ setElapsed(now)
+
+ if (now < TYPED_MS) {
+ frame = requestAnimationFrame(tick)
+
+ return
+ }
+
+ timer = window.setTimeout(() => {
+ setRisen(true)
+ timer = window.setTimeout(() => $introCopy.set('landed'), SPRING_MS)
+ }, HOLD_MS)
+ }
+
+ frame = requestAnimationFrame(tick)
+
+ return () => {
+ cancelAnimationFrame(frame)
+ window.clearTimeout(timer)
+ }
+ }, [reducedMotion, stage])
+
+ useEffect(() => {
+ if (stage === 'landed' && (landed || settledWithoutWords)) {
+ $introCopy.set('hidden')
+ }
+ }, [landed, settledWithoutWords, stage])
+
+ if (stage === 'hidden') {
+ return null
+ }
+
+ const [first, second] = typedAt(elapsed)
+
+ return (
+ <div aria-label={LINES.join(' ')} data-risen={risen ? '' : undefined} data-slot="intro-copy" role="status">
+ <div aria-hidden="true" className="intro-copy-text">
+ <p>{first}</p>
+ <p className="intro-copy-second">{second}</p>
+ </div>
+ </div>
+ )
+}
diff --git a/apps/desktop/src/components/onboarding/first-run/intro.ts b/apps/desktop/src/components/onboarding/first-run/intro.ts
new file mode 100644
index 00000000000..330834df06b
--- /dev/null
+++ b/apps/desktop/src/components/onboarding/first-run/intro.ts
@@ -0,0 +1,114 @@
+import { atom, computed } from 'nanostores'
+
+import { DEMO_LAYOUT_ID } from '@/app/contrib/layout-presets'
+import { PANE_TOGGLE_REVEAL_EVENT } from '@/components/pane-shell'
+import { $activePresetId } from '@/components/pane-shell/tree/store'
+import { TIP_CATALOG } from '@/lib/tips/catalog'
+import { $sidebarOpen, CHAT_SIDEBAR_PANE_ID } from '@/store/layout'
+import { $introView } from '@/store/onboarding-intro'
+import { $activeGatewayProfile } from '@/store/profile'
+import { $selectedStoredSessionId } from '@/store/session'
+import { retireTips } from '@/store/tips'
+
+import { $chatOnboardingThreadIds, endChatOnboardingSolo, keepChatOnboardingLayout } from './assembly'
+
+/**
+ * The intro copy over an empty onboarding chat: it types centred (`playing`), springs up and waits at
+ * the top (`landed`) until the backend's first assistant row, which carries the same words,
+ * takes its place.
+ */
+type IntroCopyStage = 'hidden' | 'landed' | 'playing'
+
+export const $introCopy = atom<IntroCopyStage>('hidden')
+
+/** While the copy types and springs up, the thread under it stays hidden: the backend's first row and the
+ * card after it can land early, and a see-through chat surface (glass) would show them mid-motion. */
+export const $introHoldsThread = computed($introCopy, stage => stage === 'playing')
+
+/** The opening turn has been handed to the backend (`onboarding.start` submits it), or failed to be. */
+export const $introTurnSent = atom(false)
+
+/** The boot overlay holds while the kickoff opens the onboarding chat; the window takes the demo shape
+ * once `onboarding.start` has answered. */
+export function startIntro(): void {
+ $introView.set('starting')
+}
+
+/** The onboarding chat is open. A chat with no assistant words yet plays the intro copy. */
+export function openIntro(blank: boolean): void {
+ $introView.set('intro')
+ $introCopy.set(blank ? 'playing' : 'hidden')
+}
+
+export function failIntro(): void {
+ $introView.set('off')
+ $introCopy.set('hidden')
+ endChatOnboardingSolo()
+}
+
+// `keepLayout`: a layout pick ends the intro on the picked layout, not on the one from before the intro.
+function endIntroView(keepLayout = false): boolean {
+ if ($introView.get() !== 'intro') {
+ return false
+ }
+
+ $introView.set('ended')
+ $introCopy.set('hidden')
+
+ if (keepLayout) {
+ keepChatOnboardingLayout()
+ } else {
+ endChatOnboardingSolo()
+ }
+
+ return true
+}
+
+/** Any leave action (sidebar, another chat, a profile, a Cmd-K command) ends the intro. */
+export function leaveIntro(): void {
+ endIntroView()
+}
+
+/** A layout pick (the layout card, `set_theme`, the layout picker) ends the intro and keeps the pick. */
+export function leaveIntroOnLayout(): void {
+ endIntroView(true)
+}
+
+/** Skip setup: the intro ends on the previous layout at normal size, and the tutorial tips stop. */
+export function skipIntro(): void {
+ endIntroView()
+ retireTips(TIP_CATALOG.map(tip => tip.id))
+}
+
+function watchLeaveActions(): () => void {
+ const introProfile = $activeGatewayProfile.get()
+
+ // Below the collapse breakpoint ⌘B and the titlebar toggle only send the reveal event.
+ const onReveal = (event: Event) => {
+ // SAFETY: PANE_TOGGLE_REVEAL_EVENT is only dispatched as a CustomEvent with this detail (store/layout.ts).
+ const detail = (event as CustomEvent<{ id?: string; mode?: string }>).detail
+
+ if (detail?.id === CHAT_SIDEBAR_PANE_ID && detail.mode !== 'close') {
+ leaveIntro()
+ }
+ }
+
+ window.addEventListener(PANE_TOGGLE_REVEAL_EVENT, onReveal)
+
+ const stops = [
+ () => window.removeEventListener(PANE_TOGGLE_REVEAL_EVENT, onReveal),
+ $sidebarOpen.listen(() => leaveIntro()),
+ $activePresetId.listen(id => id !== DEMO_LAYOUT_ID && leaveIntroOnLayout()),
+ $activeGatewayProfile.listen(profile => profile !== introProfile && leaveIntro()),
+ $selectedStoredSessionId.listen(id => (!id || !$chatOnboardingThreadIds.get().includes(id)) && leaveIntro())
+ ]
+
+ return () => stops.forEach(stop => stop())
+}
+
+let stopWatching: (() => void) | null = null
+
+$introView.listen(view => {
+ stopWatching?.()
+ stopWatching = view === 'intro' ? watchLeaveActions() : null
+})
diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.tsx
index ee6eae46f3c..457f475fd54 100644
--- a/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.tsx
+++ b/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.tsx
@@ -13,6 +13,7 @@ import { type PointerEvent as ReactPointerEvent, useCallback, useEffect, useRef
import { HUD_SURFACE } from '@/app/floating-hud'
import { TITLEBAR_HEIGHT } from '@/app/shell/titlebar'
+import { useOnboardingChatActive } from '@/components/onboarding/first-run/assembly'
import { Codicon } from '@/components/ui/codicon'
import { ContribBoundary, ContribRender } from '@/contrib/react/boundary'
import { useContributions } from '@/contrib/react/use-contributions'
@@ -210,7 +211,11 @@ export function FloatingPanes() {
const panes = useContributions('panes')
const hidden = useStore($hiddenTreePanes)
- const floating = panes.filter(pane => paneChrome(pane).placement === FLOATING_PLACEMENT && !hidden.has(pane.id))
+ const onboardingActive = useOnboardingChatActive()
+
+ const floating = onboardingActive
+ ? []
+ : panes.filter(pane => paneChrome(pane).placement === FLOATING_PLACEMENT && !hidden.has(pane.id))
if (floating.length === 0) {
return null
diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/narrow-overlays.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/narrow-overlays.tsx
index 09c3f2b3aa6..df98f5e9c41 100644
--- a/apps/desktop/src/components/pane-shell/tree/renderer/narrow-overlays.tsx
+++ b/apps/desktop/src/components/pane-shell/tree/renderer/narrow-overlays.tsx
@@ -15,6 +15,7 @@ import { useContributions } from '@/contrib/react/use-contributions'
import type { Contribution } from '@/contrib/types'
import { ESCAPE_PRIORITY, isTopEscapeLayer, pushEscapeLayer } from '@/lib/escape-layers'
import { cn } from '@/lib/utils'
+import { $chatOnboardingSolo } from '@/store/onboarding-intro'
import { $paneStates } from '@/store/panes'
import { PANE_TOGGLE_REVEAL_EVENT } from '../..'
@@ -46,6 +47,7 @@ export function narrowOverlayWidth(ctx: TrackContext, tree: LayoutNode | null, r
export function NarrowOverlays() {
const narrow = useStore($narrowViewport)
+ const solo = useStore($chatOnboardingSolo)
const tree = useStore($layoutTree)
const panes = useContributions('panes')
const paneStates = useStore($paneStates)
@@ -81,8 +83,10 @@ export function NarrowOverlays() {
const inTree = useMemo(() => new Set(tree ? allPaneIds(tree) : []), [tree])
const collapsibles = useMemo(
- () => panes.filter(p => paneChrome(p).collapsible && inTree.has(p.id) && !hiddenPanes.has(p.id)),
- [panes, inTree, hiddenPanes]
+ // Solo adopts sidebar panes without their surrounding sidebar chrome.
+ // Suppress every reveal path while those panes are intentionally hidden.
+ () => (solo ? [] : panes.filter(p => paneChrome(p).collapsible && inTree.has(p.id) && !hiddenPanes.has(p.id))),
+ [solo, panes, inTree, hiddenPanes]
)
const collapsiblesRef = useRef(collapsibles)
@@ -91,7 +95,7 @@ export function NarrowOverlays() {
// ⌘B / ⌘G's narrow branch dispatches the app's toggle-reveal event with the
// REAL pane id — accept those via each contribution's revealAliases.
useEffect(() => {
- if (!narrow) {
+ if (!narrow || solo) {
setReveal(null)
return
@@ -143,9 +147,9 @@ export function NarrowOverlays() {
window.removeEventListener(PANE_TOGGLE_REVEAL_EVENT, onToggle)
window.removeEventListener('keydown', onKeyDown)
}
- }, [narrow])
+ }, [narrow, solo])
- if (!narrow || collapsibles.length === 0) {
+ if (!narrow || solo || collapsibles.length === 0) {
return null
}
diff --git a/apps/desktop/src/i18n/ar_boot.ts b/apps/desktop/src/i18n/ar_boot.ts
index 10265e83f5f..cdbd5addefd 100644
--- a/apps/desktop/src/i18n/ar_boot.ts
+++ b/apps/desktop/src/i18n/ar_boot.ts
@@ -252,6 +252,9 @@ export const arBoot = {
headerDesc: 'اربط مزوّد نماذج لبدء المحادثة. معظم الخيارات تتطلب نقرة واحدة.',
preparingInstall: 'يُكمل Hermes التثبيت. عادة ما يستغرق ذلك أقل من دقيقة في أول تشغيل.',
starting: 'جار بدء Hermes...',
+ setupSlowTitle: 'يستغرق الإعداد وقتا أطول من المعتاد.',
+ setupSlowBody: 'لا يزال Hermes قيد البدء في الخلفية.',
+ continueWithoutSetup: 'المتابعة دون إعداد',
lookingUpProviders: 'جار البحث عن المزوّدين...',
collapse: 'طي',
otherProviders: 'مزودون آخرون',
diff --git a/apps/desktop/src/i18n/de_onboarding.ts b/apps/desktop/src/i18n/de_onboarding.ts
index 77c232d15d9..5af5a481b24 100644
--- a/apps/desktop/src/i18n/de_onboarding.ts
+++ b/apps/desktop/src/i18n/de_onboarding.ts
@@ -7,6 +7,9 @@ export const deOnboarding: TranslationOverrides['onboarding'] = {
preparingInstall:
'Hermes schließt die Installation ab. Das dauert beim ersten Start normalerweise unter einer Minute.',
starting: 'Hermes wird gestartet…',
+ setupSlowTitle: 'Die Einrichtung dauert länger als üblich.',
+ setupSlowBody: 'Hermes wird im Hintergrund noch gestartet.',
+ continueWithoutSetup: 'Ohne Einrichtung fortfahren',
lookingUpProviders: 'Anbieter werden gesucht...',
collapse: 'Einklappen',
otherProviders: 'Andere Anbieter',
diff --git a/apps/desktop/src/i18n/en_onboarding.ts b/apps/desktop/src/i18n/en_onboarding.ts
index 764c2924788..b176a9e981e 100644
--- a/apps/desktop/src/i18n/en_onboarding.ts
+++ b/apps/desktop/src/i18n/en_onboarding.ts
@@ -5,6 +5,9 @@ export const enOnboarding: Translations['onboarding'] = {
headerDesc: 'Connect a model provider to start chatting. Most options take one click.',
preparingInstall: 'Hermes is finishing install. This usually takes under a minute on first run.',
starting: 'Starting Hermes…',
+ setupSlowTitle: 'Setup is taking longer than usual.',
+ setupSlowBody: 'Hermes is still starting in the background.',
+ continueWithoutSetup: 'Continue without setup',
lookingUpProviders: 'Looking up providers...',
collapse: 'Collapse',
otherProviders: 'Other providers',
diff --git a/apps/desktop/src/i18n/es_onboarding.ts b/apps/desktop/src/i18n/es_onboarding.ts
index 4bcb974e1ff..95b66b73b64 100644
--- a/apps/desktop/src/i18n/es_onboarding.ts
+++ b/apps/desktop/src/i18n/es_onboarding.ts
@@ -5,6 +5,9 @@ export const esOnboarding: TranslationOverrides['onboarding'] = {
headerDesc: 'Conecta un proveedor de modelo para empezar a chatear. La mayoría de opciones requieren un clic.',
preparingInstall: 'Hermes está terminando la instalación. En el primer inicio suele tardar menos de un minuto.',
starting: 'Iniciando Hermes…',
+ setupSlowTitle: 'La configuración está tardando más de lo habitual.',
+ setupSlowBody: 'Hermes sigue iniciándose en segundo plano.',
+ continueWithoutSetup: 'Continuar sin configurar',
lookingUpProviders: 'Buscando proveedores...',
collapse: 'Contraer',
otherProviders: 'Otros proveedores',
diff --git a/apps/desktop/src/i18n/fr_onboarding.ts b/apps/desktop/src/i18n/fr_onboarding.ts
index 7af3cfbe30b..28989fb9f0b 100644
--- a/apps/desktop/src/i18n/fr_onboarding.ts
+++ b/apps/desktop/src/i18n/fr_onboarding.ts
@@ -6,6 +6,9 @@ export const frOnboarding: TranslationOverrides['onboarding'] = {
'Connectez un fournisseur de modèles pour commencer à discuter. La plupart des options nécessitent un clic.',
preparingInstall: "Hermes finalise l'installation. Cela prend généralement moins d'une minute au premier lancement.",
starting: 'Démarrage de Hermes…',
+ setupSlowTitle: 'La configuration prend plus de temps que d’habitude.',
+ setupSlowBody: 'Hermes est toujours en cours de démarrage en arrière-plan.',
+ continueWithoutSetup: 'Continuer sans configuration',
lookingUpProviders: 'Recherche des fournisseurs...',
collapse: 'Réduire',
otherProviders: 'Autres fournisseurs',
diff --git a/apps/desktop/src/i18n/ja_onboarding.ts b/apps/desktop/src/i18n/ja_onboarding.ts
index d5b601899b6..34a147883c7 100644
--- a/apps/desktop/src/i18n/ja_onboarding.ts
+++ b/apps/desktop/src/i18n/ja_onboarding.ts
@@ -5,6 +5,9 @@ export const jaOnboarding: TranslationOverrides['onboarding'] = {
headerDesc: 'チャットを始めるにはモデルプロバイダーを接続してください。ほとんどのオプションはワンクリックです。',
preparingInstall: 'Hermes はインストールを完了中です。初回実行では通常 1 分以内に完了します。',
starting: 'Hermes を起動中…',
+ setupSlowTitle: 'セットアップにいつもより時間がかかっています。',
+ setupSlowBody: 'Hermes はバックグラウンドで起動を続けています。',
+ continueWithoutSetup: 'セットアップせずに続行',
lookingUpProviders: 'プロバイダーを検索中...',
collapse: '折りたたむ',
otherProviders: 'その他のプロバイダー',
diff --git a/apps/desktop/src/i18n/ru_onboarding.ts b/apps/desktop/src/i18n/ru_onboarding.ts
index f770f8ec300..ecaab514d63 100644
--- a/apps/desktop/src/i18n/ru_onboarding.ts
+++ b/apps/desktop/src/i18n/ru_onboarding.ts
@@ -5,6 +5,9 @@ export const ruOnboarding: TranslationOverrides['onboarding'] = {
headerDesc: 'Подключите провайдера модели, чтобы начать общение. Большинство вариантов — в один клик.',
preparingInstall: 'Hermes завершает установку. Обычно это занимает меньше минуты при первом запуске.',
starting: 'Запускаем Hermes…',
+ setupSlowTitle: 'Настройка занимает больше времени, чем обычно.',
+ setupSlowBody: 'Hermes всё ещё запускается в фоновом режиме.',
+ continueWithoutSetup: 'Продолжить без настройки',
lookingUpProviders: 'Ищем провайдеров...',
collapse: 'Свернуть',
otherProviders: 'Другие провайдеры',
diff --git a/apps/desktop/src/i18n/types_onboarding.ts b/apps/desktop/src/i18n/types_onboarding.ts
index e10a2e3c4b8..752a736d6d8 100644
--- a/apps/desktop/src/i18n/types_onboarding.ts
+++ b/apps/desktop/src/i18n/types_onboarding.ts
@@ -3,6 +3,9 @@ export interface OnboardingTranslations {
headerDesc: string
preparingInstall: string
starting: string
+ setupSlowTitle: string
+ setupSlowBody: string
+ continueWithoutSetup: string
lookingUpProviders: string
collapse: string
otherProviders: string
diff --git a/apps/desktop/src/i18n/zh-hant_boot.ts b/apps/desktop/src/i18n/zh-hant_boot.ts
index 49ab2159aa7..5f6aa70b4cd 100644
--- a/apps/desktop/src/i18n/zh-hant_boot.ts
+++ b/apps/desktop/src/i18n/zh-hant_boot.ts
@@ -331,7 +331,10 @@ export const zhHantBoot = {
price: (input, output) => `${input} 輸入 / ${output} 輸出 每 Mtok`,
change: '變更',
startChatting: '開始',
- docs: provider => `${provider} 文件`
+ docs: provider => `${provider} 文件`,
+ setupSlowTitle: '設定花費的時間比平常久。',
+ setupSlowBody: 'Hermes 仍在背景中啟動。',
+ continueWithoutSetup: '略過設定並繼續'
}
} satisfies Pick<
TranslationOverrides,
diff --git a/apps/desktop/src/i18n/zh_onboarding.ts b/apps/desktop/src/i18n/zh_onboarding.ts
index e859ea5226f..b820a034184 100644
--- a/apps/desktop/src/i18n/zh_onboarding.ts
+++ b/apps/desktop/src/i18n/zh_onboarding.ts
@@ -5,6 +5,9 @@ export const zhOnboarding: TranslationOverrides['onboarding'] = {
headerDesc: '连接模型提供方即可开始对话。大多数选项只需一次点击。',
preparingInstall: 'Hermes 正在完成安装。首次运行通常不到一分钟。',
starting: '正在启动 Hermes…',
+ setupSlowTitle: '设置所需时间比平常更长。',
+ setupSlowBody: 'Hermes 仍在后台启动。',
+ continueWithoutSetup: '跳过设置并继续',
lookingUpProviders: '正在查找提供方...',
collapse: '收起',
otherProviders: '其他提供方',
diff --git a/apps/desktop/src/store/onboarding-intro.ts b/apps/desktop/src/store/onboarding-intro.ts
new file mode 100644
index 00000000000..70d331c3080
--- /dev/null
+++ b/apps/desktop/src/store/onboarding-intro.ts
@@ -0,0 +1,24 @@
+import { atom } from 'nanostores'
+
+import { setOnboardingSurfaceActive } from './onboarding-presence'
+
+/**
+ * The first-run intro as this window shows it, in memory only: whether it runs at all is the
+ * backend's `onboarding.state`. `starting` holds the boot overlay while the setup chat opens,
+ * `intro` is the setup chat in the demo layout, `ended` means the user left it (or finished),
+ * and `off` means it never ran or failed to start. Only the main window moves out of `off`.
+ */
+type IntroView = 'off' | 'starting' | 'intro' | 'ended'
+
+export const $introView = atom<IntroView>('off')
+
+/** Set once the setup chat's start has outlasted the boot budget: the starting screen keeps waiting and offers
+ * this way out, which ends the start through the kickoff's failed path. Null otherwise. */
+export const $introStartExit = atom<(() => void) | null>(null)
+
+/** The demo layout is on screen: the chat alone, narrower, minimal composer, no status bar. Kept here,
+ * free of layout imports, so the shell can read it; onboarding/first-run/assembly.ts owns the switch. */
+export const $chatOnboardingSolo = atom(false)
+
+// While the intro runs, the provider picker, the free-tier ready screen and the tips wait for it.
+$introView.subscribe(view => setOnboardingSurfaceActive('intro', view === 'starting' || view === 'intro'))
diff --git a/apps/desktop/src/store/onboarding-presence.ts b/apps/desktop/src/store/onboarding-presence.ts
index 55572ddf214..93a69055c68 100644
--- a/apps/desktop/src/store/onboarding-presence.ts
+++ b/apps/desktop/src/store/onboarding-presence.ts
@@ -2,7 +2,7 @@ import { atom, computed } from 'nanostores'
import { setModeContext } from '@/store/interface-mode'
-type OnboardingSurface = 'onboarding'
+type OnboardingSurface = 'intro' | 'onboarding'
const EMPTY: ReadonlySet<OnboardingSurface> = new Set()
diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.css
index 894d3edafa8..219de061127 100644
--- a/apps/desktop/src/styles.css
+++ b/apps/desktop/src/styles.css
@@ -1178,6 +1178,17 @@
padding-top: calc(var(--titlebar-height) + 1rem);
}
+/* The setup chat is a first conversation read at arm's length in a small
+ window, so its transcript, cards and composer run a size up. It sets the
+ base tokens: the thread and composer scopes derive the final ones from
+ these times the chat text scale. */
+[data-setup-chat] {
+ --conversation-text-base-size: 0.9375rem;
+ --conversation-tool-base-size: 0.75rem;
+ --conversation-caption-base-size: 0.8125rem;
+ --conversation-base-line-height: 1.375rem;
+}
+
@keyframes arc-border {
/* Transform travel (compositor-only), never background-position: the old
background-position version cost ~3,600 main-thread style recalcs per