Skip to content

Commit 0c43aa2

Browse files
shivamhwpclaude
andcommitted
fix(search): filler words don't count as short query words
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e650554 commit 0c43aa2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ describe("scoreThreadSearch", () => {
5555
thread("Polish UIs", { activityAt: NOW, opens: { openedAt: NOW, score: 12, picks: [] } }),
5656
]),
5757
).toEqual(["Polish UIs", "Parse ui tokens"]);
58+
expect(
59+
rankTitles("fix in sidebar", [
60+
thread("Fix sidebar", { activityAt: NOW - 200 * DAY }),
61+
thread("Fix crash in sidebar", {
62+
activityAt: NOW,
63+
opens: { openedAt: NOW, score: 12, picks: [] },
64+
}),
65+
]),
66+
).toEqual(["Fix crash in sidebar", "Fix sidebar"]);
5867
});
5968

6069
it("treats camelCase, kebab, path, and digit boundaries as word starts", () => {

‎packages/shared/src/paletteSearch.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ function matchSearchFields(
439439
if (bestPrimary) primaryRanges.push(...(bestPrimary.letters ?? [bestPrimary]));
440440
total += best;
441441
counted += 1;
442-
shortToken ||= token.length < PICK_PREFIX_MIN_LENGTH;
442+
shortToken ||=
443+
token.length < PICK_PREFIX_MIN_LENGTH && !(fillerOptional && FILLER_WORDS.has(token));
443444
}
444445
let quality = total / counted;
445446
if (primary) {

0 commit comments

Comments
 (0)