File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -582,9 +582,16 @@ export function interactivePicker(
582582 } else if ( item && item . node . type === "symlink" && item . node . linkTarget . endsWith ( "/" ) ) {
583583 // Symlink to folder - resolve relative path and jump to target
584584 const targetPath = resolveSymlinkPath ( item . node . path , item . node . linkTarget )
585+ // Expand all ancestors so target is visible
586+ const pathParts = targetPath . split ( "/" )
587+ for ( let pi = 1 ; pi <= pathParts . length ; pi ++ ) {
588+ const ancestorPath = pathParts . slice ( 0 , pi ) . join ( "/" )
589+ const ancestor = findNodeByPath ( tree , ancestorPath )
590+ if ( ancestor && ancestor . type === "tree" ) ancestor . expanded = true
591+ }
585592 const targetNode = findNodeByPath ( tree , targetPath )
586593 if ( targetNode ) {
587- targetNode . expanded = true
594+ if ( targetNode . type === "tree" ) targetNode . expanded = true
588595 const updatedItems = flatten ( tree )
589596 const targetIdx = updatedItems . findIndex ( ( fi ) => fi . node === targetNode )
590597 if ( targetIdx >= 0 ) cursor = targetIdx + 1 // +1 for dot row
You can’t perform that action at this time.
0 commit comments