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() {
|
async function saveProjectAs() {
|
||||||
const folderPath = await open({
|
// Use save dialog so the user can type a new project name.
|
||||||
directory: true,
|
// The chosen path is treated as the project folder (created if needed).
|
||||||
title: 'Choose a folder to save the project',
|
const defaultName = currentProjectName || 'Untitled';
|
||||||
|
const chosenPath = await save({
|
||||||
|
defaultPath: defaultName,
|
||||||
|
title: 'Save Project — enter a project name',
|
||||||
});
|
});
|
||||||
if (!folderPath) return;
|
if (!chosenPath) return;
|
||||||
await saveToFolder(folderPath as string);
|
|
||||||
|
// Strip any file extension the user may have typed (e.g. ".vtn")
|
||||||
|
const folderPath = chosenPath.replace(/\.[^.\\/]+$/, '');
|
||||||
|
await saveToFolder(folderPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function openProject() {
|
async function openProject() {
|
||||||
|
|||||||
Reference in New Issue
Block a user