Skip to content

An open-source, faster Devin alternative

TypeScript

Computer: setup is every new organization's onboarding

Slack U06H7D98X40245455de011d
diff --git a/web/src/components/app-shell-nav.ts b/web/src/components/app-shell-nav.ts
index 8316be30..99be9dc5 100644
--- a/web/src/components/app-shell-nav.ts
+++ b/web/src/components/app-shell-nav.ts
@@ -40,6 +40,8 @@ export function managedAgentsNav(options: {
durableSessionsEnabled: boolean
infrastructureEnabled: boolean
computerEnabled?: boolean
+ /** Whether the organization has any project, active or archived. */
+ hasProjects?: boolean
}): NavGroup[] {
const groups: NavGroup[] = []
@@ -122,15 +124,20 @@ export function managedAgentsNav(options: {
if (!options.projectId) {
// The organization's computer comes first (work 052): it is the first
- // screen of an organization without projects. The project list is the
- // home screen otherwise; it needs a place in the sidebar so it stays
- // reachable once an advanced area is open.
+ // screen of an organization without projects, and Projects stays out of
+ // the sidebar until there is one (the way in is a quiet link on the
+ // computer page). The project list is the home screen otherwise; it needs
+ // a place in the sidebar so it stays reachable once an advanced area is
+ // open.
+ const showProjects = !options.computerEnabled || options.hasProjects
groups.push({
items: [
...(options.computerEnabled
? [{ to: '/computer', label: 'Computer', icon: Computer }]
: []),
- { to: '/', label: 'Projects', icon: FolderKanban, end: true },
+ ...(showProjects
+ ? [{ to: '/', label: 'Projects', icon: FolderKanban, end: true }]
+ : []),
],
})
}
diff --git a/web/src/components/app-shell.test.ts b/web/src/components/app-shell.test.ts
index 4f9e8520..4820fd2d 100644
--- a/web/src/components/app-shell.test.ts
+++ b/web/src/components/app-shell.test.ts
@@ -9,7 +9,11 @@ describe('managed agents navigation', () => {
}
it('lists the project list on the homepage even without advanced areas', () => {
- const nav = managedAgentsNav({ ...defaults, computerEnabled: true })
+ const nav = managedAgentsNav({
+ ...defaults,
+ computerEnabled: true,
+ hasProjects: true,
+ })
expect(nav.map((group) => group.items.map((item) => item.label))).toEqual([
['Computer', 'Projects'],
['Connections'],
@@ -26,6 +30,15 @@ describe('managed agents navigation', () => {
})
})
+ it('keeps Projects out of the sidebar until the organization has one', () => {
+ // A new organization's flow is its computer; projects are a side door.
+ expect(
+ managedAgentsNav({ ...defaults, computerEnabled: true }).map((group) =>
+ group.items.map((item) => item.label),
+ ),
+ ).toEqual([['Computer'], ['Connections']])
+ })
+
it('hides the computer from organizations without it (rollout flag)', () => {
expect(
managedAgentsNav(defaults)[0]?.items.map((item) => item.label),
diff --git a/web/src/components/app-shell.tsx b/web/src/components/app-shell.tsx
index a53655c2..18ad5be0 100644
--- a/web/src/components/app-shell.tsx
+++ b/web/src/components/app-shell.tsx
@@ -62,7 +62,7 @@ import {
trackUpsellShown,
upgradeHref,
} from '@/lib/billing-onramp'
-import { getManagedProject } from '@/managed-agents/api'
+import { getManagedProject, getManagedProjects } from '@/managed-agents/api'
import {
projectEnvironmentMode,
projectEnvironmentSearch,
@@ -332,12 +332,28 @@ function SidebarNav({ onNavigate }: { onNavigate?: () => void }) {
const location = useLocation()
const navigate = useNavigate()
const projectId = projectIdFromPath(location.pathname)
+ const computerEnabled = user?.computerEnabled ?? false
+ // The same queries as the project list, so the sidebar and the list agree.
+ const listProjects = managedAgentsExperimentEnabled && computerEnabled
+ const projects = useQuery({
+ queryKey: ['managed-projects'],
+ queryFn: () => getManagedProjects(),
+ enabled: listProjects,
+ })
+ const archivedProjects = useQuery({
+ queryKey: ['managed-projects', 'archived'],
+ queryFn: () => getManagedProjects({ archived: true }),
+ enabled: listProjects,
+ })
const nav = managedAgentsExperimentEnabled
? managedAgentsNav({
projectId,
durableSessionsEnabled: user?.durableSessionsEnabled ?? false,
infrastructureEnabled: user?.infrastructureEnabled ?? false,
- computerEnabled: user?.computerEnabled ?? false,
+ computerEnabled,
+ hasProjects:
+ (projects.data?.length ?? 0) > 0 ||
+ (archivedProjects.data?.length ?? 0) > 0,
})
: LEGACY_NAV
const activeCollapsibleGroup = nav.find(
diff --git a/web/src/managed-agents/Computer.test.tsx b/web/src/managed-agents/Computer.test.tsx
index 2d59eb49..f536b7f3 100644
--- a/web/src/managed-agents/Computer.test.tsx
+++ b/web/src/managed-agents/Computer.test.tsx
@@ -179,25 +179,30 @@ describe('Computer page', () => {
render('/computer')
await settle(
- () => container.textContent?.includes('one click away') === true,
- 'not set up hero',
+ () => container.textContent?.includes('Set up your computer') === true,
+ 'setup',
)
- expect(container.textContent).toContain('Your computer is one click away.')
- expect(container.textContent).toContain(
- 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',
- )
- expect(container.textContent).toContain('Not set up yet')
+ expect(container.textContent).toContain('Step 1 of 3')
+ // Before Slack there is no computer to report on, and no pitch.
+ expect(container.textContent).not.toContain('Not set up yet')
expect(container.textContent).not.toContain('Setting up')
- // The hero's call to action and the checklist's step 1, both the install.
- const hero = container.querySelector('section')!
- const invite = [...hero.querySelectorAll('button')].find(
- (button) => button.textContent === 'Invite it to Slack',
+ expect(container.textContent).not.toContain('Lives in Slack')
+ // One call to action: the current step's.
+ const current = container.querySelector('li[aria-current="step"]')!
+ expect(current.textContent).toContain('Add OpenComputer to Slack')
+ const invite = [...current.querySelectorAll('button')].find(
+ (button) => button.textContent === 'Add to Slack',
)
expect(invite).toBeDefined()
- expect(container.textContent).toContain('Install Slack app')
- // GitHub can be connected anytime.
+ expect(container.querySelectorAll('button')).toHaveLength(1)
+ // The later steps are named, not offered yet.
expect(container.textContent).toContain('Connect GitHub')
+ expect(container.textContent).toContain('Say hello in Slack')
+ // Projects are a side door.
+ expect(container.querySelector('a[href="/new"]')?.textContent).toContain(
+ 'Set up a custom agent on OpenComputer infrastructure',
+ )
expect(container.textContent).not.toMatch(/vCPU|GiB/)
expect(container.textContent).not.toMatch(/azure|region|instance/i)
@@ -226,11 +231,11 @@ describe('Computer page', () => {
render('/computer')
await settle(
- () => container.textContent?.includes('coming to life') === true,
+ () => container.textContent?.includes('Setting up') === true,
'provisioning computer',
)
expect(computerApi.createComputer).toHaveBeenCalledTimes(1)
- expect(container.textContent).toContain('Setting up')
+ expect(container.textContent).toContain('Step 2 of 3')
})
it('does not create a computer the organization already has', async () => {
@@ -372,11 +377,9 @@ describe('Computer page', () => {
expect(container.textContent).toContain('Acme')
expect(container.textContent).toContain('acme')
- // Setup and selling are gone; specs never appear.
- expect(container.textContent).not.toContain('Three steps')
- expect(container.textContent).not.toContain('Install Slack app')
- expect(container.textContent).not.toContain('Lives in Slack')
- expect(container.textContent).not.toContain('never logs off')
+ // Setup is gone; specs never appear.
+ expect(container.textContent).not.toContain('Set up your computer')
+ expect(container.textContent).not.toContain('Add to Slack')
expect(container.textContent).not.toMatch(/vCPU|GiB/)
})
@@ -398,6 +401,7 @@ describe('Computer page', () => {
...onboarded,
computer: { ...onboarded.computer, state: 'parked', connected: false },
})
+ computerApi.getComputerSessions.mockResolvedValue([doneSession])
render('/computer')
await settle(
@@ -417,11 +421,35 @@ describe('Computer page', () => {
render('/computer')
await settle(
- () => container.textContent?.includes('Three steps') === true,
- 'setup checklist',
+ () => container.textContent?.includes('Step 2 of 3') === true,
+ 'setup',
)
- expect(container.textContent).toContain('never logs off')
- expect(container.textContent).toContain('Connect GitHub')
+ const current = container.querySelector('li[aria-current="step"]')!
+ expect(current.textContent).toContain('Connect GitHub')
+ // Slack is done: where it is, and the way out.
+ expect(container.textContent).toContain('In Acme')
+ expect(container.textContent).toContain('Unlink Slack')
+ expect(container.textContent).not.toContain('Live now')
+ })
+
+ it('finishes setup with the first mention in Slack', async () => {
+ computerApi.getComputer.mockResolvedValue(onboarded)
+ computerApi.getComputerSessions.mockResolvedValue([])
+
+ render('/computer')
+ await settle(
+ () => container.textContent?.includes('Step 3 of 3') === true,
+ 'last setup step',
+ )
+ const current = container.querySelector('li[aria-current="step"]')!
+ expect(current.textContent).toContain('Say hello in Slack')
+ expect(current.textContent).toContain('@OpenComputer why is the')
+ expect(current.textContent).toContain('Waiting for the first mention')
+ expect(
+ current.querySelector('a[href="https://app.slack.com/client/T1"]')
+ ?.textContent,
+ ).toContain('Open Slack')
+ expect(container.textContent).toContain('Repositories in acme')
expect(container.textContent).not.toContain('Live now')
})
})
diff --git a/web/src/managed-agents/Computer.tsx b/web/src/managed-agents/Computer.tsx
index 407fdee8..0a8ff25b 100644
--- a/web/src/managed-agents/Computer.tsx
+++ b/web/src/managed-agents/Computer.tsx
@@ -9,15 +9,14 @@ import {
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { Link, Navigate, useSearchParams } from 'react-router-dom'
import {
+ ArrowRight,
Check,
Computer as ComputerIcon,
ExternalLink,
- GitPullRequest,
Hash,
Lightbulb,
Loader2,
MessagesSquare,
- Moon,
RotateCcw,
Send,
Sparkles,
@@ -60,21 +59,21 @@ import {
} from './computer-api'
import {
EXAMPLE_ASKS,
+ SETUP_STEPS,
SLACK_RETURN_PARAMS,
alreadyLinkedCopy,
SESSION_STATUS,
START_SESSION_COPY,
compactStatusLine,
- computerChecklist,
computerIsOnboarded,
computerPollInterval,
computerPresentation,
- heroCopy,
relativeTime,
sessionPollInterval,
+ setupStep,
slackReturnFromSearch,
splitSessions,
- type ChecklistStep,
+ type SetupStep,
type SlackReturn,
} from './computer-state'
@@ -197,8 +196,20 @@ function ComputerPageContent() {
/>
) : null
- // Once it is in Slack and knows the code, the page is about the work.
- if (computerIsOnboarded(status.data)) {
+ // Whether the first mention is still to come decides between setup and the
+ // work, so wait for the sessions rather than flash one and then the other.
+ if (sessionsLoading && computerIsOnboarded(status.data)) {
+ return (
+ <div className="flex min-h-64 items-center justify-center">
+ <Loader2 className="text-muted-foreground size-5 animate-spin" />
+ </div>
+ )
+ }
+
+ // Once it is in Slack, knows the code and has had its first mention, the
+ // page is about the work.
+ const step = setupStep(status.data, sessions.data)
+ if (step === null) {
return (
<div className="mx-auto max-w-5xl space-y-8">
{slackProblemPanel}
@@ -233,30 +244,14 @@ function ComputerPageContent() {
}
return (
- <div className="mx-auto max-w-5xl space-y-6">
- {slackProblemPanel}
- <Hero
- status={status.data}
- createError={createError}
- creating={create.isPending}
- onRetry={() => create.mutate()}
- />
- <Reasons />
- <Checklist status={status.data} sessions={sessions.data} />
- <TryAsking />
- <SessionsPanel
- title="Sessions"
- description="Work your computer is doing for your team, newest first."
- emptyTitle="No sessions yet"
- emptyDescription={START_SESSION_COPY}
- hasComputer={hasComputer}
- sessions={[...live, ...recent]}
- readAt={sessions.dataUpdatedAt}
- loading={sessionsLoading}
- failed={sessions.isError}
- />
- <CliFooter />
- </div>
+ <Setup
+ status={status.data}
+ step={step}
+ notice={slackProblemPanel}
+ createError={createError}
+ creating={create.isPending}
+ onRetry={() => create.mutate()}
+ />
)
}
@@ -598,54 +593,6 @@ function IdeasToTry() {
)
}
-function Hero({
- status,
- createError,
- creating,
- onRetry,
-}: {
- status: ComputerStatus
- createError: Error | null
- creating: boolean
- onRetry: () => void
-}) {
- const { computer } = status
- const failedToCreate = !computer && createError !== null
- const copy = failedToCreate
- ? { headline: 'Something went wrong.', subline: createError.message }
- : heroCopy(computer, status.plan, status.slack.installed)
- const canRetry = failedToCreate || computer?.state === 'failed'
- const notSetUp = !computer && !status.slack.installed
- return (
- <section className="from-primary/10 via-panel to-panel relative overflow-hidden rounded-2xl border bg-linear-to-br px-8 py-12 sm:px-12 sm:py-16">
- <div
- className="bg-primary/15 pointer-events-none absolute -top-24 -right-24 size-72 rounded-full blur-3xl"
- aria-hidden
- />
- <div className="relative max-w-3xl">
- <StatusPill status={status} failedToCreate={failedToCreate} />
- <h1 className="mt-6 text-4xl font-semibold tracking-tight text-balance sm:text-5xl">
- {copy.headline}
- </h1>
- <p className="text-muted-foreground mt-4 max-w-2xl text-lg text-balance">
- {copy.subline}
- </p>
- {canRetry ? (
- <RetryButton className="mt-8" creating={creating} onRetry={onRetry} />
- ) : null}
- {notSetUp ? (
- <div className="mt-8 flex flex-wrap items-center gap-3">
- <SlackInstallButton size="lg" label="Invite it to Slack" />
- <span className="text-muted-foreground text-sm">
- One click. Connect GitHub anytime.
- </span>
- </div>
- ) : null}
- </div>
- </section>
- )
-}
-
/**
* Someone tried to link a Slack workspace that already works with
* OpenComputer in another organization. Not an error: their team is already
@@ -749,169 +696,249 @@ function SlackInstallFailed({
)
}
-const REASONS = [
- {
- icon: MessagesSquare,
- title: 'Lives in Slack',
- body: 'Mention it in any thread. It picks up the context, does the work and reports back, right there.',
- },
- {
- icon: GitPullRequest,
- title: 'Works in your real code',
- body: 'Your repositories, your stack. It reads, runs and fixes, then hands you a pull request to review.',
- },
- {
- icon: Moon,
- title: 'Never logs off',
- body: 'Hand it the slow stuff at 6pm. It is still on it at 3am, and it remembers where everything is.',
- },
-] as const
-
-function Reasons() {
- return (
- <div className="grid gap-4 sm:grid-cols-3">
- {REASONS.map(({ icon: Icon, title, body }) => (
- <div key={title} className="bg-panel rounded-xl border p-5">
- <Icon className="text-primary size-5" aria-hidden />
- <p className="mt-3 font-medium">{title}</p>
- <p className="text-muted-foreground mt-1 text-sm">{body}</p>
- </div>
- ))}
- </div>
- )
-}
-
-function TryAsking() {
- return (
- <Panel>
- <PanelHeader>
- <div>
- <PanelTitle>Not sure where to start?</PanelTitle>
- <PanelDescription className="mt-1">
- Paste one of these into Slack. Then give it the thing you have been
- putting off.
- </PanelDescription>
- </div>
- </PanelHeader>
- <PanelContent className="grid gap-2">
- {EXAMPLE_ASKS.map((ask) => (
- <CopyRow key={ask} value={`@OpenComputer ${ask}`} />
- ))}
- </PanelContent>
- </Panel>
- )
-}
-
-function Checklist({
+/**
+ * Setup is the onboarding of every new organization: three steps, one call to
+ * action at a time, and where the person is in them. No pitch; the page is not
+ * a landing page (Igor, 2026-10-13).
+ */
+function Setup({
status,
- sessions,
+ step,
+ notice,
+ createError,
+ creating,
+ onRetry,
}: {
status: ComputerStatus
- sessions: ComputerSession[] | undefined
+ step: SetupStep
+ notice: ReactNode
+ createError: Error | null
+ creating: boolean
+ onRetry: () => void
}) {
- // The computer itself is the hero; these are the three things a person does.
- const [, slackStep, githubStep, sessionStep] = computerChecklist(
- status,
- sessions,
- )
- const steps = [slackStep, githubStep, sessionStep]
- const done = steps.filter((step) => step.done).length
+ const { computer } = status
+ const failedToCreate = !computer && createError !== null
+ const failed = failedToCreate || computer?.state === 'failed'
+ const position = SETUP_STEPS.indexOf(step) + 1
+ const done: Record<SetupStep, boolean> = {
+ slack: status.slack.installed,
+ github: status.github.connected,
+ hello: false,
+ }
+ const progress = (id: SetupStep): SetupItemState =>
+ id === step ? 'current' : done[id] ? 'done' : 'upcoming'
return (
- <Panel>
- <PanelHeader>
- <div>
- <PanelTitle>
- {done === steps.length
- ? 'You are all set.'
- : 'Three steps to your first hand-off'}
- </PanelTitle>
- <PanelDescription className="mt-1">
- {done === steps.length
- ? 'It is part of the team now. Keep it busy.'
- : `${done} of ${steps.length} done. Takes about two minutes.`}
- </PanelDescription>
+ <div className="mx-auto max-w-2xl space-y-6 pt-2 sm:pt-8">
+ {notice}
+ <header>
+ <div className="flex items-center justify-between gap-4">
+ <p className="text-muted-foreground text-sm font-medium">
+ Step {position} of {SETUP_STEPS.length}
+ </p>
+ {/* Before Slack there is no computer to report on. */}
+ {computer || status.slack.installed ? (
+ <StatusPill status={status} failedToCreate={failedToCreate} />
+ ) : null}
</div>
- </PanelHeader>
- <PanelContent className="p-0">
- <ol className="divide-y">
- <Step
- number={1}
- step={{ ...slackStep, title: 'Invite it to Slack' }}
- action={<SlackAction status={status} />}
- >
- {status.slack.installed
- ? `It is in ${status.slack.teamName ?? 'your Slack workspace'}.`
- : 'This is what brings it to life. One click, ready in seconds.'}
- </Step>
- <Step
- number={2}
- step={{ ...githubStep, title: 'Give it your code' }}
- action={
- <GitHubAction
- connected={status.github.connected}
- // Slack comes first: it is what starts the computer. GitHub works anytime.
- secondary={!status.slack.installed}
- />
- }
- >
- {githubSummary(status.github)}
- </Step>
- <Step number={3} step={{ ...sessionStep, title: 'Say hello' }}>
- {START_SESSION_COPY}
- </Step>
- </ol>
- </PanelContent>
- </Panel>
- )
-}
+ <h1 className="mt-2 text-2xl font-semibold tracking-tight">
+ Set up your computer
+ </h1>
+ <div className="mt-5 flex gap-1.5" aria-hidden>
+ {SETUP_STEPS.map((id) => (
+ <span
+ key={id}
+ className={cn(
+ 'h-1 flex-1 rounded-full transition-colors',
+ done[id]
+ ? 'bg-primary'
+ : id === step
+ ? 'bg-primary/35'
+ : 'bg-muted',
+ )}
+ />
+ ))}
+ </div>
+ </header>
-function githubSummary(github: ComputerStatus['github']) {
- if (!github.connected) {
- return 'Pick the repositories it should know. It never pushes to main unless you ask.'
- }
- const accounts = github.installations.map(
- (installation) => installation.accountLogin,
+ {failed ? (
+ <div
+ role="alert"
+ className="border-destructive/40 bg-destructive/5 flex flex-wrap items-center gap-4 rounded-xl border px-5 py-4"
+ >
+ <TriangleAlert
+ className="text-destructive size-4 shrink-0"
+ aria-hidden
+ />
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-medium">
+ Your computer could not start.
+ </p>
+ <p className="text-muted-foreground mt-0.5 text-sm">
+ {failedToCreate
+ ? createError.message
+ : (computer?.lastError ??
+ 'Try again, or tell us if it keeps happening.')}
+ </p>
+ </div>
+ <RetryButton creating={creating} onRetry={onRetry} />
+ </div>
+ ) : null}
+
+ <ol className="bg-panel divide-y overflow-hidden rounded-xl border shadow-sm">
+ <SetupItem
+ number={1}
+ title="Add OpenComputer to Slack"
+ state={progress('slack')}
+ summary={`In ${status.slack.teamName ?? 'your Slack workspace'}`}
+ doneAction={<SlackAction status={status} compact />}
+ >
+ <p>
+ Your team mentions it in a thread; it does the work and replies
+ there.
+ </p>
+ <SlackInstallButton size="lg" label="Add to Slack" />
+ </SetupItem>
+ <SetupItem
+ number={2}
+ title="Connect GitHub"
+ state={progress('github')}
+ summary={githubSummary(status.github)}
+ doneAction={
+ <Button
+ variant="ghost"
+ size="sm"
+ className="text-muted-foreground"
+ asChild
+ >
+ <Link to="/managed-agents/connections">Manage</Link>
+ </Button>
+ }
+ >
+ <p>
+ Pick the repositories it can work in. It opens pull requests for you
+ to review and never pushes to main unless you ask.
+ </p>
+ <GitHubAction size="lg" />
+ </SetupItem>
+ <SetupItem
+ number={3}
+ title="Say hello in Slack"
+ state={progress('hello')}
+ >
+ <p>{START_SESSION_COPY} For example:</p>
+ <CopyRow value={`@OpenComputer ${EXAMPLE_ASKS[0]}`} />
+ <div className="flex flex-wrap items-center gap-x-5 gap-y-3">
+ {status.slack.teamId ? (
+ <Button size="lg" asChild>
+ <a
+ href={`https://app.slack.com/client/${encodeURIComponent(status.slack.teamId)}`}
+ target="_blank"
+ rel="noreferrer"
+ >
+ Open Slack
+ <ExternalLink className="size-4" aria-hidden />
+ </a>
+ </Button>
+ ) : null}
+ <span className="text-muted-foreground inline-flex items-center gap-2 text-sm">
+ <PulseDot tone="busy" />
+ Waiting for the first mention
+ </span>
+ </div>
+ </SetupItem>
+ </ol>
+
+ {/* Projects are for building agents of your own: a side door, kept out
+ of the way of the setup above. */}
+ <p className="text-muted-foreground pt-6 text-center text-xs">
+ <Link
+ to="/new"
+ className="hover:text-foreground inline-flex items-center gap-1 transition-colors"
+ >
+ Set up a custom agent on OpenComputer infrastructure
+ <ArrowRight className="size-3" aria-hidden />
+ </Link>
+ </p>
+ </div>
)
- return accounts.length
- ? `It knows the code in ${accounts.join(', ')}.`
- : 'GitHub is connected.'
}
-function Step({
+type SetupItemState = 'done' | 'current' | 'upcoming'
+
+function SetupItem({
number,
- step,
- action,
+ title,
+ state,
+ summary,
+ doneAction,
children,
}: {
number: number
- step: ChecklistStep
- action?: ReactNode
+ title: string
+ state: SetupItemState
+ summary?: string
+ doneAction?: ReactNode
children: ReactNode
}) {
+ const current = state === 'current'
return (
- <li className="flex flex-wrap items-center gap-4 px-5 py-4">
- <div
- className={cn(
- 'flex size-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold',
- step.done && 'bg-primary text-primary-foreground border-primary',
- )}
- aria-hidden
- >
- {step.done ? <Check className="size-4" /> : number}
- </div>
- <div className="min-w-0 flex-1">
- <p className="text-sm font-medium">
- {step.title}
- <span className="sr-only">{step.done ? ' (done)' : ' (to do)'}</span>
- </p>
- <p className="text-muted-foreground mt-0.5 text-sm">{children}</p>
+ <li
+ aria-current={current ? 'step' : undefined}
+ className={cn('px-5', current ? 'bg-primary/[0.03] py-5' : 'py-3.5')}
+ >
+ <div className="flex items-center gap-3">
+ <div
+ className={cn(
+ 'flex size-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold',
+ state === 'done' && 'bg-primary/15 text-primary',
+ current && 'bg-primary text-primary-foreground',
+ state === 'upcoming' && 'text-muted-foreground border',
+ )}
+ aria-hidden
+ >
+ {state === 'done' ? <Check className="size-3.5" /> : number}
+ </div>
+ <div className="min-w-0 flex-1">
+ <p
+ className={cn(
+ 'text-sm',
+ current ? 'font-semibold' : 'font-medium',
+ state === 'upcoming' && 'text-muted-foreground',
+ )}
+ >
+ {title}
+ <span className="sr-only">
+ {state === 'done'
+ ? ' (done)'
+ : current
+ ? ' (current step)'
+ : ' (to do)'}
+ </span>
+ </p>
+ {state === 'done' && summary ? (
+ <p className="text-muted-foreground truncate text-sm">{summary}</p>
+ ) : null}
+ </div>
+ {state === 'done' ? doneAction : null}
</div>
- {/* Reserve the action column so rows align with or without one. */}
- <div className="flex min-w-36 justify-end">{action}</div>
+ {current ? (
+ <div className="text-muted-foreground mt-3 space-y-4 pl-10 text-sm">
+ {children}
+ </div>
+ ) : null}
</li>
)
}
+function githubSummary(github: ComputerStatus['github']) {
+ const accounts = github.installations.map(
+ (installation) => installation.accountLogin,
+ )
+ return accounts.length
+ ? `Repositories in ${accounts.join(', ')}`
+ : 'GitHub is connected'
+}
+
function SlackAction({
status,
compact = false,
@@ -993,24 +1020,11 @@ function SlackInstallButton({
)
}
-function GitHubAction({
- connected,
- secondary = false,
-}: {
- connected: boolean
- secondary?: boolean
-}) {
+function GitHubAction({ size = 'default' }: { size?: 'default' | 'lg' }) {
const [starting, setStarting] = useState(false)
- if (connected) {
- return (
- <Button variant="outline" asChild>
- <Link to="/managed-agents/connections">Manage</Link>
- </Button>
- )
- }
return (
<Button
- variant={secondary ? 'outline' : 'default'}
+ size={size}
disabled={starting}
onClick={() => {
setStarting(true)
diff --git a/web/src/managed-agents/Home.test.tsx b/web/src/managed-agents/Home.test.tsx
index 5066ae62..686adc0b 100644
--- a/web/src/managed-agents/Home.test.tsx
+++ b/web/src/managed-agents/Home.test.tsx
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { renderToStaticMarkup } from 'react-dom/server'
import { MemoryRouter } from 'react-router-dom'
-import { afterEach, describe, expect, it, vi } from 'vitest'
+import { describe, expect, it } from 'vitest'
import ProjectsHome from './Home'
import { INSTALL_CLI_COMMAND } from './ProjectOnboarding'
@@ -43,20 +43,9 @@ function renderProjects(
)
}
-function stubSessionStorage(initial: Record<string, string> = {}) {
- const store = new Map(Object.entries(initial))
- vi.stubGlobal('sessionStorage', {
- getItem: (key: string) => store.get(key) ?? null,
- setItem: (key: string, value: string) => void store.set(key, value),
- })
-}
-
-afterEach(() => vi.unstubAllGlobals())
-
describe('projects home onboarding', () => {
- it('sends the first landing without projects to the computer, not CLI onboarding', () => {
+ it('sends an organization without projects to the computer, not CLI onboarding', () => {
// An organization's first screen is its computer (work 052).
- stubSessionStorage()
const markup = renderProjects([])
expect(markup).not.toContain(INSTALL_CLI_COMMAND)
@@ -64,17 +53,16 @@ describe('projects home onboarding', () => {
})
it('keeps CLI onboarding for an organization without the computer (rollout flag)', () => {
- stubSessionStorage()
const markup = renderProjects([], [], false)
expect(markup).toContain(INSTALL_CLI_COMMAND)
})
- it('shows CLI onboarding when Projects is opened after the first landing', () => {
- stubSessionStorage({ 'oc.computerLanding': '1' })
- const markup = renderProjects([])
-
- expect(markup).toContain(INSTALL_CLI_COMMAND)
+ it('sends every visit without projects to the computer, not just the first', () => {
+ // A once-per-session redirect showed project onboarding to new signups
+ // whenever / had rendered before.
+ expect(renderProjects([])).not.toContain(INSTALL_CLI_COMMAND)
+ expect(renderProjects([])).not.toContain(INSTALL_CLI_COMMAND)
})
it('sends New project to the same CLI onboarding route', () => {
diff --git a/web/src/managed-agents/Home.tsx b/web/src/managed-agents/Home.tsx
index f47bd858..c84e8484 100644
--- a/web/src/managed-agents/Home.tsx
+++ b/web/src/managed-agents/Home.tsx
@@ -23,20 +23,6 @@ import {
import ProjectOnboarding from './ProjectOnboarding'
import { AuthContext } from '@/hooks/useAuth'
-// Set once per browser session: the first landing goes to the computer, an
-// explicit visit to Projects afterwards shows project onboarding.
-const COMPUTER_LANDING_KEY = 'oc.computerLanding'
-
-function firstLandingThisSession(): boolean {
- try {
- if (sessionStorage.getItem(COMPUTER_LANDING_KEY)) return false
- sessionStorage.setItem(COMPUTER_LANDING_KEY, '1')
- return true
- } catch {
- return false
- }
-}
-
export default function ProjectsHome() {
// The computer is behind a rollout flag (work 052); no auth, no computer.
const computerEnabled =
@@ -101,11 +87,11 @@ export default function ProjectsHome() {
)
}
- // An organization's first screen is its computer (017, work 052): the
- // first landing of a session goes there. Clicking Projects afterwards shows
- // the CLI-first project onboarding, as before.
+ // An organization without projects starts at its computer (017, work 052),
+ // every time: the computer page is its onboarding. Project onboarding
+ // stays at /new, linked quietly from there.
if (items.length === 0 && archivedItems.length === 0) {
- return computerEnabled && firstLandingThisSession() ? (
+ return computerEnabled ? (
<Navigate to="/computer" replace />
) : (
<ProjectOnboarding />
diff --git a/web/src/managed-agents/computer-state.test.ts b/web/src/managed-agents/computer-state.test.ts
index e2820cbe..4787aa3d 100644
--- a/web/src/managed-agents/computer-state.test.ts
+++ b/web/src/managed-agents/computer-state.test.ts
@@ -13,11 +13,10 @@ import {
SESSION_POLL_MS,
SLOW_POLL_MS,
compactStatusLine,
- computerChecklist,
computerIsOnboarded,
computerPollInterval,
computerPresentation,
- heroCopy,
+ setupStep,
relativeTime,
sessionPollInterval,
alreadyLinkedCopy,
@@ -149,42 +148,6 @@ describe('computer state copy', () => {
).description,
).toBe('Setup timed out.')
})
-
- it('writes a headline for every state without naming hardware or vendors', () => {
- const states = [
- 'provisioning',
- 'ready',
- 'parked',
- 'waking',
- 'failed',
- 'deleting',
- ] as const
- for (const state of states) {
- for (const plan of ['free', 'paid'] as const) {
- const copy = heroCopy({ ...computer, state }, plan)
- expect(copy.headline.length).toBeGreaterThan(0)
- expect(`${copy.headline} ${copy.subline}`).not.toMatch(
- /vCPU|GiB|azure|region|instance/i,
- )
- }
- }
- // Before the Slack install: the install is what brings it to life.
- expect(heroCopy(null, 'free')).toEqual({
- headline: 'Your computer is one click away.',
- subline:
- 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',
- })
- // Installed, the computer not there yet: on its way.
- expect(heroCopy(null, 'free', true).headline).toBe(
- heroCopy({ ...computer, state: 'provisioning' }, 'free').headline,
- )
- })
-
- it('offers the upgrade only to a sleeping free computer', () => {
- const parked = { ...computer, state: 'parked' as const }
- expect(heroCopy(parked, 'free').subline).toContain('Upgrade')
- expect(heroCopy(parked, 'paid').subline).not.toContain('Upgrade')
- })
})
describe('computer polling', () => {
@@ -221,35 +184,24 @@ describe('computer polling', () => {
})
})
-describe('computer checklist', () => {
- it('ticks each step from the status and the sessions', () => {
- const done = (value: ComputerStatus, sessions?: unknown[]) =>
- computerChecklist(value, sessions as never).map((step) => step.done)
+describe('computer setup', () => {
+ const slack = { installed: true, teamName: 'Acme' }
+ const github = {
+ connected: true,
+ installations: [{ id: '1', accountLogin: 'acme' }],
+ }
+
+ it('walks Slack, then GitHub, then the first mention', () => {
+ expect(setupStep(status({ computer: null }), undefined)).toBe('slack')
+ // GitHub connected first still leaves Slack to do.
+ expect(setupStep(status({ github }), [])).toBe('slack')
+ expect(setupStep(status({ slack }), [])).toBe('github')
+ expect(setupStep(status({ slack, github }), [])).toBe('hello')
+ expect(setupStep(status({ slack, github }), [{} as never])).toBeNull()
+ })
- expect(done(status({ computer: null }))).toEqual([
- false,
- false,
- false,
- false,
- ])
- expect(
- done(
- status({
- slack: { installed: true, teamName: 'Acme' },
- github: {
- connected: true,
- installations: [{ id: '1', accountLogin: 'acme' }],
- },
- }),
- [{}],
- ),
- ).toEqual([true, true, true, true])
- expect(
- done(status({ computer: { ...computer, state: 'parked' } }))[0],
- ).toBe(true)
- expect(
- done(status({ computer: { ...computer, state: 'failed' } }))[0],
- ).toBe(false)
+ it('never holds the page on setup for sessions it could not read', () => {
+ expect(setupStep(status({ slack, github }), undefined)).toBeNull()
})
})
diff --git a/web/src/managed-agents/computer-state.ts b/web/src/managed-agents/computer-state.ts
index fb72c409..218ea00a 100644
--- a/web/src/managed-agents/computer-state.ts
+++ b/web/src/managed-agents/computer-state.ts
@@ -100,15 +100,6 @@ export function computerPresentation(
}
}
-/** Whether the computer has been set up (it may be asleep or waking). */
-export function computerIsSetUp(computer: Computer | null): boolean {
- return (
- computer?.state === 'ready' ||
- computer?.state === 'parked' ||
- computer?.state === 'waking'
- )
-}
-
export const FAST_POLL_MS = 5_000
export const SLOW_POLL_MS = 30_000
@@ -138,34 +129,23 @@ export function computerPollInterval(
}
}
-export type ChecklistStep = {
- id: 'computer' | 'slack' | 'github' | 'session'
- title: string
- done: boolean
-}
+export const SETUP_STEPS = ['slack', 'github', 'hello'] as const
+export type SetupStep = (typeof SETUP_STEPS)[number]
-export function computerChecklist(
+/**
+ * The setup step a person is on, or null once set up. Slack brings the
+ * computer to life, GitHub gives it the code, and the first mention in Slack
+ * finishes setup. Sessions not read yet (or unreadable) never hold the page
+ * on setup.
+ */
+export function setupStep(
status: ComputerStatus,
sessions: ComputerSession[] | undefined,
-): ChecklistStep[] {
- return [
- {
- id: 'computer',
- title: 'Computer ready',
- done: computerIsSetUp(status.computer),
- },
- {
- id: 'slack',
- title: 'Install the Slack app',
- done: status.slack.installed,
- },
- { id: 'github', title: 'Connect GitHub', done: status.github.connected },
- {
- id: 'session',
- title: 'Start a session',
- done: (sessions?.length ?? 0) > 0,
- },
- ]
+): SetupStep | null {
+ if (!status.slack.installed) return 'slack'
+ if (!status.github.connected) return 'github'
+ if (sessions?.length === 0) return 'hello'
+ return null
}
export const SESSION_STATUS: Record<
@@ -243,75 +223,6 @@ export function alreadyLinkedCopy(notified: boolean): {
}
}
-export type HeroCopy = { headline: string; subline: string }
-
-/**
- * The page's headline for each state: what the computer means to the team,
- * never what it is made of (Mohamed, 2026-10-11: no specs, make people want it).
- */
-export function heroCopy(
- computer: Computer | null,
- plan: ComputerStatus['plan'],
- slackInstalled = false,
-): HeroCopy {
- // Before the Slack install there is no computer: the install is the moment
- // it comes alive, so that is what the page asks for.
- if (!computer && !slackInstalled) {
- return {
- headline: 'Your computer is one click away.',
- subline:
- 'Invite OpenComputer to your Slack and it wakes up as part of your team — ready in seconds.',
- }
- }
- switch (computer?.state ?? 'provisioning') {
- case 'provisioning':
- return {
- headline: 'Your computer is coming to life.',
- subline:
- 'A minute or two, and your team has a colleague that never logs off. Invite it into Slack while you wait.',
- }
- case 'ready':
- return computer?.connected
- ? {
- headline: 'Your team just got a colleague that never logs off.',
- subline:
- 'It knows your code, lives in your Slack, and keeps going while you sleep. Ask it anything. Hand it anything.',
- }
- : {
- headline: 'Reconnecting.',
- subline:
- 'Your computer is on and finding its way back. Usually within a minute.',
- }
- case 'parked':
- return {
- headline: 'Resting, not gone.',
- subline:
- plan === 'paid'
- ? 'Everything it knows is right where it left it. Mention it and it is back in a minute.'
- : 'Everything it knows is right where it left it. Mention it and it is back in a minute. Upgrade and it never sleeps.',
- }
- case 'waking':
- return {
- headline: 'Waking up.',
- subline:
- 'Picking up exactly where it left off. Your message is already waiting for it.',
- }
- case 'failed':
- return {
- headline: 'Something went wrong.',
- subline:
- computer?.lastError ??
- 'Your computer could not start. Try again, or tell us if it keeps happening.',
- }
- case 'deleting':
- return {
- headline: 'Saying goodbye.',
- subline: 'Your computer is being removed.',
- }
- }
-}
-
-/** Things to ask first: concrete, so the first message is easy to write. */
export const EXAMPLE_ASKS = [
'why is the checkout test flaky? Fix it and open a PR.',
'walk me through how billing works in our codebase.',