diff --git a/web/scripts/audit-cdp.mjs b/web/scripts/audit-cdp.mjs index 51ac56d..541deac 100644 --- a/web/scripts/audit-cdp.mjs +++ b/web/scripts/audit-cdp.mjs @@ -639,6 +639,15 @@ const sig = (n) => const sameNode = (x, y) => { if (x.tag !== y.tag) return false; if (x.tag === "svg") return true; // icons: design vs library classes differ + // Leaf controls (buttons/links/labels) are identified by their text label: + // the ref and the app may name the same control with different classes + // (e.g. "selected" vs "segment selected"), so a class-list match alone + // mis-pairs them (and a classless ref button would otherwise match any + // sibling). Matching by label keeps the pairings stable. + if ( + (x.tag === "button" || x.tag === "a" || x.tag === "label") && x.text && y.text + ) + return x.text === y.text; const cx = [...x.classes].sort().join(" "); const cy = [...y.classes].sort().join(" "); return cx === cy || !x.classes.length || !y.classes.length; diff --git a/web/src/lib/components/kit/ColorField.svelte b/web/src/lib/components/kit/ColorField.svelte index a71a28f..28cedb6 100644 --- a/web/src/lib/components/kit/ColorField.svelte +++ b/web/src/lib/components/kit/ColorField.svelte @@ -8,7 +8,13 @@ chevron?: boolean; oninput?: (value: string) => void; } - let { label, value = $bindable(), dark = false, chevron = false, oninput }: Props = $props(); + let { + label, + value = $bindable(), + dark = false, + chevron = false, + oninput, + }: Props = $props(); function handle(e: Event) { value = (e.target as HTMLInputElement).value; @@ -20,51 +26,52 @@