Skip to content

Forgive typos in native search, the Mac palette, and @ people - #340

Open
kentdebruin wants to merge 1 commit into
mainfrom
report-make-native-search-typo-tolerant
Open

kentdebruin wants to merge 1 commit into
mainfrom
report-make-native-search-typo-tolerant

Conversation

@kentdebruin

Copy link
Copy Markdown
Contributor

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.
  • Sidebar search (SidebarSearch.swift, used by SessionsListView): 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.
  • Mac command palette (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.
  • Composer @ people (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_QUERY debug hook so the palette can be screenshotted.
  • README note.

Before / after

Query Before After
relase (sidebar) nothing Release row
sandbxo (Mac palette) nothing "Add sandbox session actions" first
michel (@ people) nothing Michiel
cat vs "cut" nothing nothing (short terms stay strict)

Tests

FuzzyMatchTests, SidebarSearchTests, PeopleMentionRankingTests, plus four CommandPaletteTests cases: 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) and OS1Mac build on tella-mac-node; 54 tests pass (FuzzyMatch, SidebarSearch, PeopleMentionRanking, CommandPalette, ComposerMentionContext, SessionsListLens).
  • Screenshots were taken on the macOS target: the box was at load 300 to 550 while sibling sessions ran simulators, and the iOS simulator rendered a blank screen. The sidebar search view is the same SwiftUI code on both platforms.
  • bun run check passes.

Started by Kent de Bruin in this OS session

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]>
@open-session-os-tella-dev

open-session-os-tella-dev Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🤖 OS review · approve · quality 5/5 · risk low

Safe to merge.

🟢 Risk low · recovery in minutes
Changes are local, stateless Swift search and ranking behavior with tests; reverting restores results immediately.

Reviewed d23af3e · GPT-5.6 Sol · open session · labels: os-auto-fix fix and push · os-adversarial deeper pass · os-simplify cleanup

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
opensession Ready Ready Preview Sep 10, 2026 7:48am UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant