Fixes #5363 - Honor AllowedTypes on initial OpenDialog mixed-mode load#5403
Merged
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/38f439b3-b6ec-4949-bdad-e74a47ddada3 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix OpenDialog not respecting AllowedTypes until directory change
Honor AllowedTypes on initial OpenDialog mixed-mode load
May 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates FileDialog initialization so that when AllowedTypes is configured and Path is set before EndInit () completes, the initial mixed-mode listing is immediately rebuilt using the now-established CurrentFilter (avoiding an initially unfiltered first render).
Changes:
- In
FileDialog.EndInit (), refreshes any pre-existingStateafter setting the initialCurrentFilterfromAllowedTypes. - Adds a regression test covering mixed-mode initialization where
Pathis assigned beforeEndInit (), ensuringAllowedTypesis respected on first load.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Terminal.Gui/Views/FileDialogs/FileDialog.cs | Rebuilds existing state during EndInit () after establishing the initial type filter. |
| Tests/UnitTestsParallelizable/Views/FileDialogResultTests.cs | Adds regression test validating initial mixed-mode filtering when Path is set prior to EndInit (). |
Address review comment: FileSystemInfoStats already exposes a safe Name property, so avoid the null-forgiving operator on FileSystemInfo which can legitimately be null for virtual entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BDisp
approved these changes
May 25, 2026
Member
|
Need @tznind to approve since he reported it. |
tznind
approved these changes
May 25, 2026
…alog-allowedtypes-respect # Conflicts: # Tests/UnitTestsParallelizable/Views/FileDialogResultTests.cs
This was referenced May 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.
Proposed Changes/Todos
Ensure the initial mixed-mode file listing honors
AllowedTypeseven whenPathis set before the dialog finishes initializationFileDialog.EndInit ()now refreshes any prebuilt state after assigning the initialCurrentFilterAdd a focused regression test for the failing initialization order
OpenMode.MixedAllowedTypesconfigured before showing the dialogPathassigned beforeEndInit ()Behavior
Pathearly could buildStatebeforeCurrentFilterexisted, so mixed mode showed unfiltered files until navigation refreshed the dialogPull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)