From a96659f4d2357d7d83217687b8f53a1292e49cff Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Wed, 24 Sep 2025 04:37:13 +0800 Subject: [PATCH] FIX: Resolve symlink double-click behavior in file manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: Duplicate handleFileOpen function definitions caused symlinks to be treated as regular files instead of navigating to their targets. Problem: - Line 575: Correct implementation with symlink handling - Line 1401: Incorrect duplicate that overrode the correct function - Double-clicking symlinks opened them as files instead of following links Solution: - Removed duplicate handleFileOpen function (lines 1401-1436) - Preserved correct implementation with symlink navigation logic - Added recordRecentFile call for consistency Now symlinks properly: - Navigate to target directories when they point to folders - Open target files when they point to files - Use identifySSHSymlink backend API for resolution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../Apps/File Manager/FileManagerModern.tsx | 40 ++----------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/src/ui/Desktop/Apps/File Manager/FileManagerModern.tsx b/src/ui/Desktop/Apps/File Manager/FileManagerModern.tsx index a5889cfe..125bca4e 100644 --- a/src/ui/Desktop/Apps/File Manager/FileManagerModern.tsx +++ b/src/ui/Desktop/Apps/File Manager/FileManagerModern.tsx @@ -585,6 +585,9 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) { return; } + // Record to recent access for regular files + await recordRecentFile(file); + // Calculate window position (slightly offset) const windowCount = Date.now() % 10; // Simple offset calculation const offsetX = 120 + windowCount * 30; @@ -1397,43 +1400,6 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) { await handleFileOpen(file); } - // Handle file opening - async function handleFileOpen(file: FileItem) { - if (file.type === "directory") { - // If it's a directory, switch to that directory - setCurrentPath(file.path); - } else { - // If it's a file, record to recent access and open file window - await recordRecentFile(file); - - // Create file window - const windowCount = Date.now() % 10; - const offsetX = 100 + windowCount * 30; - const offsetY = 100 + windowCount * 30; - - const createFileWindow = (windowId: string) => ( - - ); - - openWindow({ - title: file.name, - x: offsetX, - y: offsetY, - width: 800, - height: 600, - isMaximized: false, - isMinimized: false, - component: createFileWindow, - }); - } - } // Load pinned files list (when host or connection changes) useEffect(() => {