fix(vscode): add project adds the chosen folder to the workspace

This commit is contained in:
bashrusakh
2026-08-19 10:38:54 +11:00
parent ef2afdc759
commit 599dafcd8c
9 changed files with 341 additions and 6 deletions
@@ -417,11 +417,11 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
handleClose();
}, [handleClose, isMobile, openNewSessionDraft, setActiveMainTab, setSessionSwitcherOpen]);
const handleQuickAdd = React.useCallback((event: React.MouseEvent, path: string) => {
const handleQuickAdd = React.useCallback(async (event: React.MouseEvent, path: string) => {
event.stopPropagation();
const normalized = normalizeDirectoryPath(path);
if (normalized && addedProjectPaths.has(normalized)) return;
const project = addProject(path);
const project = await addProject(path);
if (!project) {
toast.error(t('directoryExplorerDialog.toast.failedToAddProject'), {
description: t('directoryExplorerDialog.toast.selectValidDirectoryPath'),
@@ -455,7 +455,7 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
} else if (shouldCreateSelection) {
await opencodeClient.createDirectory(target, { asProject: true });
}
const project = addProject(selectedTarget);
const project = await addProject(selectedTarget);
if (!project) {
toast.error(t('directoryExplorerDialog.toast.failedToAddProject'), {
description: t('directoryExplorerDialog.toast.selectValidDirectoryPath'),