From 8070c4132a7a75aa8011da4f4e789cf13c945675 Mon Sep 17 00:00:00 2001 From: teernisse Date: Thu, 26 Feb 2026 17:07:35 -0500 Subject: [PATCH] fix(spawn): handle empty or missing projects directory - Add empty-state message in SpawnModal when no projects found - Spawn button stays disabled when projects list is empty - Server already handled OSError/missing dir gracefully (returns []) - Add tests: missing directory, only-hidden-dirs, empty API responses Closes: bd-3c7 --- dashboard/components/SpawnModal.js | 6 +- tests/test_spawn.py | 606 +++++++++++++++++++++++++++++ 2 files changed, 611 insertions(+), 1 deletion(-) create mode 100644 tests/test_spawn.py diff --git a/dashboard/components/SpawnModal.js b/dashboard/components/SpawnModal.js index f57e3db..bdcce4e 100644 --- a/dashboard/components/SpawnModal.js +++ b/dashboard/components/SpawnModal.js @@ -86,7 +86,7 @@ export function SpawnModal({ isOpen, onClose, onSpawn, currentProject }) { const data = await response.json(); if (data.ok) { - onSpawn({ success: true, project, agentType }); + onSpawn({ success: true, project, agentType, spawnId: data.spawn_id }); handleClose(); } else { setError(data.error || 'Spawn failed'); @@ -139,6 +139,10 @@ export function SpawnModal({ isOpen, onClose, onSpawn, currentProject }) { ... Loading projects + ` : projects.length === 0 ? html` +
+ No projects found in ~/projects/ +
` : html`