src/switcher/SearchSpecs.md
Line coverage:
SearchTestable.swift98% · refreshed 2026-05-27 by/coverage-explore
When the user types in the switcher's search box, SearchTestable scores each window so the best match
floats to the top. It's a 6-tier matcher (best tier wins; ties broken by score), scoring a query
against both the app name and the window title and keeping the higher (app name weighted slightly
above title). It also produces highlight spans so the UI can bold the matched characters.
The tiers, best to worst:
This suite is large and example-driven — it pins tier ordering, scoring relativities, Unicode handling, and several regressions from real user screenshots — because the ranking is easy to subtly break.
_, ., /, :, emoji, and digit/letter transitions all
start new words for prefix/acronym matching.Mirrors SearchTests.swift 1:1.
The renderer consumes SWResult; MatchResult.toSWResult() converts the kernel's output, deriving similarity = score/1200 and dropping the unused ops field.