From c60d5dde32d493c53ceb45bf9ee9c8c8358856ed Mon Sep 17 00:00:00 2001 From: Mike Lyons Date: Thu, 26 Nov 2026 13:40:24 -0500 Subject: [PATCH 1/2] Center empty state agrees with the first-run tour and offers a next step While the tour is on its home step the center pane now says the project is ready and offers the same Start something new action as the popout (shared handler). Otherwise it suggests picking a project or starting a new task, with the New worktree hotkey, and the zero-repo case offers Open Repository. Co-Authored-By: Claude Opus 5.5 --- src/renderer/App.tsx | 30 ++++++-- src/renderer/components/CenterEmptyState.tsx | 76 ++++++++++++++++++++ 2 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 src/renderer/components/CenterEmptyState.tsx diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index d3ab4ac1..1dceca83 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -27,6 +27,7 @@ import { NewWorktreeScreen, onOpenForkIntoWorktree } from './components/NewWorkt import { CreatingWorktreeScreen } from './components/CreatingWorktreeScreen' import { DeletingWorktreeScreen } from './components/DeletingWorktreeScreen' import { FirstRunTour } from './components/FirstRunTour' +import { CenterEmptyState } from './components/CenterEmptyState' import { WorkspaceView } from './components/WorkspaceView' import { QuakeTerminal } from './components/QuakeTerminal' import { RightColumn } from './components/RightColumn' @@ -311,7 +312,7 @@ function DesktopApp(): JSX.Element { // Pane trees across ALL backends. `usePanes()` would be the active // backend's slice only, which silently breaks every cross-backend lookup // below: `activeWorkspaceVisible` would find no tree for a remote - // worktree and render the "Select a worktree to begin" fallback at the + // worktree and render the empty-center fallback at the // same time as the workspace it claims isn't there. const panes = mergedData.panes const [activePaneId, setActivePaneId] = useState>({}) @@ -594,6 +595,12 @@ function DesktopApp(): JSX.Element { : null, [tour, worktrees] ) + // Shared by the tour popout and the center empty state so both drive the + // same kickoff and tour transition. + const handleTourStart = useCallback(async () => { + const result = await backend.tourStartSomethingNew().catch(() => ({ ok: false as const })) + if (result.ok) setActiveWorktreeId(result.worktreePath) + }, [backend]) const configLoadError = useConfigLoadError() @@ -2228,8 +2235,20 @@ function DesktopApp(): JSX.Element { > {singleScreenMode && } -
- {worktrees.length === 0 ? 'Create a worktree to get started' : 'Select a worktree to begin'} +
+ setShowNewWorktree(true)} + onAddRepo={handleAddRepo} + />
)} @@ -2255,10 +2274,7 @@ function DesktopApp(): JSX.Element { { - const result = await backend.tourStartSomethingNew().catch(() => ({ ok: false as const })) - if (result.ok) setActiveWorktreeId(result.worktreePath) - }} + onStart={handleTourStart} onDismiss={() => void backend.tourDismiss().catch(() => {})} /> )} diff --git a/src/renderer/components/CenterEmptyState.tsx b/src/renderer/components/CenterEmptyState.tsx new file mode 100644 index 00000000..3c1c63c5 --- /dev/null +++ b/src/renderer/components/CenterEmptyState.tsx @@ -0,0 +1,76 @@ +import { useState, type JSX } from 'react' +import { FolderOpen, Loader2, Plus, Sparkles } from 'lucide-react' +import { bindingToString, formatBindingGlyphs, type HotkeyBinding } from '../hotkeys' + +const primaryButton = + 'inline-flex items-center justify-center gap-2 brand-gradient-bg text-white font-semibold text-sm px-4 py-2 rounded-lg hover:brightness-110 transition-all cursor-pointer disabled:opacity-70 disabled:cursor-default' +const secondaryButton = + 'inline-flex items-center justify-center gap-2 text-sm font-medium text-fg-bright px-4 py-2 rounded-lg border border-border-strong hover:bg-surface-hover transition-colors cursor-pointer' +const kbdChip = 'text-xs text-faint bg-bg px-1.5 py-0.5 rounded border border-border font-mono' + +/** What the center pane shows when no workspace is open. While the + * first-run tour is on its `home` step the copy agrees with the popout and + * offers the same action, so the two never contradict each other. */ +export function CenterEmptyState({ + mode, + newWorktreeBinding, + onTourStart, + onNewWorktree, + onAddRepo +}: { + mode: 'tour-home' | 'no-selection' | 'no-repos' + newWorktreeBinding: HotkeyBinding | undefined + onTourStart: () => Promise + onNewWorktree: () => void + onAddRepo: () => void +}): JSX.Element { + const [starting, setStarting] = useState(false) + + if (mode === 'tour-home') { + return ( +
+ +
Your project is ready
+
+ Start something new and an agent will set up a workspace for it. +
+ +
+ ) + } + + if (mode === 'no-repos') { + return ( +
+
Add a project to get started
+ +
+ ) + } + + return ( +
+
Pick a project on the left, or start a new task
+ +
+ ) +} From 6d86ae72f48b83caa7d29edff33613523a9d2637 Mon Sep 17 00:00:00 2001 From: Mike Lyons Date: Thu, 26 Nov 2026 14:04:14 -0500 Subject: [PATCH 2/2] Address review: drop unreachable no-repos mode, share TourStartButton The zero-worktree branch only fired when repos existed but had no rows yet (boot, remote connecting, missing dirs), where telling the user to add a project points the wrong way; with no repos the welcome wizard owns the screen. Mode selection is now a pure tested helper, and the tour's Start something new button is shared with the center empty state so styling and busy state can't drift. Co-Authored-By: Claude Opus 5.5 --- src/renderer/App.tsx | 11 +--- .../components/CenterEmptyState.test.ts | 16 ++++++ src/renderer/components/CenterEmptyState.tsx | 54 ++++++++----------- src/renderer/components/FirstRunTour.tsx | 44 +++++++++------ 4 files changed, 67 insertions(+), 58 deletions(-) create mode 100644 src/renderer/components/CenterEmptyState.test.ts diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 1dceca83..99ad025d 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -27,7 +27,7 @@ import { NewWorktreeScreen, onOpenForkIntoWorktree } from './components/NewWorkt import { CreatingWorktreeScreen } from './components/CreatingWorktreeScreen' import { DeletingWorktreeScreen } from './components/DeletingWorktreeScreen' import { FirstRunTour } from './components/FirstRunTour' -import { CenterEmptyState } from './components/CenterEmptyState' +import { CenterEmptyState, centerEmptyMode } from './components/CenterEmptyState' import { WorkspaceView } from './components/WorkspaceView' import { QuakeTerminal } from './components/QuakeTerminal' import { RightColumn } from './components/RightColumn' @@ -2237,17 +2237,10 @@ function DesktopApp(): JSX.Element {
setShowNewWorktree(true)} - onAddRepo={handleAddRepo} />
diff --git a/src/renderer/components/CenterEmptyState.test.ts b/src/renderer/components/CenterEmptyState.test.ts new file mode 100644 index 00000000..a30e3b3d --- /dev/null +++ b/src/renderer/components/CenterEmptyState.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, it } from 'vitest' +import { centerEmptyMode } from './CenterEmptyState' + +describe('centerEmptyMode', () => { + it('agrees with the tour popout while the tour is on its home row', () => { + expect(centerEmptyMode({ onboardingVisible: false, tourHomePath: '/repo' })).toBe('tour-home') + }) + + it('falls back to the generic prompt once the tour has moved on', () => { + expect(centerEmptyMode({ onboardingVisible: false, tourHomePath: null })).toBe('no-selection') + }) + + it('does not show the tour copy behind the welcome wizard', () => { + expect(centerEmptyMode({ onboardingVisible: true, tourHomePath: '/repo' })).toBe('no-selection') + }) +}) diff --git a/src/renderer/components/CenterEmptyState.tsx b/src/renderer/components/CenterEmptyState.tsx index 3c1c63c5..7ced4699 100644 --- a/src/renderer/components/CenterEmptyState.tsx +++ b/src/renderer/components/CenterEmptyState.tsx @@ -1,13 +1,27 @@ -import { useState, type JSX } from 'react' -import { FolderOpen, Loader2, Plus, Sparkles } from 'lucide-react' +import type { JSX } from 'react' +import { Plus, Sparkles } from 'lucide-react' import { bindingToString, formatBindingGlyphs, type HotkeyBinding } from '../hotkeys' +import { TourStartButton } from './FirstRunTour' -const primaryButton = - 'inline-flex items-center justify-center gap-2 brand-gradient-bg text-white font-semibold text-sm px-4 py-2 rounded-lg hover:brightness-110 transition-all cursor-pointer disabled:opacity-70 disabled:cursor-default' const secondaryButton = 'inline-flex items-center justify-center gap-2 text-sm font-medium text-fg-bright px-4 py-2 rounded-lg border border-border-strong hover:bg-surface-hover transition-colors cursor-pointer' const kbdChip = 'text-xs text-faint bg-bg px-1.5 py-0.5 rounded border border-border font-mono' +export type CenterEmptyMode = 'tour-home' | 'no-selection' + +/** No zero-repo mode: with no repos the welcome wizard owns the screen, and + * repos whose worktree rows haven't landed yet (boot, a remote still + * connecting, a missing repo dir) still have a project to pick. */ +export function centerEmptyMode({ + onboardingVisible, + tourHomePath +}: { + onboardingVisible: boolean + tourHomePath: string | null +}): CenterEmptyMode { + return !onboardingVisible && tourHomePath ? 'tour-home' : 'no-selection' +} + /** What the center pane shows when no workspace is open. While the * first-run tour is on its `home` step the copy agrees with the popout and * offers the same action, so the two never contradict each other. */ @@ -15,17 +29,13 @@ export function CenterEmptyState({ mode, newWorktreeBinding, onTourStart, - onNewWorktree, - onAddRepo + onNewWorktree }: { - mode: 'tour-home' | 'no-selection' | 'no-repos' + mode: CenterEmptyMode newWorktreeBinding: HotkeyBinding | undefined onTourStart: () => Promise onNewWorktree: () => void - onAddRepo: () => void }): JSX.Element { - const [starting, setStarting] = useState(false) - if (mode === 'tour-home') { return (
@@ -34,29 +44,7 @@ export function CenterEmptyState({
Start something new and an agent will set up a workspace for it.
- -
- ) - } - - if (mode === 'no-repos') { - return ( -
-
Add a project to get started
- +
) } diff --git a/src/renderer/components/FirstRunTour.tsx b/src/renderer/components/FirstRunTour.tsx index 41e63e92..73cb90d9 100644 --- a/src/renderer/components/FirstRunTour.tsx +++ b/src/renderer/components/FirstRunTour.tsx @@ -140,7 +140,32 @@ function Popout({ } const primaryButton = - 'w-full inline-flex items-center justify-center gap-2 brand-gradient-bg text-white font-semibold text-sm px-4 py-2 rounded-lg hover:brightness-110 transition-all cursor-pointer disabled:opacity-70 disabled:cursor-default' + 'inline-flex items-center justify-center gap-2 brand-gradient-bg text-white font-semibold text-sm px-4 py-2 rounded-lg hover:brightness-110 transition-all cursor-pointer disabled:opacity-70 disabled:cursor-default' + +/** The tour's "Start something new" action. Shared with the center empty + * state so the two surfaces can't drift in look or busy behaviour. */ +export function TourStartButton({ + onStart, + className = '' +}: { + onStart: () => Promise + className?: string +}): JSX.Element { + const [starting, setStarting] = useState(false) + return ( + + ) +} /** The two first-run popouts. `homePath` is the tour project's main * workspace row, resolved by the caller from the worktree list. */ @@ -158,7 +183,6 @@ export function FirstRunTour({ const anchorPath = tour.step === 'home' ? homePath : tour.step === 'new-worktree' ? (tour.worktreePath ?? null) : null const anchor = useSidebarAnchor(anchorPath) - const [starting, setStarting] = useState(false) if (!anchor) return null if (tour.step === 'home') { @@ -169,19 +193,7 @@ export function FirstRunTour({ icon={} eyebrow="Main workspace" onDismiss={onDismiss} - action={ - - } + action={} > This is your main workspace for this project. Agents here can spin up worktrees for any work that you might want to do. @@ -197,7 +209,7 @@ export function FirstRunTour({ eyebrow="New worktree" onDismiss={onDismiss} action={ - }