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 <noreply@anthropic.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user