Stabilize OpenShell control sandbox workflows

This commit is contained in:
Codex
2026-04-24 19:23:01 +00:00
parent 339608a254
commit 8e3b5332d4
7 changed files with 336 additions and 154 deletions
+23
View File
@@ -52,6 +52,29 @@ export default function Dashboard() {
setTheme(theme === 'light' ? 'dark' : 'light')
}
useEffect(() => {
if (!inventoryEnabled || loading || isCreateMode || isDestroyMode) return
if (sandboxes.length === 0) {
if (dashboardSession.selectedSandboxId) {
setDashboardSession((current) => updateDashboardSessionSelection(current, null))
}
return
}
const selectedStillExists = sandboxes.some((sandbox) => sandbox.id === dashboardSession.selectedSandboxId)
if (selectedStillExists) return
const nextSelection = sandboxes.find((sandbox) => sandbox.isDefault)?.id || sandboxes[0]?.id || null
setDashboardSession((current) => updateDashboardSessionSelection(current, nextSelection))
}, [
dashboardSession.selectedSandboxId,
inventoryEnabled,
isCreateMode,
isDestroyMode,
loading,
sandboxes,
])
const handleSandboxSelect = (id: string | null) => {
if (isDestroyMode && id) {
setDeletingSandboxId(id)