@devries-cameron20 / t3code-1 / commits / 167d41c094
Fork 0

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

fix(web): a numeric author or labels in the URL no longer crashes Pull Requests (#35376)

Julius Marminge committed Nov 12, 2026 at 09:19 UTC 167d41c09449d2e7554d663bae78646a4ff300fb
3 files changed +15 -9
apps/web/src/components/pullRequest/pullRequestListPreferences.ts
+2 -2
@@ -29,8 +29,8 @@ export interface PullRequestListPreferences {
29 readonly draft?: "only" | "hide";
30 readonly review?: NonNullable<PullRequestListFilters["review"]>;
31 readonly checks?: NonNullable<PullRequestListFilters["checks"]>;
32 - readonly author?: string;
33 - readonly labels?: ReadonlyArray<string>;
32 + readonly author?: string | undefined;
33 + readonly labels?: ReadonlyArray<string> | undefined;
34 readonly sort?: PullRequestListSort;
35 }
36
apps/web/src/components/pullRequest/pullRequestsRouteSearch.test.ts
+5
@@ -36,4 +36,9 @@ describe("pull requests route search", () => {
36 expect(matchedSearch("/pull-requests?q=fix")?.q).toBe("fix");
37 expect(matchedSearch("/pull-requests?q=%224089%22")?.q).toBe("4089");
38 });
39 +
40 + it("drops an author or labels the URL parser turned into a number", () => {
41 + expect(matchedSearch("/pull-requests?author=4089")?.author).toBeUndefined();
42 + expect(matchedSearch("/pull-requests?labels=4089")?.labels).toBeUndefined();
43 + });
44 });
apps/web/src/routes/_chat.pull-requests.tsx
+8 -7
@@ -8,7 +8,7 @@ import { PullRequestsPage } from "../components/pullRequest/PullRequestsPage";
8
9 const MAX_SEARCH_LABEL_CANDIDATES = 100;
10
11 -function pullRequestSearchLabels(raw: unknown): Partial<Pick<PullRequestsSearch, "labels">> {
11 +function pullRequestSearchLabels(raw: unknown): PullRequestsSearch["labels"] {
12 const values = (Array.isArray(raw) ? raw : typeof raw === "string" ? [raw] : []).slice(
13 0,
14 MAX_SEARCH_LABEL_CANDIDATES,
@@ -24,7 +24,7 @@ function pullRequestSearchLabels(raw: unknown): Partial<Pick<PullRequestsSearch,
24 seen.add(key);
25 if (labels.length === 10) break;
26 }
27 - return labels.length === 0 ? {} : { labels };
27 + return labels.length === 0 ? undefined : labels;
28 }
29
30 export const Route = createFileRoute("/_chat/pull-requests")({
@@ -59,7 +59,7 @@ export const Route = createFileRoute("/_chat/pull-requests")({
59 ...(typeof raw.selectedEnvironmentId === "string" && raw.selectedEnvironmentId
60 ? { selectedEnvironmentId: raw.selectedEnvironmentId as EnvironmentId }
61 : {}),
62 - // Always include q to override numeric values in the parent route's unvalidated search.
62 + // Always include free-text keys to override numeric values in the parent route's unvalidated search.
63 q: typeof raw.q === "string" && raw.q ? raw.q.slice(0, 200) : undefined,
64 ...(raw.draft === "only" || raw.draft === "hide" ? { draft: raw.draft } : {}),
65 ...(raw.review === "approved" ||
@@ -69,10 +69,11 @@ export const Route = createFileRoute("/_chat/pull-requests")({
69 ? { review: raw.review }
70 : {}),
71 ...(raw.checks === "passing" || raw.checks === "failing" ? { checks: raw.checks } : {}),
72 - ...(typeof raw.author === "string" && raw.author.trim()
73 - ? { author: raw.author.trim().slice(0, 200) }
74 - : {}),
75 - ...pullRequestSearchLabels(raw.labels),
72 + author:
73 + typeof raw.author === "string" && raw.author.trim()
74 + ? raw.author.trim().slice(0, 200)
75 + : undefined,
76 + labels: pullRequestSearchLabels(raw.labels),
77 }),
78 component: PullRequestsPage,
79 });