fix(#283 review): gate remapped layout candidates to avoid short-query over-match
F1: only the ORIGINAL query does full matching; remapped (wrong-layout) candidates must be >= 3 chars and differ from the original before they can match (via a shared candidateMatchesItem helper, applied to both the filter and the tie-break sort). This stops a short remapped candidate from substring-matching the only cyrillic searchTerms (/cy->сн, /b->и no longer surface Footnote) while keeping real wrong-layout commands (/сщву->Code, /cyjcrf->Footnote) and genuine cyrillic terms (/сноска->Footnote) working. F2: fix the buildLayoutCandidates JSDoc (an ascii query yields multiple candidates, not a single-element set). F3: rename the test to menu-items.layout.test.ts + relative import, per sibling convention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Reference in New Issue
Block a user