Forgive typos in native search, the Mac palette, and @ people - #340
Open
kentdebruin wants to merge 1 commit into
Open
kentdebruin wants to merge 1 commit into
kentdebruin wants to merge 1 commit into
Conversation
Port the web's fuzzy matcher (shared/fuzzy-match.ts, 5b51f4d) to the Swift client as one Foundation-only FuzzyMatch: exact, prefix, word prefix and substring rank first, then a bounded edit distance with transpositions and in-word abbreviations, so "relase" still finds Release. Short terms stay strict. Sidebar search (live rows and the archived results under them) now matches a session's title, repo, branch and workspace name through it; ids still match only as written. The Mac command palette keeps its placement ranking and its transcript-hit fallback, with a near miss ranked under every exact placement. The composer's local @ people list forgives a typo and ranks closer names first, you still on top. Adds an OS1_COMMAND_PALETTE_QUERY debug hook for palette screenshots. Co-authored-by: Kent de Bruin <[email protected]>
Contributor
🤖 OS review · approve · quality 5/5 · risk lowSafe to merge. 🟢 Risk low · recovery in minutes Reviewed |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the web's typo-tolerant search (
shared/fuzzy-match.ts, 5b51f4d) to the native Swift client.What changed
OS1/Models/FuzzyMatch.swift(new, Foundation-only): one matcher with the web's rules. Exact, prefix, word prefix and substring rank first; then a bounded edit distance per term (0 edits under 4 letters, 1 up to 7, 2 beyond; a transposition is one edit) and in-word abbreviations (wksp→ workspace). Case and accents are folded; an empty query matches everything.SidebarSearch.swift, used bySessionsListView): a session matches on title, repo, branch and now its workspace name; the id still matches only as written. Transcript-hit fallback, snippets and limits are unchanged.CommandPalette.swift): placement ranking kept (title start > word in title > inside title > subtitle/keyword); a near miss ranks under every exact placement and still above a transcript-only hit.ComposerMentionPalette.swift,PeopleMentionRanking): a typo in a name or full name still finds the person; you stay first, then the closest match.OS1_COMMAND_PALETTE_QUERYdebug hook so the palette can be screenshotted.Before / after
relase(sidebar)sandbxo(Mac palette)michel(@ people)catvs "cut"Tests
FuzzyMatchTests,SidebarSearchTests,PeopleMentionRankingTests, plus fourCommandPaletteTestscases:relase→ Release, transpositions (wrokspace,archvied), abbreviations (wksp,tmln), short-term false positives (cat/cut,api/apple), workspace-name matching, and exact-beats-near-miss ordering.Verification
OS1(iOS Simulator) andOS1Macbuild on tella-mac-node; 54 tests pass (FuzzyMatch,SidebarSearch,PeopleMentionRanking,CommandPalette,ComposerMentionContext,SessionsListLens).bun run checkpasses.Started by Kent de Bruin in this OS session