diff --git a/src/common/string/filter/filter.ts b/src/common/string/filter/filter.ts index ff42c20393..fc99bc10b8 100644 --- a/src/common/string/filter/filter.ts +++ b/src/common/string/filter/filter.ts @@ -92,7 +92,7 @@ function isUpperCaseAtPos(pos: number, word: string, wordLow: string): boolean { return word[pos] !== wordLow[pos]; } -function isPatternInWord( +export function isPatternInWord( patternLow: string, patternPos: number, patternLen: number, @@ -121,7 +121,7 @@ enum Arrow { } /** - * An array representating a fuzzy match. + * An array representing a fuzzy match. * * 0. the score * 1. the offset at which matching started diff --git a/src/common/string/filter/sequence-matching.ts b/src/common/string/filter/sequence-matching.ts index 77edc39805..d502cec350 100644 --- a/src/common/string/filter/sequence-matching.ts +++ b/src/common/string/filter/sequence-matching.ts @@ -5,7 +5,7 @@ import { fuzzyScore } from "./filter"; * in that order, allowing for skipping. Ex: "chdr" exists in "chandelier") * * @param {string} filter - Sequence of letters to check for - * @param {string} word - Word to check for sequence + * @param {ScorableTextItem} item - Item against whose strings will be checked * * @return {number} Score representing how well the word matches the filter. Return of 0 means no match. */ diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index d860fa947b..ee2437bed6 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -11,6 +11,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; import { dump, load } from "js-yaml"; import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; +import { isPatternInWord } from "../../../common/string/filter/filter"; import { computeRTL } from "../../../common/util/compute_rtl"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/entity/ha-entity-picker"; @@ -91,6 +92,12 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { --mdc-icon-size: 20px; padding: 4px; cursor: pointer; + flex-shrink: 0; + margin-right: 8px; + } + .entities td:nth-child(1) { + min-width: 300px; + width: 30%; } .entities td:nth-child(3) { white-space: pre-wrap; @@ -101,6 +108,15 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { color: var(--primary-color); } + .entities .id-name-container { + display: flex; + flex-direction: column; + } + .entities .id-name-row { + display: flex; + align-items: center; + } + :host([narrow]) .state-wrapper { flex-direction: column; } @@ -219,19 +235,30 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {