Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): show dot entries in non-git projects #8670

Closedessjaykay755(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/8670/headopened View on GitHub

What Changed

  • Keep the existing FFF-backed workspace index for normal project listings.
  • For non-Git project roots where the index intentionally omits root dot-entries, supplement the file tree with those dot-prefixed entries and their descendants.
  • Preserve the existing safeguards for home/root scans, Git repositories, ignore files, .git, node_modules, and the 25,000-entry cap.
  • Add regression coverage for the reported non-Git project case and for not bypassing ignore rules.

Why

In a project that is not a Git repository, the Files panel can omit entries such as .hidden-file.txt and .hidden-dir/ even though visible entries in the same directory appear normally.

projects.listEntries is backed by the FFF workspace index. FFF intentionally skips hidden entries for non-Git roots as a safety measure for large home/root scans. For an ordinary project directory, that behavior makes legitimate dot-entries invisible in the Files panel.

This change keeps the indexed listing as the source of truth and only supplements the missing dot-entry subtree when it is safe to do so, rather than changing the RPC contract or weakening Git/ignore behavior.

Fixes #8665

Validation

  • pnpm exec vp test run apps/server/src/workspace/WorkspaceEntries.nonGitHidden.test.ts — 3 passed
  • pnpm exec vp test run apps/server/src/workspace/WorkspaceEntries.test.ts — 30 passed
  • pnpm exec vp run --filter t3 typecheck — completed with unrelated Effect suggestions only
  • git diff --check main...HEAD — passed

Scope

  • Server-side workspace listing only
  • No contract changes
  • No client changes
  • No Git behavior changes
  • No dependency changes

Note

Medium Risk New filesystem traversal and git/ignore gating on projects.listEntries; wrong fallbacks could hide dot entries or over-list, but scope is server listing only with explicit caps and abort conditions.

Overview WorkspaceEntries.list still uses the FFF path index as the primary source, but for ordinary non-Git project roots it can now merge in root-level dot files/directories (and descendants under those dot dirs) that FFF omits on purpose.

Augmentation is skipped when the index is already truncated, the cwd is home or filesystem root, .git exists on the cwd or an ancestor, the scan hits .gitignore/.ignore, unreadable dirs, or would exceed the shared 25,000 entry budget; .git and node_modules are not walked. Extra paths are deduped, sorted, and only fill remaining capacity so indexed entries are not displaced at the cap.

Adds WorkspaceEntries.nonGitHidden.test.ts for visible dot entries, respect for ignore files, and cap behavior with a mocked full index.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4c74aa91c032789b4e262a77282f235f6ee794ee. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Show dot entries in non-Git workspaces in WorkspaceEntries.list

  • Augments indexed search results with unindexed root dot-entries and their descendants for non-Git workspaces, skipping .git and node_modules
  • Aborts supplemental collection when .gitignore or .ignore is present in any scanned directory, or when any ancestor contains Git metadata (.git), to avoid duplicating ignore logic
  • Merges supplemental entries up to a total cap of 25,000 entries (NON_GIT_DOT_ENTRY_SCAN_MAX_ENTRIES); the truncated flag reflects whether supplemental entries were dropped
  • Skips augmentation entirely for home directory scans, filesystem root, or already-truncated index results
  • Risk: collectNonGitRootDotEntries treats non-ENOENT/ENOTDIR lstat errors as existing paths in pathExistsForRepositoryDetection; check that this conservative default does not cause false Git detection in environments with permission or I/O errors
Macroscope summarized 4c74aa9.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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 Plus

      Run ID: a8afb876-4aee-4177-90f1-9027fcfa7065

      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

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a1bcd1b6f78fda33a7e22c8f2deb1fc21535f72f. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The production listing path now performs bounded recursive filesystem traversal and merges previously omitted dot entries, changing both returned results and truncation behavior for non-Git workspaces. The focused tests help, but the new runtime logic and safety heuristics are substantial enough to merit human review.

      Notes:

      • No code objects were reviewed. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Note: GPT-6 on behalf of shivam (@shivamhwp).

      Please keep #8665 open until the nested-repository case Julius carried over from #9041 is covered. The supplemental walk only starts at dot-prefixed children of the project root, so parent/repoA/.env.example and parent/repoA/.gitignore remain absent when repoA is a normal child directory, even when both files are tracked. repoA/ignored.txt remains correctly excluded.

      There are two further gaps. A root .ignore containing only ignored.txt disables the entire supplemental walk, hiding an unrelated .env.example. And WorkspaceEntries.search still reads the original index, so a plain .hidden-file.txt can appear in the Files listing after this change while remaining unavailable through the composer search path.

      The fix needs consistent hidden-entry handling across listing and search, including nested repositories, while retaining the applicable ignore rules. Returning the unchanged index whenever any ignore file exists does not meet that requirement.

    6. maria-rcks closed this

Sign in to join this conversation.