From cd02678ee71313b27846831087bb573fa22f5567 Mon Sep 17 00:00:00 2001 From: herjarsa Date: Fri, 28 Aug 2026 16:41:29 +0200 Subject: [PATCH] fix(directory-explorer): declare shouldCreateSelection in finalizeSelection The variable was referenced at line 484 (the single-target create branch) but never declared, so every non-clone add path (Add button, Cmd+Enter, Open in Finder, mobile add) threw a ReferenceError that surfaced as a 'Failed to select directory' toast. Add the missing local declaration matching the condition the original review intended: !isCloneMode && shouldCreateTarget && the target path equals the user-typed path. --- packages/ui/src/components/session/DirectoryExplorerDialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/src/components/session/DirectoryExplorerDialog.tsx b/packages/ui/src/components/session/DirectoryExplorerDialog.tsx index 800e66e5..7433e788 100644 --- a/packages/ui/src/components/session/DirectoryExplorerDialog.tsx +++ b/packages/ui/src/components/session/DirectoryExplorerDialog.tsx @@ -469,6 +469,7 @@ export const DirectoryExplorerDialog: React.FC = ( setIsConfirming(true); try { + const shouldCreateSelection = !isCloneMode && shouldCreateTarget && normalizeDirectoryPath(target) === normalizeDirectoryPath(targetPath); if (isCloneMode) { const remoteUrl = cloneRemoteUrl.trim(); if (!remoteUrl) {