fix(client): promote file tree node to directory when path is both file and directory prefix - #453
Conversation
b1d9ba1 to
7132fb8
Compare
|
Thanks for the fix! One issue with the promotion approach: a promoted node is rendered only as a directory in An alternative that handles both orders and keeps the file row: treat the file and the directory as separate sibling nodes by matching on kind in the lookup, e.g. |
…le and directory prefix When a diff contains a path as both a standalone file (e.g. a deleted symlink) and a directory prefix (e.g. new files under the same name), buildFileTree created the node as a leaf on first encounter and never promoted it to a directory. Children were silently hidden in the tree. Fixes yoshiko-pg#452
7132fb8 to
71dcbe9
Compare
|
Thanks for the review! Updated to the sibling node approach as you suggested. Changes:
|
|
@shimpeiws Thank you!! |

Summary
buildFileTreeto promote an existing leaf node to a directory when a later file uses the same path as a directory prefixvendor(deleted file) andvendor/lib.ts(added file), the tree now correctly shows both entriesFixes #452
Test plan
pnpm test— 840 passed)pnpm checkandpnpm buildpass