Show sandbox list in destroy mode

This commit is contained in:
Codex
2026-04-24 17:31:07 +00:00
parent 739f00fd3e
commit 37695a8a33
2 changed files with 54 additions and 17 deletions
+33 -1
View File
@@ -214,12 +214,13 @@ export default function Dashboard() {
<ConfigurationPanel sandboxId="new-sandbox" mode="create" onCreateSuccess={handleCreateSuccess} />
</div>
) : isDestroyMode ? (
<div className="space-y-6">
<div className="panel p-8 border-2 border-[var(--status-stopped)]">
<h1 className="text-lg font-semibold text-[var(--status-stopped)] uppercase tracking-wider mb-4">
DESTROY SANDBOX
</h1>
<p className="text-sm text-[var(--foreground-dim)] mb-4">
Click on any sandbox below to initiate destruction. All sandboxes are highlighted in red.
Click a sandbox below to destroy it.
</p>
<div className="flex items-center gap-2">
<button
@@ -233,6 +234,37 @@ export default function Dashboard() {
</button>
</div>
</div>
{lifecycleMessage && (
<div className="panel p-4 text-xs text-[var(--foreground-dim)] whitespace-pre-wrap" data-testid="sandbox-lifecycle-message">
{lifecycleMessage}
</div>
)}
{inventoryEnabled && loading ? (
<div className="flex items-center justify-center h-64" data-testid="inventory-loading-state">
<div className="text-xs text-[var(--foreground-dim)] font-mono uppercase tracking-wider">
INITIALIZING...
</div>
</div>
) : inventoryEnabled && error ? (
<div className="panel p-8 text-center" data-testid="inventory-error-state">
<h3 className="text-sm font-semibold text-[var(--status-stopped)] uppercase tracking-wider">Inventory Unavailable</h3>
<p className="text-xs text-[var(--foreground-dim)] mt-2 font-mono">{error}</p>
</div>
) : (
<SandboxList
sandboxes={sandboxes}
nemoclaw={nemoclaw}
dashboardSessionId={dashboardSession.dashboardSessionId}
selectedSandboxId={dashboardSession.selectedSandboxId}
selectedSandbox={selectedSandbox}
onSandboxSelect={handleSandboxSelect}
isDestroyMode={isDestroyMode}
onInventoryRefresh={refresh}
/>
)}
</div>
) : (
<>
<div className="flex items-center justify-between mb-8">
+5
View File
@@ -41,6 +41,11 @@ assert.match(pageSource, /fetch\('\/api\/sandbox\/delete'/, 'destroy workflow mu
assert.match(pageSource, /refresh\(\{ force: true \}\)/, 'create and destroy workflows must force fresh inventory reads')
assert.match(pageSource, /refreshUntilSandboxVisible/, 'create workflow must wait for the new sandbox to appear in inventory')
assert.match(pageSource, /refreshUntilSandboxGone/, 'destroy workflow must wait for deleted sandboxes to leave inventory')
assert.match(
pageSource,
/isDestroyMode \? \([\s\S]*<SandboxList[\s\S]*isDestroyMode=\{isDestroyMode\}/,
'destroy mode must render the sandbox list so a sandbox can be selected'
)
assert.doesNotMatch(pageSource, /console\.log\('Destroying sandbox:'/, 'destroy workflow must not be a UI-only placeholder')
assert.doesNotMatch(configPanelSource, /onInventoryRefresh/, 'create panel must leave post-create inventory orchestration to the parent')