Skip to content

Fixes FileDialog hiding hidden/system entries (dotfiles) after IgnoreInaccessible change#5581

Merged
tig merged 2 commits into
developfrom
fix/filedialog-hidden-entries
Jul 7, 2026
Merged

Fixes FileDialog hiding hidden/system entries (dotfiles) after IgnoreInaccessible change#5581
tig merged 2 commits into
developfrom
fix/filedialog-hidden-entries

Conversation

@tig

@tig tig commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the regression flagged by Codex review on #5580 (review comment): the FileDialog change that adopted EnumerationOptions { IgnoreInaccessible = true } (follow-up to #5544) kept the framework default AttributesToSkip = Hidden | System, so the dialog silently stopped listing hidden/system entries — including dotfiles on Unix, which .NET marks as Hidden. The GetDirectories ()/GetFileSystemInfos () calls it replaced never skipped them.

Changes

  • FileDialogState: Clear AttributesToSkip (FileAttributes.None) on the shared EnumerationOptions so hidden/system entries remain visible while inaccessible ones are still ignored.
  • Fallback for IFileSystem implementations that reject non-default AttributesToSkip: System.IO.Abstractions.TestingHelpers MockFileSystem throws NotSupportedException for any AttributesToSkip other than Hidden | System (its default; not yet implemented upstream). Without the fallback that exception was swallowed and the dialog listed nothing for such file systems. AddReadableChildren now catches NotSupportedException and falls back to the eager GetDirectories ()/GetFileSystemInfos () listing, which never skips hidden/system entries.

Tests

  • FileDialog_MixedMode_EnumerationDoesNotSkipHiddenOrSystemEntries / FileDialog_DirectoryMode_EnumerationDoesNotSkipHiddenOrSystemEntries — capture the EnumerationOptions passed to the enumeration calls and assert IgnoreInaccessible == true and AttributesToSkip == FileAttributes.None.
  • FileDialog_MixedMode_WhenEnumerationOptionsUnsupported_FallsBackToEagerListing / FileDialog_DirectoryMode_WhenEnumerationOptionsUnsupported_FallsBackToEagerListing — assert the NotSupportedException fallback path lists entries.
  • FileDialog_MixedMode_ListsHiddenAndSystemFiles — end-to-end via MockFileSystem with Hidden and System attributed files.

All 17,544 UnitTestsParallelizable tests and 42 IntegrationTests FileDialog tests pass.

Note for the v2.4.17 release (#5580): this should be merged to develop and flowed into the release branch before shipping, since the regression is part of the pending release.

🤖 Generated with Claude Code

tig and others added 2 commits July 6, 2026 20:28
…Inaccessible change

The switch to EnumerateDirectories/EnumerateFileSystemInfos with
EnumerationOptions { IgnoreInaccessible = true } (from the #5544 follow-up)
kept the framework default AttributesToSkip = Hidden | System, so the file
dialog silently filtered out hidden/system entries — including dotfiles on
Unix, which .NET marks as Hidden. The GetDirectories ()/GetFileSystemInfos ()
calls it replaced never skipped them.

- Clear AttributesToSkip (FileAttributes.None) so hidden/system entries stay
  visible while still ignoring inaccessible ones.
- Fall back to the eager listing methods when the IFileSystem implementation
  throws NotSupportedException for the non-default AttributesToSkip (e.g.
  System.IO.Abstractions.TestingHelpers MockFileSystem).
- Add regression tests covering the enumeration options, the fallback, and
  hidden/system files via MockFileSystem.

Flagged by Codex review on #5580.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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