Skip to content

fix(shared): palette search finds a name by the end of its number - #38923

Open
josephv123 wants to merge 3 commits into
pingdotgg:mainfrom
josephv123:fix/palette-number-suffix
Open

josephv123 wants to merge 3 commits into
pingdotgg:mainfrom
josephv123:fix/palette-number-suffix

Conversation

@josephv123

Copy link
Copy Markdown
Contributor

Problem

Typing 120 in the command palette finds nothing when a project is named 33120. Search matches at word starts, 33120 is 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:

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 on main (expected undefined to be 0.3) and pass with the fix; 34/34 pass.
  • vp test run apps/web/src/components/CommandPalette.logic.test.ts plus 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.
  • Manual check in vp run dev (web) with a project named 33120, typing 120 in the palette (project path blanked out in the after shot):
Before After
No matching commands, projects, or threads 33120 project and New thread in 33120 listed

Done with Claude Opus 5.5 in Claude Code, run from T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 19, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Palette search now matches qualifying numeric suffixes in primary fields, even when mid-word matching is disabled. Tests cover matches against plain text and thread titles, along with rejected partial-number and pull-request-number matches.

Changes: Numeric suffix search

Layer / File(s) Summary
Numeric suffix matching
packages/shared/src/paletteSearch.ts, packages/shared/src/paletteSearch.test.ts
matchToken accepts numeric tokens of at least three characters when they end a digit run in a primary field. Tests verify that 120 matches 33120 in plain text and thread titles at quality 0.3, while partial-number matches and a pull-request-number match return no result.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#32242: Changes the shared palette ranker’s ordering for title matches and adds a three-character threshold.

Suggested reviewers: juliusmarminge, t3dotgg, macroscopeapp

Merge Risk: Minimal · up to b70c9

Palette and sidebar search will now find a project, thread, or command by the trailing digits of a number in its name, such as 120 for 33120. The change is narrow and tested, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: palette search now finds a name by the end of its number. It follows the conventional commit form and matches the fix in matchToken. It is specific and does not use va…
Description check Passed The description follows the template. It has Problem, Change, Scope and Verification sections. It explains the bug with reproduction steps, links issue #38922, and lists focused tests, a check run, an…
Linked Issues check Passed [#38922] requires that the query 120 finds a project named 33120, and that the shared scorer covers the mobile palette and sidebar search. The whole-PR diff adds endsNumber in `packages/shared/s…
Out of Scope Changes check Passed The whole-PR diff changes two files. packages/shared/src/paletteSearch.ts adds the NUMBER constant and the endsNumber helper, changes the matchToken condition to include the number-ending case…
Full details: Title check

Explanation

The title names the main change: palette search now finds a name by the end of its number. It follows the conventional commit form and matches the fix in matchToken. It is specific and does not use vague terms.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope and Verification sections. It explains the bug with reproduction steps, links issue #38922, and lists focused tests, a check run, and a manual before/after check with images. The template asks for a model and harness note, and the author gives one (Claude Opus 5.5 in Claude Code). The description is complete.

Full details: Linked Issues check

Explanation

[#38922] requires that the query 120 finds a project named 33120, and that the shared scorer covers the mobile palette and sidebar search. The whole-PR diff adds endsNumber in packages/shared/src/paletteSearch.ts. The helper accepts a token of three or more characters, all Unicode digits (NUMBER), preceded by a digit, and not followed by a digit. matchToken applies it only when isPrimary is true, and it assigns MID_WORD (0.3). For 33120 and 120, all checks pass. The test diff asserts 120 matches 33120 (0.3) for command/project search and thread titles, 312 and 20 return null, and 189 returns null against PR 22189. The PR-number exclusion rests on the isPrimary gating and the test assertion. I did not inspect the PR-item call sites directly. This uncertainty does not change the result, because the test asserts the behavior. The change is in the shared scorer, so the mobile and sidebar paths use the same rule. The change since the previous review does not alter these conclusions. No non-coding requirements apply.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes two files. packages/shared/src/paletteSearch.ts adds the NUMBER constant and the endsNumber helper, changes the matchToken condition to include the number-ending case for primary fields only, and updates the doc comment to mention it. packages/shared/src/paletteSearch.test.ts adds assertions for the number-ending behavior, including the negative cases for 312, 20, and the PR number 22189. Every change supports the #38922 objective. The existing mid-word rule for other fields and the typo rules are unchanged. The raw summary reports no changed exported declarations, and the diff confirms this.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 89eaabe and b70c941.

Files selected for processing: 1

  • packages/shared/src/paletteSearch.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

juliusmarminge and others added 2 commits November 19, 2026 04:50
…ffix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added takeover:needs-julius Takeover done; route gate says Julius decides and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026

This branch has not been deployed

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

Labels

size:S 10-29 changed lines (additions + deletions). takeover:needs-julius Takeover done; route gate says Julius decides vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Command palette can't find a project by the end of its number ("120" misses "33120")

2 participants