/* Copyright 2026 Marimo. All rights reserved. */ import { useAtom, useAtomValue } from "jotai"; import { RefreshCwIcon } from "lucide-react"; import { connectionNoticeAtom } from "@/core/network/connection-notice"; import { Button } from "@/components/ui/button"; import { useRestartKernel } from "@/components/editor/actions/useRestartKernel"; import { isConnectedAtom, startupProgressAtom, } from "@/core/network/connection"; import type { DisplayConnectionNotice } from "@/core/network/useConnectionNotice"; import { preparationAtom, sandboxActionsAtom, sandboxAtom, sandboxSyncAtom, sandboxSyncOperationAtom, } from "@/core/packages/sandbox-state"; import { cn } from "@/utils/cn"; import { usePanelSection } from "./panel-context"; import { sandboxDetailsExpandedAtom } from "./sandbox-details-state"; import { StartupOutput } from "../../alerts/startup-output"; import { ConnectionStatusIcon, StartupProgress, } from "../../alerts/startup-progress"; export function SandboxErrorOutput({ error }: { error: string }) { return (
{error}
);
}
function SandboxRecovery({ notice }: { notice: DisplayConnectionNotice }) {
const sandbox = useAtomValue(sandboxAtom);
const actions = useAtomValue(sandboxActionsAtom);
const sync = useAtomValue(sandboxSyncAtom);
if (notice.pending || notice.ready) {
return null;
}
return (
<>
{notice.description}
{notice.error &&A manifest will be available once this new notebook starts.
)} > ); } function SandboxRestart() { const restartKernel = useRestartKernel(); return ( ); } function SandboxStartupPanel({ notice }: { notice: DisplayConnectionNotice }) { const showSteps = notice.kind === "startup" && (notice.ready || notice.phase === "preparing-environment" || notice.phase === "starting-kernel"); return (Environment synced
)}