Fixes #5087 - Removes Dialog scrolling code and and fixes other bugs along the way#5090
Merged
Fixes #5087 - Removes Dialog scrolling code and and fixes other bugs along the way#5090
Conversation
- Moved AllowedTypeAny and IAllowedType to separate files - Enhanced Notepad open dialog filters and options - Replaced Enumerable.Empty<T>() with [] literals - Changed CancelButton to CancelButtonIndex (int) - Moved FileDialog UI/filter setup to EndInit - Simplified FileDialogState and FileDialogTableSource - Updated OpenDialog/SaveDialog to use CancelButtonIndex - Applied code style and expression-bodied member improvements
Eliminates tracking and usage of _minimumSubViewsSize. Dialog sizing now only considers viewport, title, and button sizes. OnSubViewAdded override and related calculations are removed for simplification.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is focused on diagnosing the FileDialog performance regression reported in #5087, while also refactoring FileDialog initialization/nullability and removing the (now-deleted) AI example project from the solution.
Changes:
- Refactors FileDialog initialization (moving much of the “when running” setup into
EndInit) and adjusts cancel-result handling. - Reworks FileDialog search/state/history/filter plumbing (new
IAllowedTypefile split, nullable updates, history tweaks). - Removes
Examples/AIfrom the repository and solution.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Terminal.sln | Removes the Examples/AI project from the solution. |
| Terminal.Gui/Views/FileDialogs/SaveDialog.cs | Updates cancel detection to use CancelButtonIndex. |
| Terminal.Gui/Views/FileDialogs/OpenMode.cs | Removes file-level nullable disable directive. |
| Terminal.Gui/Views/FileDialogs/OpenDialog.cs | Updates docs and cancel detection to use CancelButtonIndex. |
| Terminal.Gui/Views/FileDialogs/IAllowedType.cs | Splits IAllowedType into its own file. |
| Terminal.Gui/Views/FileDialogs/FilesSelectedEventArgs.cs | Minor expression-bodied ctor refactor. |
| Terminal.Gui/Views/FileDialogs/FileDialogTableSource.cs | Refactors indexer and formatting in column rendering logic. |
| Terminal.Gui/Views/FileDialogs/FileDialogState.cs | Changes state initialization/child enumeration behavior and nullability. |
| Terminal.Gui/Views/FileDialogs/FileDialogHistory.cs | Refactors navigation stacks and nullability/flow. |
| Terminal.Gui/Views/FileDialogs/FileDialog.cs | Major refactor: cancel button API, dropdown creation, init moved to EndInit, SearchState adjustments, dispose moved. |
| Terminal.Gui/Views/FileDialogs/FileDialog.TableView.cs | Tightens context-menu mouse-binding detection and adds issue reference comment. |
| Terminal.Gui/Views/FileDialogs/FileDialog.Navigation.cs | Nullability tweaks and guards around autocomplete generation; signature changes. |
| Terminal.Gui/Views/FileDialogs/FileDialog.Commands.cs | Nullability tweaks, minor logic refactors, changes enum-default exception type. |
| Terminal.Gui/Views/FileDialogs/DefaultFileOperations.cs | Makes operations return nullable results and adjusts null-handling. |
| Terminal.Gui/Views/FileDialogs/AllowedTypeAny.cs | Moves AllowedTypeAny into its own file. |
| Terminal.Gui/Views/FileDialogs/AllowedType.cs | Removes embedded interface/AllowedTypeAny, updates ToString truncation implementation. |
| Terminal.Gui/Views/DialogTResult.cs | Changes dialog sizing/min-size logic. |
| Terminal.Gui/Views/Autocomplete/AutocompleteFilepathContext.cs | Nullability changes in suggestion generation and small refactors. |
| Terminal.Gui/ViewBase/Layout/Aligner.cs | Refactors properties to auto-property + field usage; adjusts PropertyChanged patterns. |
| Terminal.Gui/ViewBase/Helpers/StackExtensions.cs | Rewrites Stack extension methods using extension-member syntax and refactors implementations. |
| Terminal.Gui/FileServices/IFileOperations.cs | Updates New/Rename to return nullable. |
| Terminal.Gui/FileServices/FileSystemTreeBuilder.cs | Nullability changes in comparer and small refactors. |
| Examples/UICatalog/Scenarios/Notepad.cs | Adds OpenDialog AllowedTypes filtering; adjusts nullable handling. |
| Examples/UICatalog/Scenarios/Editor.cs | Adjusts nullable handling for SaveDialog.FileName. |
| Examples/AI/SlashCommandSuggestionGenerator.cs | Deleted. |
| Examples/AI/SingleTurnView.cs | Deleted. |
| Examples/AI/Program.cs | Deleted. |
| Examples/AI/ChatView.cs | Deleted. |
| Examples/AI/AI.csproj | Deleted. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…fType<string>() after Where filter Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/30418e61-6cfd-44e9-a7f7-0c239168714e Co-authored-by: tig <585482+tig@users.noreply.github.com>
BDisp
approved these changes
Apr 28, 2026
Collaborator
BDisp
left a comment
There was a problem hiding this comment.
Perfect. Now it's very much faster indeed.
Merged
This was referenced Apr 30, 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.
Fixes
Proposed Changes/Todos
Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)