fix: 支持符号链接的导航,优化目录树的展开逻辑

This commit is contained in:
cmliu committed 2026-07-31 04:26:32 +08:00
1 parent d0acfc2f54
commit 5689ed4239
1 file changed
+6 -2
+6 -2
View File
@@ -748,12 +748,16 @@ export class FileTree {
this.highlightNode(node);
this.focusedNode = node;
this.updateTabindex();
if (node.type === 'directory' && !node.unavailable) {
if ((node.type === 'directory' || node.type === 'symlink') && !node.unavailable) {
this.onNavigate(node.path);
// Expand the node in the tree immediately so aria-expanded flips to
// "true" (or shows a loading spinner) without waiting for the async
// setCwd → expandToPath round-trip that follows onNavigate.
void this.expandNode(node);
// Only real directories are expandable; symlinks navigate the right
// panel but are not expanded in the tree (isExpandable returns false).
if (node.type === 'directory') {
void this.expandNode(node);
}
}
// Files/symlinks: select only, no right-side navigation
// Unavailable directories: highlight but don't navigate (SFTP would