From 378041e2013120c6bd579cf5419fda8e5fc3bc8d Mon Sep 17 00:00:00 2001 From: tristantr Date: Tue, 9 Jun 2026 18:59:57 +0200 Subject: [PATCH] fix(deploy-to-hub): New draft returns to the folder-picker step instead of erroring In the live phase the folder picker is hidden, so startNewDraft's selectedFolder guard always failed with "Pick a folder..." and the user had no way to pick one. Now New draft goes back to step 1 (predeploy) with the project's folder pre-selected (inferred from the item paths) so the user can re-bundle. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../workspaceSettings/DeployToHub.svelte | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte b/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte index 07462af1d4..7ae314fed9 100644 --- a/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte +++ b/frontend/src/lib/components/workspaceSettings/DeployToHub.svelte @@ -1220,15 +1220,16 @@ syncing = false } } - async function startNewDraft() { - if (!selectedFolder || filteredWorkspaceItems.length === 0) { - sendUserToast(`Pick a folder with at least one item before starting a new draft.`, true) - return - } - draftItems = filteredWorkspaceItems.map((i) => ({ ...i, rec: 'none' })) + function startNewDraft() { + const folders = new Set( + draftItems + .map((i) => i.path.split('/').slice(0, 2).join('/')) + .filter((p) => p.startsWith('f/')) + ) + selectedFolder = folders.size === 1 ? [...folders][0] : undefined + draftItems = [] recordings = {} - phase = 'draft' - sendUserToast(`New draft started.`) + phase = 'predeploy' } async function openRecord(it: DeployItem) {