Skip to content

fix: include Windows directory junctions in project browser#2798

Open
badcuban wants to merge 1 commit into
pingdotgg:mainfrom
badcuban:codex/windows-directory-junction-browse
Open

fix: include Windows directory junctions in project browser#2798
badcuban wants to merge 1 commit into
pingdotgg:mainfrom
badcuban:codex/windows-directory-junction-browse

Conversation

@badcuban
Copy link
Copy Markdown

@badcuban badcuban commented May 25, 2026

Summary

  • include directory symlinks/junctions in workspace folder browsing when they resolve to directories
  • skip legacy Windows profile junction names that otherwise add noisy dead-end entries in the home directory
  • add a focused regression test for browsing a symlinked directory

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 accepted dirent.isDirectory().

This keeps the existing browser behavior, but follows symlink/junction entries with fs.stat and includes them when they resolve to directories.

Testing

  • bun fmt
  • bun lint (passes with existing warnings)
  • bun typecheck
  • bun run test -- WorkspaceEntries
  • manual browse check: ~/OneDrive/ returns Attachments, Desktop, Documents, Music, Pictures, and Public

Note

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 readdir reports isDirectory().

Browse now resolves symlink/junction names with fs.stat when 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

  • Adds an isDirectoryEntry helper in WorkspaceEntries.ts that resolves symlinks via fsPromises.stat to treat symlinked directories as directories.
  • Excludes a hardcoded set of Windows legacy profile junctions (e.g. Application Data, Local Settings) from browse results.
  • Reworks the browse handler to process dirents asynchronously with Effect.forEach (concurrency 16), filtering out entries that fail stat.
  • Adds a test verifying that directory symlinks appear alongside real directories in browse results.
  • Behavioral Change: browse results now include symlinked directories and omit entries that cannot be stat'ed, which was not the case before.

Macroscope summarized cde0dbd.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e8ae26a0-669d-49d8-92bc-9d723fdc3ff6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels May 25, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 25, 2026

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant