Fixes #5125 - Preserve FileDialog selection colors when navigating via dotdot#5407
Merged
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/04c4d724-8d21-462e-bff2-d1482dbd9cd5 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for FileDialog color issue
Preserve FileDialog selection colors when navigating via May 25, 2026
..
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a visual inconsistency in FileDialog where navigating up via the .. row could cause selected-row background colors to change unexpectedly. It does so by ensuring FileDialog’s per-cell coloring does not override TableView’s selection-state scheme.
Changes:
- Update
FileDialog’s tableColorGetterto preserveTableView’s selection-state attributes (Focus/HotFocus/Active/HotActive/Disabled) instead of recomputing them from file-type colors. - Add a regression unit test that exercises the
..(parent) row coloring behavior from a subdirectory state.
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.TableView.cs | Preserve TableView-owned selection/active/disabled scheme roles when applying file-type coloring. |
| Tests/UnitTestsParallelizable/Views/FileDialogColorTests.cs | Add regression coverage ensuring the parent-row color getter retains selection/active scheme roles. |
..Capture tableView.Table into a non-null local variable after asserting, eliminating repeated nullable dereferences and potential compiler warnings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Navigating up from a subdirectory via the
..row could change the selected row background inFileDialog. This updates FileDialog-specific table coloring so file-type colors do not override the table’s selected-state scheme.Proposed Changes/Todos
Keep selection-state colors owned by
TableViewFileDialog.ColorGetternow preserves the row scheme’sFocus/Active/Disabledattributes instead of rebuilding selected-state colors from file-type colors...row visually consistent before and after navigating up.Add a focused regression test
..) path from a subdirectory and asserting the effective selected-state scheme is preserved.Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)