diff --git a/.claude/skills/web-test/scripts/dom.mjs b/.claude/skills/web-test/scripts/dom.mjs index c7ce3908..dfb34376 100644 --- a/.claude/skills/web-test/scripts/dom.mjs +++ b/.claude/skills/web-test/scripts/dom.mjs @@ -561,9 +561,11 @@ export function findClickTargetScript(formNum, text) { items.push({ id: el.id, name: el.dataset.content, label: '', kind: 'tab' }); }); - // Fuzzy match: exact name -> exact label -> includes name -> includes label + // Fuzzy match: exact name -> exact label -> startsWith name -> startsWith label -> includes name -> includes label let found = items.find(i => i.name.toLowerCase() === target); if (!found) found = items.find(i => i.label && i.label.toLowerCase() === target); + if (!found) found = items.find(i => i.name.toLowerCase().startsWith(target)); + if (!found) found = items.find(i => i.label && i.label.toLowerCase().startsWith(target)); if (!found) found = items.find(i => i.name.toLowerCase().includes(target)); if (!found) found = items.find(i => i.label && i.label.toLowerCase().includes(target));