@devries-cameron20 / t3code-1 / commits / 27188274e7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): pull request search keeps partial-word matches after GitHub answers (#26992)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 11, 2026 at 04:21 UTC 27188274e7513babfa5ee1112a5d3032ff299584
3 files changed +61 -6
apps/web/src/components/pullRequest/PullRequestsPage.tsx
+2
@@ -712,6 +712,8 @@ export function PullRequestsPage() {
712 heldPullRequestsBySurface,
713 } = pullRequestGroups({
714 known: ordered?.key === filterKey ? ordered.entries : (listData?.entries ?? []),
715 + // The baseline was read without typed qualifiers, and rows cannot be checked for `checks:`.
716 + baseline: typedParsed.filters.checks === undefined ? baselineQuery.data?.entries : undefined,
717 providers: baselineQuery.data?.providers ?? listData?.providers ?? [],
718 viewers,
719 involvement: search.involvement,
apps/web/src/components/pullRequest/pullRequestList.logic.test.ts
+38
@@ -38,6 +38,7 @@ import {
38 reusePullRequestEntries,
39 settlePullRequestOverrides,
40 } from "./pullRequestList.logic";
41 +import { pullRequestGroups } from "./pullRequestListGroups.logic";
42 import {
43 readPullRequestListPreferences,
44 writePullRequestListPreferences,
@@ -177,6 +178,43 @@ describe("ranking what a search found", () => {
178 rankPullRequestMatches([mentioned, titled], "welcome wizard").map((entry) => entry.number),
179 ).toEqual([1, 2]);
180 });
181 +
182 + it("keeps loaded partial-word matches the host's whole-word search missed, after its answer", () => {
183 + const bilal = { login: "bilal", name: null, avatarUrl: null };
184 + const hosted = row({ number: 1, title: "Notifications match the body text", author: bilal });
185 + const toast = row({ number: 2, title: "Threads show a completed toast", author: bilal });
186 + const toaster = row({ number: 3, title: "Toaster fixtures cover retries", author: bilal });
187 + const theirs = row({ number: 4, title: "Toasted sidebar" });
188 + const unrelated = row({ number: 5, title: "Cursor no longer adds attribution", author: bilal });
189 +
190 + const { entries } = pullRequestGroups({
191 + known: [hosted, toast],
192 + baseline: [theirs, unrelated, toaster, toast],
193 + providers: [
194 + {
195 + host: "github.com",
196 + kind: SourceControlProviderKind.make("github"),
197 + searchesOnHost: true,
198 + projectCount: 1,
199 + configured: true,
200 + detail: null,
201 + },
202 + ],
203 + viewers: VIEWERS,
204 + involvement: "all",
205 + localFilters: { author: "bilal" },
206 + hasLocalFilters: true,
207 + text: "toa",
208 + answeredLocally: true,
209 + baselineEmpty: false,
210 + held: undefined,
211 + authored: undefined,
212 + reviewing: undefined,
213 + partitionsWanted: false,
214 + });
215 +
216 + expect(entries.map((entry) => entry.number)).toEqual([1, 2, 3]);
217 + });
218 });
219
220 describe("default merge-readiness ranking", () => {
apps/web/src/components/pullRequest/pullRequestListGroups.logic.ts
+21 -6
@@ -15,6 +15,7 @@ import {
15 partitionPullRequestsWithPriority,
16 pullRequestEntryKey,
17 pullRequestEntryViewer,
18 + rankPullRequestMatches,
19 type EnvironmentPullRequestEntry,
20 type PullRequestPartitionsSnapshot,
21 } from "./pullRequestList.logic";
@@ -25,6 +26,7 @@ export const pullRequestListEntryId = (target: Parameters<typeof pullRequestSurf
26 /** The held rows narrowed to what the reader asked for, in the groups the list shows. */
27 export function pullRequestGroups({
28 known,
29 + baseline,
30 providers,
31 viewers,
32 involvement,
@@ -39,6 +41,8 @@ export function pullRequestGroups({
41 partitionsWanted,
42 }: {
43 known: ReadonlyArray<EnvironmentPullRequestEntry>;
44 + /** The text-free rows already loaded, or undefined when the typed filters cannot vet them. */
45 + baseline: ReadonlyArray<EnvironmentPullRequestEntry> | undefined;
46 providers: PullRequestListResult["providers"];
47 viewers: PullRequestListResult["viewers"];
48 involvement: PullRequestInvolvement;
@@ -56,22 +60,33 @@ export function pullRequestGroups({
60 providers.flatMap((provider) => (provider.searchesOnHost ? [provider.host] : [])),
61 );
62
59 - const entries = (() => {
60 - const involvementEntries = filterPullRequestsByInvolvement(known, viewers, involvement);
61 - // Host text searches cover fields absent from rows, so do not narrow their matches locally.
62 - // Filter text locally while results are pending or when the host has no text search.
63 - const narrowedEntries = hasLocalFilters
63 + const narrowRows = (rows: ReadonlyArray<EnvironmentPullRequestEntry>) => {
64 + const involvementEntries = filterPullRequestsByInvolvement(rows, viewers, involvement);
65 + return hasLocalFilters
66 ? involvementEntries.filter((entry) =>
67 matchesPullRequestFilters(entry, localFilters, pullRequestEntryViewer(entry, viewers)),
68 )
69 : involvementEntries;
70 + };
71 +
72 + const entries = (() => {
73 + const narrowedEntries = narrowRows(known);
74 if (text.length === 0) {
75 return narrowedEntries.toSorted(comparePullRequestsByRecency);
76 }
71 - return narrowedEntries.filter(
77 + // Host text searches cover fields absent from rows, so do not narrow their matches locally.
78 + // Filter text locally while results are pending or when the host has no text search.
79 + const matched = narrowedEntries.filter(
80 (entry) =>
81 (answeredLocally && searchingHosts.has(entry.host)) || matchesPullRequestQuery(entry, text),
82 );
83 + // Host search matches whole words, so it can miss loaded rows a partial word matches here.
84 + // Those follow the host's ranked answer rather than reshuffling it.
85 + const listed = new Set(matched.map(pullRequestEntryKey));
86 + const missed = narrowRows(baseline ?? []).filter(
87 + (entry) => !listed.has(pullRequestEntryKey(entry)) && matchesPullRequestQuery(entry, text),
88 + );
89 + return missed.length === 0 ? matched : [...matched, ...rankPullRequestMatches(missed, text)];
90 })();
91
92 const listedPullRequestTabStatuses: Record<string, PullRequestTabStatusSeed> = Object.fromEntries(