From fc5cfc437485357735f412df55d8dcaf0b98d748 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Mar 2026 10:24:58 -0700 Subject: [PATCH] Save As: use save dialog so user can type a new project name Changed from folder picker (can only select existing folders) to save dialog where the user can type a new name. The typed name becomes the project folder, created automatically if it doesn't exist. Any file extension the user types is stripped (e.g. "My Project.vtn" becomes the folder "My Project/"). Co-Authored-By: Claude Opus 4.6 --- src/routes/+page.svelte | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ba8a880..4696821 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -225,12 +225,18 @@ } async function saveProjectAs() { - const folderPath = await open({ - directory: true, - title: 'Choose a folder to save the project', + // Use save dialog so the user can type a new project name. + // The chosen path is treated as the project folder (created if needed). + const defaultName = currentProjectName || 'Untitled'; + const chosenPath = await save({ + defaultPath: defaultName, + title: 'Save Project — enter a project name', }); - if (!folderPath) return; - await saveToFolder(folderPath as string); + if (!chosenPath) return; + + // Strip any file extension the user may have typed (e.g. ".vtn") + const folderPath = chosenPath.replace(/\.[^.\\/]+$/, ''); + await saveToFolder(folderPath); } async function openProject() {