Show only selectable sorting options in filters - #256
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves the user experience by dynamically controlling the visibility of sorting options in group monitor filters. Specifically, the "Sort by Filter Count" option is now only shown when filters are active or when this sorting option is currently selected, preventing confusion when the sorting option would be meaningless.
Key Changes
- Added conditional logic to enable/disable the "Sort by Filter Count" option based on filter state
- Enhanced the sort menu system to support disabled states for sort options
- Refactored sort menu item rendering to use a unified approach for both standard and custom fields
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| group-monitor-view.ts | Added filter component queries and conditional logic to control "Sort by Filter Count" availability |
| knx-sort-menu-item.ts | Added disabled state support with proper styling and interaction prevention |
| knx-list-filter.ts | Added sortDisabled configuration option and unified sort menu item rendering |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
========================================
+ Coverage 3.16% 3.32% +0.15%
========================================
Files 55 55
Lines 10284 10328 +44
Branches 148 156 +8
========================================
+ Hits 326 343 +17
- Misses 9958 9985 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…s: none Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
With more refactoring ahead, I’d prefer to skip writing tests for now, as they could quickly become outdated. I’ll include them with the upcoming changes once things have settled. |
|
It was you who introduced tests and coverage to this repo... so fine for me 😉 |
This PR ensures that only sorting options relevant to the current context are displayed in the filters. The Sort by Filter Count option is now only shown when filter options are currently selected or when this sorting option is already active.