Conversation
|
Caution Review failedThe pull request is closed. WalkthroughRefactors Skills tab sorting from code-behind to a new WPF behavior. Adds Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Header as GridView Header
participant Behaviour as SkillsGridViewSortBehaviour
participant VM as SkillsTabViewModel
participant LCV as ListCollectionView
User->>Header: Click column header
Header->>Behaviour: Header click event
Behaviour->>Behaviour: Resolve SortField & compute direction (toggle if same)
Behaviour->>Behaviour: Locate SkillsGridViewColumn by SortField
Behaviour->>LCV: Apply SortDescription & SkillComparer (update view)
Behaviour->>VM: Execute SortChangedCommand (pass SkillsSortInfo)
VM->>VM: Update internal _sortInfo and persist to JSON
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
ClassicAssist/UI/Misc/Behaviours/SkillsGridViewSortBehaviour.cs(1 hunks)ClassicAssist/UI/ViewModels/SkillsTabViewModel.cs(6 hunks)ClassicAssist/UI/Views/SkillsTabControl.xaml(2 hunks)ClassicAssist/UI/Views/SkillsTabControl.xaml.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
ClassicAssist/UI/ViewModels/SkillsTabViewModel.cs (2)
ClassicAssist/UI/Misc/Behaviours/SkillsGridViewSortBehaviour.cs (2)
SkillsSortInfo(133-143)SkillsSortInfo(135-139)ClassicAssist/UI/Misc/SkillsGridViewColumn.cs (1)
SkillsGridViewColumn(6-26)
ClassicAssist/UI/Misc/Behaviours/SkillsGridViewSortBehaviour.cs (2)
ClassicAssist/UI/Misc/SkillsGridViewColumn.cs (1)
SkillsGridViewColumn(6-26)ClassicAssist.Shared/UI/Behaviours/GridViewSort.cs (2)
GridViewSort(31-93)ClassicAssist(29-94)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
| dataView.SortDescriptions.Clear(); | ||
| dataView.SortDescriptions.Add( new SortDescription( column.Header.ToString(), direction ) ); | ||
| dataView.CustomSort = new SkillComparer( direction, column.SortField ); |
There was a problem hiding this comment.
Stop deriving the sort key from the header text
column.Header.ToString() yields captions such as "+/-" (see ClassicAssist/UI/Views/SkillsTabControl.xaml Line 74) and other localised strings, but ListCollectionView.SortDescriptions.Add requires an actual property identifier. Clicking the "+/-" column now throws an ArgumentException because there is no property named "+/-" on SkillEntry. Please drive the sort description from a real property name (e.g. map the enum to the underlying property) or drop the SortDescriptions.Add call and rely solely on CustomSort, so users can sort the delta/status columns without crashing the tab.
- dataView.SortDescriptions.Add( new SortDescription( column.Header.ToString(), direction ) );🤖 Prompt for AI Agents
In ClassicAssist/UI/Misc/Behaviours/SkillsGridViewSortBehaviour.cs around lines
126-128, the code builds a SortDescription using column.Header.ToString() which
can be UI text like "+/-" and causes ArgumentException; replace that by using a
real property identifier: if column.SortField (or an equivalent property name)
is non-empty and corresponds to a SkillEntry property, add the SortDescription
with that name, otherwise skip adding SortDescriptions entirely and rely solely
on dataView.CustomSort = new SkillComparer(direction, column.SortField); ensure
you clear SortDescriptions first as before and only call SortDescriptions.Add
when the SortField is valid.
|



Summary by CodeRabbit