feat: sync project name with selected folder

This commit is contained in:
Soulter
2026-09-25 12:26:09 +08:00
parent eb91c9f6f4
commit f5ec23969c
@@ -179,6 +179,11 @@ async function handlePickWorkspaceDirectory() {
const selectedPath = await pickDirectory(form.value.workspace_path || null);
if (selectedPath) {
form.value.workspace_path = selectedPath;
const normalizedPath = selectedPath.replace(/[\\/]+$/, '');
const folderName = normalizedPath.split(/[\\/]/).pop();
if (folderName) {
form.value.title = folderName;
}
}
} catch (error) {
console.warn('[chat-project] Failed to pick workspace directory.', error);