Skip to content

Show dot files in file tree#151

Merged
2witstudios merged 1 commit intomainfrom
pu/dot-files
Mar 31, 2026
Merged

Show dot files in file tree#151
2witstudios merged 1 commit intomainfrom
pu/dot-files

Conversation

@2witstudios
Copy link
Copy Markdown
Owner

@2witstudios 2witstudios commented Mar 31, 2026

Summary

  • Remove the blanket name.hasPrefix(".") filter from FileTreeState.scanDirectory so dot files and directories (.gitignore, .env, .claude/, .pu/, etc.) appear in the file tree — just like a real file system
  • Dot files are excluded from gitignore checking so they always remain visible
  • The hiddenNames set (.git, .DS_Store, .build, .swiftpm, xcuserdata, DerivedData, __pycache__, .tsbuildinfo, node_modules) still filters noise

Test plan

  • Build in Xcode — verify no compilation errors
  • Run tests (Cmd+U) — new FileTreeStateTests covers dot file visibility, hidden name exclusion, and mixed content
  • Open a repo with dot files — verify they appear in the file tree
  • Verify .git and .DS_Store are still hidden
  • Verify a gitignored dot file (e.g. .env) still shows in the tree

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 14 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 14 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 990251f7-bcf5-4704-9678-086e868d9136

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2af16 and 12e61f1.

📒 Files selected for processing (2)
  • apps/purepoint-macos/purepoint-macos/State/FileTreeState.swift
  • apps/purepoint-macos/purepoint-macosTests/FileTreeStateTests.swift
📝 Walkthrough

Walkthrough

Replaces early dot-prefixed filtering with an async applyGitIgnore(nodes:root:) workflow that defers git-ignore evaluation for dotfiles/dotdirs, updates scanDirectory and computeGitIgnored to stop dropping dot entries, and adds tests validating inclusion/exclusion behavior.

Changes

Cohort / File(s) Summary
Core logic
apps/purepoint-macos/purepoint-macos/State/FileTreeState.swift
Removed unconditional skipping of names starting with "."; introduced async applyGitIgnore(nodes:root:) to filter nodes and traverse expanded directories, and adjusted computeGitIgnored to pass dotfile/dotdir candidates to git check-ignore.
Tests
apps/purepoint-macos/purepoint-macosTests/FileTreeStateTests.swift
Added test suite with temp-dir helpers and five tests exercising FileTreeState.load(worktreePath:), asserting correct inclusion of visible dotfiles and exclusion of configured hidden patterns.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant FileTreeState
    participant FileSystem
    participant Git as "git check-ignore"

    Caller->>FileTreeState: load(worktreePath:)
    FileTreeState->>FileSystem: scanDirectory(root)
    FileSystem-->>FileTreeState: entries (including dot-prefixed)
    FileTreeState->>FileTreeState: applyGitIgnore(nodes, root)
    FileTreeState->>Git: computeGitIgnored(relativePaths...)
    Git-->>FileTreeState: ignoredPaths
    FileTreeState-->>FileTreeState: filter nodes & traverse expanded children
    FileTreeState-->>Caller: rootNodes (filtered)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibbled through dots with care,
Let git decide which ones stay there.
Hidden names still hide away,
While tests hop in to check the play —
A tiny patch, a joyous hare 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Show dot files in file tree' directly and clearly describes the main change: enabling visibility of dot files and directories in the file tree by removing blanket dot-prefix filtering.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pu/dot-files

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d279e04a65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

var nodes: [FileTreeNode] = []
for name in contents {
if Self.hiddenNames.contains(name) || name.hasPrefix(".") { continue }
if Self.hiddenNames.contains(name) { continue }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve gitignore filtering when including dotfiles

By removing the name.hasPrefix(".") guard here, dotfiles now enter the regular scan path, but refresh() still rebuilds rootNodes via scanDirectory without re-running computeGitIgnored/filterIgnored. In practice, a dotfile that is ignored (for example .env) is hidden right after load() but reappears after any watcher-triggered refresh, which is a regression from the previous behavior where dotfiles stayed hidden on refresh.

Useful? React with 👍 / 👎.

Remove blanket dot-file filter from scanDirectory so files like
.gitignore, .env, .claude/, .pu/ are visible and editable — just
like a real file system. The hiddenNames set (.git, .DS_Store, etc.)
still filters noise. Dot files are excluded from gitignore checking
so they always remain visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@2witstudios 2witstudios merged commit 135459a into main Mar 31, 2026
1 check passed
@2witstudios 2witstudios deleted the pu/dot-files branch March 31, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant