frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Card Picker: Auto-completion behaviour

Open jlpouffier opened this issue 1 year ago • 3 comments

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

  1. Go to any of your dashboards
  2. Click on the overflow menu
  3. Click on Edit your Dashboard
  4. Click on ADD CARD
  5. Type B on the search
  6. BUTTON should be returned as part of the search results
  7. Remove B and type A on the search
  8. ALARM PANEL should be returned as part of the search
  9. Remove A and Type The on the search
  10. Thermostat and Weather forecast should be the only cards returned in the search

image

image

image

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

jlpouffier avatar Nov 23 '23 13:11 jlpouffier

#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.

karwosts avatar Nov 23 '23 16:11 karwosts

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

silamon avatar Nov 25 '23 09:11 silamon

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.

github-actions[bot] avatar Feb 23 '24 10:02 github-actions[bot]