8 Commits

Author SHA1 Message Date
Philip Allgaier
899eab4e5c
Ensure 0 does not get formatted to empty string (#8971) 2021-04-23 09:29:03 +02:00
Donnie
538028a003
Refactor sequence matching to accept item rather than word array (#8866)
* Refactor sequence matching to require an item rather than array of words to filter against

* change 'words' to 'strings'. Add tsdoc description for ScorableTextItem

* Replace type checking with 'as' to clean up code
2021-04-14 15:29:10 -07:00
Donnie
7d5ecb8ba4
Update fuzzy scorer from VSCode (#8793) 2021-04-05 12:15:09 -07:00
Josh McCarty
f43c420d59
Create number formatting options on the profile panel (#7925) 2021-03-28 18:32:48 +02:00
Donnie
6de8b4e35f
Quick Bar: Use command category labels instead of icons (#7692)
* Change commands to use category labels instead of icons. Fixes several translation issues.

* Hydrate with latest dev and resolve conflicts

* Replace custom pill element with material chips

* Add category icons. Fix dark mode text colors

* Update src/components/ha-chip-set.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Update src/dialogs/quick-bar/ha-quick-bar.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Update src/dialogs/quick-bar/ha-quick-bar.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Update src/components/ha-chip.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Update src/components/ha-chip.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2021-03-25 08:21:48 -07:00
Donnie
6f2a759ba3
Add scoring and sorting to sequence matcher (#7367)
* Replace sequence matcher with VS Code's score-based implementation

* Remove everything not related to fuzzyScore and matchSubstring

* Fix bug when filter length <= 3

* Add licensing and credit to Microsoft

* Remove unnecessary character codes

* Remove old sequence matcher, update tests, fix issue with not finding best score in list of words

* Remove unnecessary sequence precheck, refactor client api to remove array

* Fix issue with score sorting not implemented correctly and thus not actually sorting by score

* Update src/common/string/filter/sequence-matching.ts

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Remove unnecessary string return from fuzzy matcher. Clean up code

* Remove globals from filter. Move sorting logic into matcher

* Update function description, make score property optional.

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-10-20 09:01:16 -07:00
Donnie
63f60019d1
Add friendly name to quick bar list and filter (#7306)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-10-13 17:26:12 -05:00
Donnie
ddcf89e6a2
Add tests for fuzzy sequence matcher (#7328) 2020-10-13 11:50:36 +02:00