From 25b86a5783ad149f41229151ec44643a406f68ce Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Nov 2026 10:51:33 +0000 Subject: [PATCH 1/4] test(server): a host-narrowed issue list still names every tracker Repro for #38073: fails on main. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/issue/IssueService.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/server/src/issue/IssueService.test.ts b/apps/server/src/issue/IssueService.test.ts index 5a5d9753c36d8..f42a1aea6f563 100644 --- a/apps/server/src/issue/IssueService.test.ts +++ b/apps/server/src/issue/IssueService.test.ts @@ -424,6 +424,14 @@ describe("IssueService", () => { }), ]); + // Narrowing to one host still names every tracker, so the client can switch between them. + const narrowed = yield* service.list({ state: "open", host: "github.com" }); + expect(narrowed.entries.every((entry) => entry.host === "github.com")).toBe(true); + expect(narrowed.trackers.map((tracker) => tracker.host)).toEqual([ + "github.com", + "gitlab.com", + ]); + // A continuation only reads the scopes it names. listed.length = 0; const failed = yield* service.list({ From 76217a72eb93d171425743dad41c211047c072dd Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Nov 2026 10:55:28 +0000 Subject: [PATCH 2/4] fix(server): a host-narrowed issue list still names every tracker The tracker filter dropped other hosts' projects before trackers were built, so the Issues page's tracker menu lost every tracker but the chosen one. Narrow only the scopes that are read. Fixes pingdotgg/t3code#38073 Co-Authored-By: Claude Opus 5.5 --- apps/server/src/issue/IssueService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/server/src/issue/IssueService.ts b/apps/server/src/issue/IssueService.ts index 7da9674d1cdd4..2832ab04d15bb 100644 --- a/apps/server/src/issue/IssueService.ts +++ b/apps/server/src/issue/IssueService.ts @@ -312,12 +312,16 @@ const make = Effect.gen(function* () { ); const list: IssueService["Service"]["list"] = Effect.fn("IssueService.list")(function* (input) { - const { supported, unimplemented } = yield* listProjects(input); + // Trackers name every host so a client narrowed to one can switch to another; only the + // narrowed host's scopes are read. + const { supported, unimplemented } = yield* listProjects({ projectId: input.projectId }); + const host = input.host?.trim().toLowerCase(); const limit = input.limit ?? DEFAULT_LIST_LIMIT; // Worktrees of one repository are separate projects, and every repository of an Azure // DevOps project shares its work items; read each scope once. const scopes = new Map(); for (const project of supported) { + if (host !== undefined && project.host !== host) continue; const key = listCursorKey(project.host, project.scope); if (!scopes.has(key)) scopes.set(key, project); } From 5360e3b9d36db2577c72cd39188a8f7fbb332be9 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Nov 2026 11:02:47 +0000 Subject: [PATCH 3/4] fix(web): a tracker-filtered issue list shows only the chosen tracker The server now names every tracker so the menu can switch hosts. Render groups and offer label and people filters only for the chosen host, and build the menu from every group. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/issue/IssuesPage.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/issue/IssuesPage.tsx b/apps/web/src/components/issue/IssuesPage.tsx index c3c340ce40021..43133cd4d8b6c 100644 --- a/apps/web/src/components/issue/IssuesPage.tsx +++ b/apps/web/src/components/issue/IssuesPage.tsx @@ -220,10 +220,17 @@ export function IssuesPage() { // Rows grouped per tracker account, so a tracker that cannot be read says so where its rows // would be, and each tracker's rows carry on from their own cursors. - const groups = groupIssues(held, debouncedQuery, projects, search.order ?? "updated"); - const filterScopes = issueFilterScopes(held, projects); + const allGroups = groupIssues(held, debouncedQuery, projects, search.order ?? "updated"); + // The server names every tracker so the menu can switch hosts; only the chosen one was read. + const chosenHost = search.host?.toLowerCase(); + const groups = chosenHost + ? allGroups.filter((group) => group.tracker.host.toLowerCase() === chosenHost) + : allGroups; + const filterScopes = issueFilterScopes(held, projects).filter( + (scope) => !chosenHost || scope.input.host?.toLowerCase() === chosenHost, + ); - const hostOptions = hostOptionsFor(groups, search.host); + const hostOptions = hostOptionsFor(allGroups, search.host); const updateSearch = (patch: { [Key in keyof IssuesSearch]?: IssuesSearch[Key] | undefined }) => { const merged = { ...search, ...patch }; From 69b3f4be983e2699578afcbb30ef9e39b84106d7 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 17 Nov 2026 11:10:26 +0000 Subject: [PATCH 4/4] fix(web): a tracker-filtered issue list groups only the chosen tracker Narrow each answer's trackers to the chosen host before grouping, so groups, error attribution and filter scopes see what the server read, and build the tracker menu from every tracker. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/issue/IssuesPage.tsx | 43 +++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/issue/IssuesPage.tsx b/apps/web/src/components/issue/IssuesPage.tsx index 43133cd4d8b6c..94a1d4e905f91 100644 --- a/apps/web/src/components/issue/IssuesPage.tsx +++ b/apps/web/src/components/issue/IssuesPage.tsx @@ -137,9 +137,16 @@ function getShortcutContext() { }; } -function hostOptionsFor(groups: ReturnType, chosen: string | undefined) { +function hostOptionsFor(trackers: ReadonlyArray, chosen: string | undefined) { const hosts = new Map(); - for (const group of groups) hosts.set(group.tracker.host, group.tracker); + const ordered = [...trackers].sort((a, b) => + issueTrackerKey(a).localeCompare(issueTrackerKey(b)), + ); + for (const tracker of ordered) { + const existing = hosts.get(tracker.host); + if (existing === undefined || (!existing.configured && tracker.configured)) + hosts.set(tracker.host, tracker); + } return [ { value: "", label: "All", Icon: Plug2Icon }, // A remembered host no project is on any more stays listed, so the filter can be taken off. @@ -220,17 +227,31 @@ export function IssuesPage() { // Rows grouped per tracker account, so a tracker that cannot be read says so where its rows // would be, and each tracker's rows carry on from their own cursors. - const allGroups = groupIssues(held, debouncedQuery, projects, search.order ?? "updated"); - // The server names every tracker so the menu can switch hosts; only the chosen one was read. + // The server names every tracker so the menu can switch hosts, but reads only the chosen one. const chosenHost = search.host?.toLowerCase(); - const groups = chosenHost - ? allGroups.filter((group) => group.tracker.host.toLowerCase() === chosenHost) - : allGroups; - const filterScopes = issueFilterScopes(held, projects).filter( - (scope) => !chosenHost || scope.input.host?.toLowerCase() === chosenHost, - ); + const shown = chosenHost + ? new Map( + [...held].map(([environmentId, page]) => [ + environmentId, + { + ...page, + answer: { + ...page.answer, + trackers: page.answer.trackers.filter( + (tracker) => tracker.host.toLowerCase() === chosenHost, + ), + }, + }, + ]), + ) + : held; + const groups = groupIssues(shown, debouncedQuery, projects, search.order ?? "updated"); + const filterScopes = issueFilterScopes(shown, projects); - const hostOptions = hostOptionsFor(allGroups, search.host); + const hostOptions = hostOptionsFor( + [...held.values()].flatMap((page) => page.answer.trackers), + search.host, + ); const updateSearch = (patch: { [Key in keyof IssuesSearch]?: IssuesSearch[Key] | undefined }) => { const merged = { ...search, ...patch };