fix: include Windows directory junctions in project browser#2798
fix: include Windows directory junctions in project browser#2798badcuban wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Straightforward bug fix that makes directory symlinks and Windows junctions appear in the project browser. The change is well-scoped with defensive handling for legacy Windows junctions and includes a test. You can customize Macroscope's approvability policy. Learn more. |
Summary
Why
On Windows, OneDrive-backed known folders like Desktop, Documents, and Pictures can appear as reparse points. Node reports those entries as symbolic links from
fs.readdir(..., { withFileTypes: true }), so the project browser filtered them out when it only accepteddirent.isDirectory().This keeps the existing browser behavior, but follows symlink/junction entries with
fs.statand includes them when they resolve to directories.Testing
bun fmtbun lint(passes with existing warnings)bun typecheckbun run test -- WorkspaceEntries~/OneDrive/returnsAttachments,Desktop,Documents,Music,Pictures, andPublicNote
Low Risk
Scoped to filesystem browse listing logic with a denylist for known-noisy Windows junctions; no auth or data-path changes.
Overview
Fixes the workspace project browser so folder listings include directory symlinks and Windows junctions (e.g. OneDrive-backed Desktop/Documents), not only entries where
readdirreportsisDirectory().Browse now resolves symlink/junction names with
fs.statwhen needed, still applying prefix/hidden filtering. On Windows it drops legacy profile junction names (Application Data, My Documents, etc.) so the home directory isn’t cluttered with dead-end entries. A regression test asserts a symlinked directory appears alongside the real target when browsing.Reviewed by Cursor Bugbot for commit cde0dbd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Include Windows directory junctions in project browser
isDirectoryEntryhelper inWorkspaceEntries.tsthat resolves symlinks viafsPromises.statto treat symlinked directories as directories.Application Data,Local Settings) from browse results.browsehandler to process dirents asynchronously withEffect.forEach(concurrency 16), filtering out entries that failstat.Macroscope summarized cde0dbd.