frontend
frontend copied to clipboard
Card Picker: Auto-completion behaviour
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
The auto-completion on the card-picker behaves erratically.
Describe the behavior you expected
Expected behavior
- Searching for the beginning of a card game such as "B" should filter cards starting with that letter such as "Button"
- Searching for a pattern included on a card name such as "most" should filter cards containing this pattern such as "Thermostat"
Steps to reproduce the issue
- Go to any of your dashboards
- Click on the overflow menu
- Click on
Edit your Dashboard - Click on
ADD CARD - Type
Bon the search - ❌
BUTTONshould be returned as part of the search results - Remove
Band typeAon the search - ❌
ALARM PANELshould be returned as part of the search - Remove
Aand TypeTheon the search - ❌
ThermostatandWeather forecastshould be the only cards returned in the search
What version of Home Assistant Core has the issue?
2023.11.3 Also Nightly 2023.12.0.dev20231123
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
Brave Version 1.60.114 Chromium: 119.0.6045.124 (Official Build) (arm64)
Which operating system are you using to run this browser?
macOS BigSur 14.0 (23A344)
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
#18733 partially addresses this.
The reason B was not matching was the search was requiring a two character minimum match. The PR relax this requirement for single character filter strings, so now B will return Button (and much more).
The reason the matches everything is because the search is also attempting to search the card descriptions, of which nearly all of them start with The <name> card does... . I'm torn on whether or not that's good behavior, but wasn't confident enough to push for a change there.
If that would have to be the only cards to be returned, description should not longer be included in the search.
It can also be given a weight per key, so that "the" in titles or types result in a bigger score and appear first: https://www.fusejs.io/examples.html#default-weight
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.