Repository navigation
fix(shared): palette search finds a name by the end of its number - #38923
josephv123 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…ffix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Typing
120in the command palette finds nothing when a project is named33120. Search matches at word starts,33120is one word, and only thread titles allow a match inside a word (for four or more characters). People often remember just the last digits of a number with a prefix, such as a course or ticket number.Fixes #38922
Change
In
matchToken(packages/shared/src/paletteSearch.ts), a query of three or more digits may also match the end of a longer number in a name: the first field of an item (a project, thread title or command name). It scores as an ordinary mid-word hit, so word-start matches still rank above it.It stays narrow on purpose:
312does not find33120;20does not find33120;189does not find PR feat(web): show how much of a PR is code vs tests, mocks, and generated files #22189.The scorer is shared, so the web and mobile palettes and sidebar search get the same behavior.
Scope
Bug fix for #38922.
Verification
vp test run packages/shared/src/paletteSearch.test.ts: the new assertions in "matches inside a word only in thread titles" fail onmain(expected undefined to be 0.3) and pass with the fix; 34/34 pass.vp test run apps/web/src/components/CommandPalette.logic.test.tsplus the mobile keyboard palette, client-runtime thread search and mobile thread list tests: 119/119 pass.vp run check:changed: format, lint, knip, typecheck (36 packages) and tests all pass.vp run dev(web) with a project named33120, typing120in the palette (project path blanked out in the after shot):Done with Claude Opus 5.5 in Claude Code, run from T3 Code.