Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix entities sort for hidden/readonly #19124

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

karwosts
Copy link
Contributor

@karwosts karwosts commented Dec 22, 2023

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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@bramkragten bramkragten merged commit bded31b into home-assistant:dev Dec 27, 2023
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants