Add option to show sortable columns hint icon - #427
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Initially enabling the property before header creation leaves the hint icon hidden.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an opt-in hint icon for sortable, unsorted columns.
Changes:
- Adds
ShowSortableColumnIconand runtime update callbacks. - Adds the sortable visual state, glyph, tests, sample, and documentation.
File summaries
| File | Description |
|---|---|
tests/TableViewSortableColumnIconTests.cs |
Tests icon states and runtime changes. |
src/VisualStates.cs |
Defines the sortable state. |
src/Themes/TableViewColumnHeader.xaml |
Renders the hint icon state. |
src/Themes/Resources.xaml |
Adds the hint glyph resources. |
src/TableViewColumnHeader.cs |
Selects the sortable visual state. |
src/TableView.Properties.cs |
Adds the new table property and callbacks. |
src/Columns/TableViewColumn.cs |
Reacts to CanSort changes. |
samples/WinUI.TableView.SampleApp/Pages/SortingPage.xaml |
Demonstrates the option. |
docs/docs/sorting.md |
Documents the feature. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description
Adds an opt-in
TableView.ShowSortableColumnIconproperty that shows a subtle hint icon on sortable columns that have no active sort direction, so users can tell at a glance which columns support sorting without having to click them first. The property defaults tofalse, so no existing app changes visually unless it opts in.TableView.ShowSortableColumnIcon(bool, defaultfalse).Sortablevisual state onTableViewColumnHeader'sSortStatesgroup — shows the header's sort icon at 50% opacity with a new glyph when a column is sortable but currently unsorted.TableView.CanSortColumnsand the column's ownCanSort— never shows on a non-sortable column.CanSortandCanSortColumns(previously missing, unlike the equivalentCanFilter/CanFilterColumnscallbacks), so the header now also reacts live if those change at runtime.sorting.md, plus an entry in the options table.Related Issue
Closes #114
Type of Change
Checklist
mainbranchScreenshots / Recordings
Additional Notes
Uno target builds cleanly but wasn't run/visually verified. Worth a quick look in Visual Studio at the new glyph (
\ue8cb) next to the existing ascending/descending icons before merging, to confirm it reads well at 10px.