The best way to control Claude Code, Codex and more from any computer or phone
fix(web): a pull request whose title holds a numeric search ranks above description-only matches (#33692)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Victor committed
Nov 14, 2026 at 10:49 UTC
69525bf89559284f4b2f8b787d41092c4fb03922
2 files changed
+18
-16
apps/web/src/components/pullRequest/pullRequestList.logic.test.ts
+17
-15
@@ -163,21 +163,23 @@ describe("ranking what a search found", () => {
163
const row = (overrides: Partial<PullRequestListEntry> & { number?: number }) =>
164
entry({ number: 1, ...overrides });
165
166
- it("puts the pull request whose title says it above one that merely mentions it", () => {
167
- const titled = row({
168
- number: 1,
169
- title: "Add the welcome wizard",
170
- updatedAt: "2026-07-01T00:00:00Z",
171
- });
172
- const mentioned = row({
173
- number: 2,
174
- title: "Unrelated work",
175
- updatedAt: "2026-08-01T00:00:00Z",
176
- });
177
- expect(
178
- rankPullRequestMatches([mentioned, titled], "welcome wizard").map((entry) => entry.number),
179
- ).toEqual([1, 2]);
180
- });
166
+ it.each([
167
+ ["welcome wizard", "Add the welcome wizard"],
168
+ ["24", "Upgrade Node to 24"],
169
+ ])(
170
+ "puts the pull request whose title says %j above one that merely mentions it",
171
+ (query, title) => {
172
+ const titled = row({ number: 1, title, updatedAt: "2026-07-01T00:00:00Z" });
173
+ const mentioned = row({
174
+ number: 2,
175
+ title: "Unrelated work",
176
+ updatedAt: "2026-08-01T00:00:00Z",
177
+ });
178
+ expect(
179
+ rankPullRequestMatches([mentioned, titled], query).map((entry) => entry.number),
180
+ ).toEqual([1, 2]);
181
+ },
182
+ );
183
184
it("keeps loaded partial-word matches the host's whole-word search missed, after its answer", () => {
185
const bilal = { login: "bilal", name: null, avatarUrl: null };
apps/web/src/components/pullRequest/pullRequestList.logic.ts
+1
-1
@@ -652,7 +652,7 @@ export function scorePullRequestMatch(entry: PullRequestListEntry, query: string
652
const needle = query.trim().toLowerCase();
653
if (needle.length === 0) return 0;
654
const number = needle.replace(/^#/u, "");
655
- if (/^\d+$/u.test(number)) return String(entry.number) === number ? 100 : 0;
655
+ if (String(entry.number) === number) return 100;
656
657
const title = entry.title.toLowerCase();
658
const terms = needle.split(/\s+/u).filter((term) => term.length > 0);