The best way to control Claude Code, Codex and more from any computer or phone
fix(server): a host-narrowed issue list still names every tracker (#38085)
Julius Marminge committed
Nov 17, 2026 at 03:40 UTC
218c18bc028903bf5c6d17be60ede3cbc5fb6305
3 files changed
+46
-6
apps/server/src/issue/IssueService.test.ts
+8
@@ -424,6 +424,14 @@ describe("IssueService", () => {
424
}),
425
]);
426
427
+ // Narrowing to one host still names every tracker, so the client can switch between them.
428
+ const narrowed = yield* service.list({ state: "open", host: "github.com" });
429
+ expect(narrowed.entries.every((entry) => entry.host === "github.com")).toBe(true);
430
+ expect(narrowed.trackers.map((tracker) => tracker.host)).toEqual([
431
+ "github.com",
432
+ "gitlab.com",
433
+ ]);
434
+
435
// A continuation only reads the scopes it names.
436
listed.length = 0;
437
const failed = yield* service.list({
apps/server/src/issue/IssueService.ts
+5
-1
@@ -312,12 +312,16 @@ const make = Effect.gen(function* () {
312
);
313
314
const list: IssueService["Service"]["list"] = Effect.fn("IssueService.list")(function* (input) {
315
- const { supported, unimplemented } = yield* listProjects(input);
315
+ // Trackers name every host so a client narrowed to one can switch to another; only the
316
+ // narrowed host's scopes are read.
317
+ const { supported, unimplemented } = yield* listProjects({ projectId: input.projectId });
318
+ const host = input.host?.trim().toLowerCase();
319
const limit = input.limit ?? DEFAULT_LIST_LIMIT;
320
// Worktrees of one repository are separate projects, and every repository of an Azure
321
// DevOps project shares its work items; read each scope once.
322
const scopes = new Map<string, SupportedProject>();
323
for (const project of supported) {
324
+ if (host !== undefined && project.host !== host) continue;
325
const key = listCursorKey(project.host, project.scope);
326
if (!scopes.has(key)) scopes.set(key, project);
327
}
apps/web/src/components/issue/IssuesPage.tsx
+33
-5
@@ -137,9 +137,16 @@ function getShortcutContext() {
137
};
138
}
139
140
-function hostOptionsFor(groups: ReturnType<typeof groupIssues>, chosen: string | undefined) {
140
+function hostOptionsFor(trackers: ReadonlyArray<IssueTrackerSummary>, chosen: string | undefined) {
141
const hosts = new Map<string, IssueTrackerSummary>();
142
- for (const group of groups) hosts.set(group.tracker.host, group.tracker);
142
+ const ordered = [...trackers].sort((a, b) =>
143
+ issueTrackerKey(a).localeCompare(issueTrackerKey(b)),
144
+ );
145
+ for (const tracker of ordered) {
146
+ const existing = hosts.get(tracker.host);
147
+ if (existing === undefined || (!existing.configured && tracker.configured))
148
+ hosts.set(tracker.host, tracker);
149
+ }
150
return [
151
{ value: "", label: "All", Icon: Plug2Icon },
152
// A remembered host no project is on any more stays listed, so the filter can be taken off.
@@ -220,10 +227,31 @@ export function IssuesPage() {
227
228
// Rows grouped per tracker account, so a tracker that cannot be read says so where its rows
229
// would be, and each tracker's rows carry on from their own cursors.
223
- const groups = groupIssues(held, debouncedQuery, projects, search.order ?? "updated");
224
- const filterScopes = issueFilterScopes(held, projects);
230
+ // The server names every tracker so the menu can switch hosts, but reads only the chosen one.
231
+ const chosenHost = search.host?.toLowerCase();
232
+ const shown = chosenHost
233
+ ? new Map(
234
+ [...held].map(([environmentId, page]) => [
235
+ environmentId,
236
+ {
237
+ ...page,
238
+ answer: {
239
+ ...page.answer,
240
+ trackers: page.answer.trackers.filter(
241
+ (tracker) => tracker.host.toLowerCase() === chosenHost,
242
+ ),
243
+ },
244
+ },
245
+ ]),
246
+ )
247
+ : held;
248
+ const groups = groupIssues(shown, debouncedQuery, projects, search.order ?? "updated");
249
+ const filterScopes = issueFilterScopes(shown, projects);
250
226
- const hostOptions = hostOptionsFor(groups, search.host);
251
+ const hostOptions = hostOptionsFor(
252
+ [...held.values()].flatMap((page) => page.answer.trackers),
253
+ search.host,
254
+ );
255
256
const updateSearch = (patch: { [Key in keyof IssuesSearch]?: IssuesSearch[Key] | undefined }) => {
257
const merged = { ...search, ...patch };