Fix entities sort for hidden/readonly #19124
Merged
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.
Proposed change
Fix sort by status on entities table. Currently "hidden" and "readonly" have status icons, but sorting on status ignores them, so they just kind of float around randomly in the table when trying to sort.
I added these to sort, but I also want to propose changing the "ok" status to undefined, so that it always sorts to the bottom of the table. Given that "ok" entities don't show an icon or have a label, I consider the status column to really only be sorting the exceptional states, and should ignore the ok entities.
This is similar to how when we sort by battery, the devices without battery always go to the bottom, regardless of if it is sorted asc or desc.
If I don't do this, then it's somewhat odd as sorting the table shows "disabled" and "hidden" first, then all of the ok entities, and finally "readonly" "restored" and "unavailable" at the end. That seems like not how sort would be expected to behave for status.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: