feat: Add set_show_hidden_files option for file dialogs#306
Merged
PolyMeilex merged 2 commits intoPolyMeilex:masterfrom Jan 28, 2026
Merged
feat: Add set_show_hidden_files option for file dialogs#306PolyMeilex merged 2 commits intoPolyMeilex:masterfrom
PolyMeilex merged 2 commits intoPolyMeilex:masterfrom
Conversation
Add FileDialog::set_show_hidden_files() and AsyncFileDialog::set_show_hidden_files() methods to control whether hidden files (dotfiles) are displayed in file picker dialogs. Platform support: - macOS: Uses NSOpenPanel.setShowsHiddenFiles - Windows: Uses IFileDialog FOS_FORCESHOWHIDDEN flag - Linux (GTK3): Uses gtk_file_chooser_set_show_hidden - Linux (XDG Portal): Not supported (option is ignored) - WASM: Not applicable (browser controls this) This is useful for applications that need to work with dotfiles like .gitignore, .env, configuration files, etc.
The get_options/add_options methods need access to IFileDialogV::GetOptions to properly combine the FOS_FORCESHOWHIDDEN flag with existing dialog options. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PolyMeilex
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
FileDialog::set_show_hidden_files()andAsyncFileDialog::set_show_hidden_files()methods to control whether hidden files (dotfiles) are displayed in file picker dialogs.
Motivation
Applications working with dotfiles (
.gitignore,.env, config files) need to show hidden files in file dialogs.This feature is particularly valuable for macOS and Windows apps targeting general audiences. Frameworks like Tauri enable developers to build cross-platform desktop apps for mainstream users who may not be familiar with platform-specific keyboard shortcuts (e.g., Cmd+Shift+. on macOS). Programmatic control over hidden file visibility provides a more accessible and discoverable experience—users shouldn't need to know obscure key combinations to complete a task the application explicitly supports.
On Linux, the standard
Ctrl+Hshortcut is more widely known among desktop users, making this less critical (see XDG Portal note below).Platform Support
NSOpenPanel.setShowsHiddenFilesIFileDialogwithFOS_FORCESHOWHIDDENflaggtk_file_chooser_set_show_hidden--features gtk3)Note on XDG Desktop Portal
The XDG Desktop Portal FileChooser API intentionally does not include a "show hidden files"
option. This is by design - the portal's philosophy delegates UI control to the user and
desktop environment, not the sandboxed application.
Users on Linux with the XDG Portal backend (the default) can press Ctrl+H to toggle
hidden file visibility, which is standard UX across Linux desktop environments.
Reference: XDG Desktop Portal FileChooser Documentation
Example
Test Plan
cargo run --example show_hidden --no-default-features --features gtk3)