Skip to content

An open-source, faster Devin alternative

TypeScript

web: drop the legacy dashboard and VITE_MANAGED_AGENTS_EXPERIMENT (097 step 7)

Mohamed Habib via Computer6a5ab433e1e6
diff --git a/web/src/App.tsx b/web/src/App.tsx
index 037aa169..748861a1 100644
--- a/web/src/App.tsx
+++ b/web/src/App.tsx
@@ -4,11 +4,9 @@ import { AuthProvider } from './hooks/auth-provider'
import ProtectedRoute from './components/ProtectedRoute'
import AppShell from './components/app-shell'
import PublicTemplateRoute from './components/PublicTemplateRoute'
-import { managedAgentsExperimentEnabled } from './managed-agents/feature'
import { templateDeployPathFromSearch } from './managed-agents/templates'
// Route pages are code-split so the initial bundle stays small.
-const Dashboard = lazy(() => import('./pages/Dashboard'))
const APIKeys = lazy(() => import('./pages/APIKeys'))
const Settings = lazy(() => import('./pages/Settings'))
const Billing = lazy(() => import('./pages/Billing'))
@@ -54,7 +52,7 @@ function HomeRoute() {
const [searchParams] = useSearchParams()
if (searchParams.get('security') === '1')
return <Navigate to="/security" replace />
- return managedAgentsExperimentEnabled ? <ManagedAgentsHome /> : <Dashboard />
+ return <ManagedAgentsHome />
}
export default function App() {
@@ -73,24 +71,13 @@ export default function App() {
<Route element={<AppShell />}>
<Route index element={<HomeRoute />} />
<Route path="security" element={<ManagedSecurityOnboarding />} />
- <Route
- path="getting-started"
- element={
- managedAgentsExperimentEnabled ? (
- <ManagedAgentsHome />
- ) : (
- <Dashboard />
- )
- }
- />
+ <Route path="getting-started" element={<ManagedAgentsHome />} />
<Route path="computer" element={<ManagedComputer />} />
<Route
path="computer/secrets"
element={<ManagedComputerSecrets />}
/>
- {managedAgentsExperimentEnabled ? (
- <Route path="automations" element={<ManagedAgentsHome list />} />
- ) : null}
+ <Route path="automations" element={<ManagedAgentsHome list />} />
<Route
path="model-access/callback"
element={<ModelAccessCallback />}
diff --git a/web/src/components/app-shell.tsx b/web/src/components/app-shell.tsx
index e4ac4321..ea971ca9 100644
--- a/web/src/components/app-shell.tsx
+++ b/web/src/components/app-shell.tsx
@@ -8,7 +8,6 @@ import {
} from 'react-router-dom'
import { useQuery } from '@tanstack/react-query'
import {
- Rocket,
KeyRound,
CreditCard,
Settings,
@@ -18,7 +17,6 @@ import {
Menu,
Loader2,
ChevronRight,
- type LucideIcon,
} from 'lucide-react'
import { useAuth } from '@/hooks/useAuth'
import { logout } from '@/api/client'
@@ -40,7 +38,6 @@ import {
import { ErrorBoundary } from '@/components/error-boundary'
import { ThemeToggle } from '@/components/theme-toggle'
import { cn } from '@/lib/utils'
-import { managedAgentsExperimentEnabled } from '@/managed-agents/feature'
import {
BillingPill,
BillingWarningBanner,
@@ -58,32 +55,7 @@ import {
type ProjectEnvironment,
type ProjectEnvironmentMode,
} from '@/managed-agents/project-context'
-import { managedAgentsNav, type NavGroup } from './app-shell-nav'
-
-type NavItem = {
- to: string
- label: string
- icon: LucideIcon
- end?: boolean
- preview?: boolean
-}
-type LegacyNavGroup = Omit<NavGroup, 'items'> & { items: NavItem[] }
-
-// The legacy (VITE_MANAGED_AGENTS_EXPERIMENT=0) navigation: browsers plus account/org. Groups render with spacing + a small muted
-// label rather than hard dividers.
-const LEGACY_NAV: LegacyNavGroup[] = [
- {
- items: [{ to: '/', label: 'Getting started', icon: Rocket, end: true }],
- },
- {
- label: 'Account',
- items: [
- { to: '/api-keys', label: 'API Keys', icon: KeyRound },
- { to: '/billing', label: 'Billing', icon: CreditCard },
- { to: '/settings', label: 'Settings', icon: Settings },
- ],
- },
-]
+import { managedAgentsNav } from './app-shell-nav'
function Brand() {
return (
@@ -288,19 +260,17 @@ function SidebarNav({ onNavigate }: { onNavigate?: () => void }) {
projectId: projectId!,
environment: 'default',
}),
- enabled: Boolean(managedAgentsExperimentEnabled && projectId),
+ enabled: Boolean(projectId),
staleTime: 60_000,
})
const swarmEnabled = (swarmResources.data?.resources ?? []).some(
(resource) => resource.id === SECURITY_FINDINGS_RESOURCE,
)
- const nav = managedAgentsExperimentEnabled
- ? managedAgentsNav({
- projectId,
- computerEnabled,
- swarmEnabled,
- })
- : LEGACY_NAV
+ const nav = managedAgentsNav({
+ projectId,
+ computerEnabled,
+ swarmEnabled,
+ })
const activeCollapsibleGroup = nav.find(
(group) =>
group.collapsible &&
@@ -393,28 +363,7 @@ function SidebarNav({ onNavigate }: { onNavigate?: () => void }) {
</nav>
<div className="border-t p-3">
- {managedAgentsExperimentEnabled ? (
- <ManagedProfileMenu onNavigate={onNavigate} />
- ) : (
- <div className="flex items-center gap-2.5">
- <span className="bg-secondary text-muted-foreground flex size-7 shrink-0 items-center justify-center rounded-full text-xs font-medium">
- {user?.email?.charAt(0).toUpperCase() || '?'}
- </span>
- <span className="text-foreground min-w-0 flex-1 truncate text-xs">
- {user?.email}
- </span>
- {user?.capabilities?.signOut !== false ? (
- <button
- onClick={() => void logout()}
- aria-label="Sign out"
- title="Sign out"
- className="text-muted-foreground/40 hover:text-foreground flex size-7 shrink-0 items-center justify-center transition-colors"
- >
- <LogOut className="size-4" strokeWidth={1.5} aria-hidden />
- </button>
- ) : null}
- </div>
- )}
+ <ManagedProfileMenu onNavigate={onNavigate} />
</div>
</div>
)
@@ -425,9 +374,7 @@ export default function AppShell() {
const [drawerOpen, setDrawerOpen] = useState(false)
const location = useLocation()
const navigate = useNavigate()
- const projectId = managedAgentsExperimentEnabled
- ? projectIdFromPath(location.pathname)
- : undefined
+ const projectId = projectIdFromPath(location.pathname)
const project = useQuery({
queryKey: ['managed-project', projectId],
queryFn: () => getManagedProject(projectId!),
diff --git a/web/src/managed-agents/feature.ts b/web/src/managed-agents/feature.ts
deleted file mode 100644
index fccb0432..00000000
--- a/web/src/managed-agents/feature.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-// The experiment is on by default for this launch. Set the build-time value to
-// "0" to restore the existing dashboard and navigation without removing any
-// legacy routes.
-export const managedAgentsExperimentEnabled =
- import.meta.env.VITE_MANAGED_AGENTS_EXPERIMENT !== '0'
diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx
deleted file mode 100644
index 3d56a4d0..00000000
--- a/web/src/pages/Dashboard.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import { useEffect, useRef } from 'react'
-import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
-import { Link } from 'react-router-dom'
-import { KeyRound } from 'lucide-react'
-import { createAPIKey, getAPIKeys } from '@/api/client'
-import { Panel } from '@/components/panel'
-import { CopyRow } from '@/components/copy-row'
-import { Button } from '@/components/ui/button'
-
-// The legacy home (VITE_MANAGED_AGENTS_EXPERIMENT=0). The sandbox overview and
-// quickstart it used to show are gone with the sandbox product (work 097); what
-// remains is the organization's API key.
-export default function Dashboard() {
- return <GettingStarted />
-}
-
-/* ── API key ─────────────────────────────────────────────────── */
-export function GettingStarted() {
- const queryClient = useQueryClient()
- const keysQuery = useQuery({
- queryKey: ['api-keys'],
- queryFn: getAPIKeys,
- })
- const autoCreateRef = useRef(false)
-
- const createMutation = useMutation({
- mutationFn: () => createAPIKey('Default'),
- onSuccess: () => queryClient.invalidateQueries({ queryKey: ['api-keys'] }),
- })
-
- const keys = keysQuery.data
- const hasKeys = (keys?.length ?? 0) > 0
- const createdKey = createMutation.data?.key ?? null
-
- // New organizations get one usable key without an extra setup step. Existing
- // secrets remain intentionally unrecoverable; those users get the key manager.
- useEffect(() => {
- if (!keysQuery.isSuccess || autoCreateRef.current) return
- if (!hasKeys && !createdKey && !createMutation.isPending) {
- autoCreateRef.current = true
- createMutation.mutate()
- }
- }, [keysQuery.isSuccess, hasKeys, createdKey, createMutation])
-
- return (
- <div className="mx-auto max-w-5xl pb-12">
- <Panel className="p-5">
- <div className="grid gap-4 sm:grid-cols-[11rem_minmax(0,1fr)] sm:items-start">
- <div className="flex items-center gap-2">
- <KeyRound className="text-muted-foreground size-4" aria-hidden />
- <div>
- <h2 className="text-sm font-semibold">Your API key</h2>
- <p className="text-muted-foreground mt-0.5 text-xs">
- OPENCOMPUTER_API_KEY
- </p>
- </div>
- </div>
-
- <div className="min-w-0">
- {keysQuery.isLoading || createMutation.isPending ? (
- <p className="text-muted-foreground py-2 text-sm">
- Preparing your API key…
- </p>
- ) : null}
-
- {createdKey ? (
- <div className="space-y-2">
- <CopyRow value={createdKey} maskable />
- <p className="text-muted-foreground text-xs">
- Copy it now. For security, it cannot be shown again.
- </p>
- </div>
- ) : null}
-
- {!createdKey && !createMutation.isPending && hasKeys ? (
- <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
- <p className="text-muted-foreground text-sm">
- API key ready. Existing secret values cannot be displayed.
- </p>
- <Button size="sm" variant="outline" asChild>
- <Link to="/api-keys">Manage keys</Link>
- </Button>
- </div>
- ) : null}
-
- {keysQuery.isError ? (
- <div className="flex flex-wrap items-center gap-3">
- <span className="text-status-error text-sm">
- Couldn&apos;t load your API keys.
- </span>
- <Button
- size="sm"
- variant="outline"
- onClick={() => void keysQuery.refetch()}
- >
- Retry
- </Button>
- </div>
- ) : null}
-
- {createMutation.isError ? (
- <div className="flex flex-wrap items-center gap-3">
- <span className="text-status-error text-sm">
- Couldn&apos;t create your API key.
- </span>
- <Button
- size="sm"
- variant="outline"
- onClick={() => createMutation.mutate()}
- >
- Retry
- </Button>
- </div>
- ) : null}
- </div>
- </div>
- </Panel>
- </div>
- )
-}
diff --git a/web/src/pages/getting-started.test.tsx b/web/src/pages/getting-started.test.tsx
deleted file mode 100644
index e9666d06..00000000
--- a/web/src/pages/getting-started.test.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
-import { renderToStaticMarkup } from 'react-dom/server'
-import { MemoryRouter } from 'react-router-dom'
-import { describe, expect, it } from 'vitest'
-import type { APIKey } from '@/api/client'
-import { GettingStarted } from './Dashboard'
-
-function renderGettingStarted(path = '/') {
- const keys: APIKey[] = [
- {
- id: 'key_0123456789abcdef01234567',
- orgId: 'org_0123456789abcdef01234567',
- keyPrefix: 'osb_example',
- name: 'Default',
- scopes: [],
- createdAt: '2026-07-17T00:00:00.000Z',
- },
- ]
- const queryClient = new QueryClient({
- defaultOptions: { queries: { retry: false, staleTime: Infinity } },
- })
- queryClient.setQueryData(['api-keys'], keys)
-
- return renderToStaticMarkup(
- <QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={[path]}>
- <GettingStarted />
- </MemoryRouter>
- </QueryClientProvider>,
- )
-}
-
-describe('getting started', () => {
- it('shows the API key without the retired sandbox quickstart', () => {
- const markup = renderGettingStarted()
-
- expect(markup).toContain('API key ready')
- expect(markup).not.toContain('Sandbox.create()')
- expect(markup).not.toContain('sandbox quickstart')
- })
-})
diff --git a/web/src/vite-env.d.ts b/web/src/vite-env.d.ts
index bd52eebe..8e1e2258 100644
--- a/web/src/vite-env.d.ts
+++ b/web/src/vite-env.d.ts
@@ -6,7 +6,6 @@ interface ImportMetaEnv {
/** Opt-in dev-only flag: serve mock data with no backend/auth (see api/mock.ts). */
readonly VITE_PREVIEW?: string
/** "0" restores the legacy dashboard and navigation for experiment rollback. */
- readonly VITE_MANAGED_AGENTS_EXPERIMENT?: string
}
interface ImportMeta {