The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
feat(web): choose which projects the issues list shows (#38799)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bilal Bakr committed
Nov 20, 2026 at 03:48 UTC
9fde959ac0542e835a2cdafd417125bbdbe4ad07
23 files changed
+376
-159
apps/server/src/issue/IssueService.test.ts
+3
@@ -613,6 +613,9 @@ describe("IssueService with a standalone tracker", () => {
613
["web", "ENG"],
614
["web", "acme/web"],
615
]);
616
+ listed.length = 0;
617
+ yield* bound.list({ state: "open", excludeProjectIds: ["web" as ProjectId] });
618
+ expect(listed).toEqual(["github github.com acme/api"]);
619
// A reference picks the project's tracker by kind; both are the project's own, so writable.
620
const linearRef = {
621
projectId: "web" as ProjectId,
apps/server/src/issue/IssueService.ts
+9
-2
@@ -219,6 +219,7 @@ const make = Effect.gen(function* () {
219
220
const listProjects = (filter: {
221
readonly projectId?: IssueListInput["projectId"];
222
+ readonly excludeProjectIds?: IssueListInput["excludeProjectIds"];
223
readonly host?: string | undefined;
224
/** The link's `host:port`, for a host whose binding keeps its port. */
225
readonly authority?: string | undefined;
@@ -236,7 +237,10 @@ const make = Effect.gen(function* () {
237
}),
238
),
239
Effect.flatMap(
239
- Effect.fnUntraced(function* (shells) {
240
+ Effect.fnUntraced(function* (allShells) {
241
+ const shells = allShells.filter(
242
+ (project) => !filter.excludeProjectIds?.includes(project.id),
243
+ );
244
if (shells.length === 0) return [];
245
// One read per listing, not per project, and never cached so Settings changes apply.
246
const bound = yield* bindings.list.pipe(
@@ -322,7 +326,10 @@ const make = Effect.gen(function* () {
326
const list: IssueService["Service"]["list"] = Effect.fn("IssueService.list")(function* (input) {
327
// Trackers name every host so a client narrowed to one can switch to another; only the
328
// narrowed host's scopes are read.
325
- const { supported, unimplemented } = yield* listProjects({ projectId: input.projectId });
329
+ const { supported, unimplemented } = yield* listProjects({
330
+ projectId: input.projectId,
331
+ excludeProjectIds: input.excludeProjectIds,
332
+ });
333
const host = input.host?.trim().toLowerCase();
334
const limit = input.limit ?? DEFAULT_LIST_LIMIT;
335
// Worktrees of one repository are separate projects, and every repository of an Azure
apps/web/src/components/issue/IssueListFilterPickers.tsx
+85
-39
@@ -26,7 +26,7 @@ import {
26
} from "~/components/ui/menu";
27
import { useIssueFilterCandidates } from "~/state/issues";
28
29
-import type { ProjectFaviconProject } from "../ProjectFavicon";
29
+import { ProjectFavicon, type ProjectFaviconProject } from "../ProjectFavicon";
30
31
import {
32
PullRequestFilterRadioSubmenu,
@@ -36,7 +36,6 @@ import {
36
import { pullRequestLabelColor } from "../pullRequest/pullRequestList.logic";
37
38
const VISIBLE_CHOICES = 30;
39
-const ALL_PROJECTS = "all";
39
const matches = (needle: string, ...fields: ReadonlyArray<string | null | undefined>) =>
40
needle.length === 0 || fields.some((field) => field?.toLowerCase().includes(needle));
41
@@ -54,38 +53,18 @@ export function IssueFiltersMenu(props: {
53
assignee: string | undefined;
54
onAssignee: (assignee: string | undefined) => void;
55
projects: ReadonlyArray<ProjectFaviconProject & { readonly id: ProjectId }>;
57
- project: { environmentId: EnvironmentId; projectId: ProjectId } | undefined;
58
- onProject: (project: { environmentId: EnvironmentId; projectId: ProjectId } | undefined) => void;
56
+ hiddenProjects: ReadonlySet<string>;
57
+ onHiddenProjects: (hidden: ReadonlyArray<readonly [EnvironmentId, ProjectId]>) => void;
58
}) {
59
const gt = useGT();
60
const [open, setOpen] = useState(false);
61
const count = [
62
props.state !== "open",
63
props.involvement !== "all",
65
- props.project,
64
+ props.hiddenProjects.size > 0,
65
props.assignee,
66
...props.labels,
67
].filter(Boolean).length;
69
- const projectValue = props.project
70
- ? pullRequestProjectKey({
71
- id: props.project.projectId,
72
- environmentId: props.project.environmentId,
73
- })
74
- : ALL_PROJECTS;
75
- const projectOptions: ReadonlyArray<PullRequestFilterOption<string>> = [
76
- { value: ALL_PROJECTS, label: gt("All projects"), Icon: LayersIcon },
77
- // A remembered project this client does not list stays shown, so the filter can be taken off.
78
- ...(projectValue !== ALL_PROJECTS &&
79
- !props.projects.some((project) => pullRequestProjectKey(project) === projectValue)
80
- ? [{ value: projectValue, label: gt("Unavailable project"), Icon: FolderGit2Icon }]
81
- : []),
82
- ...props.projects.map((project) => ({
83
- value: pullRequestProjectKey(project),
84
- label: project.title,
85
- Icon: FolderGit2Icon,
86
- project,
87
- })),
88
- ];
68
// Read when the menu opens, not with every listing: one request per scope.
69
const scopes = open ? props.scopes : [];
70
return (
@@ -114,20 +93,25 @@ export function IssueFiltersMenu(props: {
93
options={props.involvementOptions}
94
onChange={props.onInvolvement}
95
/>
117
- {props.projects.length > 1 || props.project ? (
118
- <PullRequestFilterRadioSubmenu
119
- label={gt("Project")}
120
- value={projectValue}
121
- options={projectOptions}
122
- onChange={(next) => {
123
- const project = props.projects.find((p) => pullRequestProjectKey(p) === next);
124
- props.onProject(
125
- project
126
- ? { environmentId: project.environmentId, projectId: project.id }
127
- : undefined,
128
- );
129
- }}
130
- />
96
+ {props.projects.length > 0 || props.hiddenProjects.size > 0 ? (
97
+ <MenuSub>
98
+ <MenuSubTrigger>
99
+ <FolderGit2Icon aria-hidden className="size-3.5" />
100
+ <span className="flex-1">{gt("Projects")}</span>
101
+ <span className="min-w-0 max-w-32 truncate text-xs text-muted-foreground">
102
+ {props.hiddenProjects.size === 0
103
+ ? gt("All projects")
104
+ : gt("{hidden} hidden", { hidden: props.hiddenProjects.size })}
105
+ </span>
106
+ </MenuSubTrigger>
107
+ <MenuSubPopup>
108
+ <ProjectChoices
109
+ projects={props.projects}
110
+ hidden={props.hiddenProjects}
111
+ onChange={props.onHiddenProjects}
112
+ />
113
+ </MenuSubPopup>
114
+ </MenuSub>
115
) : null}
116
<MenuSeparator />
117
<MenuSub>
@@ -169,6 +153,68 @@ export function IssueFiltersMenu(props: {
153
);
154
}
155
156
+function ProjectChoices(props: {
157
+ projects: ReadonlyArray<ProjectFaviconProject & { readonly id: ProjectId }>;
158
+ hidden: ReadonlySet<string>;
159
+ onChange: (hidden: ReadonlyArray<readonly [EnvironmentId, ProjectId]>) => void;
160
+}) {
161
+ const gt = useGT();
162
+ const [query, setQuery] = useState("");
163
+ const needle = query.trim().toLowerCase();
164
+ const visible = props.projects.filter((project) => matches(needle, project.title));
165
+ const pairsOf = (keys: Iterable<string>) =>
166
+ [...keys].map((key) => JSON.parse(key) as readonly [EnvironmentId, ProjectId]);
167
+ const allShown = props.hidden.size === 0;
168
+ return (
169
+ <>
170
+ {props.projects.length > 8 ? (
171
+ <MenuSearchInput
172
+ autoFocus
173
+ value={query}
174
+ onChange={(event) => setQuery(event.currentTarget.value)}
175
+ placeholder={gt("Search projects")}
176
+ aria-label={gt("Search projects")}
177
+ />
178
+ ) : null}
179
+ <MenuCheckboxItem
180
+ checked={allShown}
181
+ onCheckedChange={(shown) =>
182
+ props.onChange(
183
+ shown ? [] : pairsOf(props.projects.map((project) => pullRequestProjectKey(project))),
184
+ )
185
+ }
186
+ >
187
+ <span className="flex min-w-0 items-center gap-2">
188
+ <LayersIcon aria-hidden className="size-3.5" />
189
+ <span className="min-w-0 flex-1 truncate">{gt("Show all")}</span>
190
+ </span>
191
+ </MenuCheckboxItem>
192
+ <MenuSeparator />
193
+ {visible.length === 0 ? <MenuItem disabled>{gt("No matching projects.")}</MenuItem> : null}
194
+ {visible.map((project) => {
195
+ const key = pullRequestProjectKey(project);
196
+ return (
197
+ <MenuCheckboxItem
198
+ key={key}
199
+ checked={!props.hidden.has(key)}
200
+ onCheckedChange={(shown) => {
201
+ const next = new Set(props.hidden);
202
+ if (shown) next.delete(key);
203
+ else next.add(key);
204
+ props.onChange(pairsOf(next));
205
+ }}
206
+ >
207
+ <span className="flex min-w-0 items-center gap-2">
208
+ <ProjectFavicon project={project} className="size-3.5" />
209
+ <span className="min-w-0 flex-1 truncate">{project.title}</span>
210
+ </span>
211
+ </MenuCheckboxItem>
212
+ );
213
+ })}
214
+ </>
215
+ );
216
+}
217
+
218
function LabelChoices(props: {
219
scopes: ReadonlyArray<IssueCandidatesTarget>;
220
value: ReadonlyArray<string>;
apps/web/src/components/issue/IssuesPage.tsx
+79
-38
@@ -49,13 +49,14 @@ import { PullRequestDetailPanel } from "~/components/pullRequest/PullRequestDeta
49
import { PullRequestListGhost } from "~/components/pullRequest/PullRequestGhosts";
50
import {
51
PullRequestFilterOptionIcon,
52
+ pullRequestProjectKey,
53
PullRequestSearchInput,
54
type PullRequestFilterOption,
55
} from "~/components/pullRequest/PullRequestListFilters";
56
import { m, type MessageResolver } from "~/i18n/messages";
57
import { resolveFilterOptions } from "../pullRequest/pullRequestListOptions";
58
import { IssueFiltersMenu } from "./IssueListFilterPickers";
58
-import { issueFilterProjects } from "./issuesSearch.logic";
59
+import { issueFilterProjects, issueListTargets, issueProjectKeys } from "./issuesSearch.logic";
60
import { ISSUE_SAVED_VIEWS } from "./issueSavedViews";
61
import { SavedViewsMenu } from "~/components/SavedViewsMenu";
62
import { PullRequestCompactFilterMenu } from "../pullRequest/PullRequestCompactFilterMenu";
@@ -68,6 +69,7 @@ import { PanelLayoutControls } from "~/components/chat/PanelLayoutControls";
69
import { Button } from "~/components/ui/button";
70
import {
71
Empty,
72
+ EmptyContent,
73
EmptyDescription,
74
EmptyHeader,
75
EmptyMedia,
@@ -94,7 +96,7 @@ import { useAtomCommand } from "~/state/use-atom-command";
96
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
97
import { useProjects } from "~/state/entities";
98
import { useEnvironments, useIssuesSupported } from "~/state/environments";
97
-import { issueEnvironment, useIssueList, type IssueListTarget } from "~/state/issues";
99
+import { issueEnvironment, useIssueList } from "~/state/issues";
100
import { useDebouncedValue } from "~/state/queries";
101
import { primaryServerKeybindingsAtom } from "~/state/server";
102
@@ -206,26 +208,30 @@ export function IssuesPage() {
208
),
209
environmentLabels,
210
);
209
- const scopedProject =
210
- search.issueServer && search.issueProject
211
- ? { environmentId: search.issueServer, projectId: search.issueProject }
212
- : undefined;
211
+ const hiddenProjects = issueProjectKeys(search.hideProjects);
212
213
const debouncedQuery = useDebouncedValue(search.q ?? "", 300);
214
const listInput: IssueListInput = {
215
state: search.status,
216
involvement: search.who,
217
limit: PAGE_SIZE,
219
- ...(scopedProject ? { projectId: scopedProject.projectId } : {}),
218
...(search.host ? { host: search.host } : {}),
219
...(debouncedQuery ? { query: debouncedQuery } : {}),
220
...(search.label?.length ? { labels: search.label } : {}),
221
...(search.assignee ? { assignee: search.assignee } : {}),
222
...(search.order ? { sort: search.order } : {}),
223
};
226
- const targets: ReadonlyArray<IssueListTarget> = capableEnvironments
227
- .filter((e) => scopedProject === undefined || e.environmentId === scopedProject.environmentId)
228
- .map((e) => ({ environmentId: e.environmentId, input: listInput }));
224
+ const everyProjectHidden =
225
+ filterProjects.length > 0 &&
226
+ filterProjects.every((project) => hiddenProjects.has(pullRequestProjectKey(project)));
227
+ const targets = everyProjectHidden
228
+ ? []
229
+ : issueListTargets(
230
+ capableEnvironments.map((e) => e.environmentId),
231
+ filterProjects,
232
+ search.hideProjects,
233
+ listInput,
234
+ );
235
const list = useIssueList(targets);
236
// Refreshing a list still loading would cancel it and start over, losing the scopes already read.
237
useLiveRefresh(
@@ -245,7 +251,9 @@ export function IssuesPage() {
251
const cursors = page ? issueCursorsForHost(page.nextCursors, host) : {};
252
if (!page || Object.keys(cursors).length === 0 || loadingMore !== null) return;
253
setLoadingMore(`${environmentId} ${host}`);
248
- const result = await loadPage({ environmentId, input: { ...listInput, cursors } });
254
+ const input = targets.find((target) => target.environmentId === environmentId)?.input;
255
+ if (!input) return;
256
+ const result = await loadPage({ environmentId, input: { ...input, cursors } });
257
setLoadingMore(null);
258
const failure = result._tag === "Failure" ? squashAtomCommandFailure(result) : null;
259
setPages((current) => {
@@ -271,24 +279,49 @@ export function IssuesPage() {
279
// would be, and each tracker's rows carry on from their own cursors.
280
// The server names every tracker so the menu can switch hosts, but reads only the chosen one.
281
const chosenHost = search.host?.toLowerCase();
274
- const shown = chosenHost
275
- ? new Map(
276
- [...held].map(([environmentId, page]) => [
277
- environmentId,
278
- {
279
- ...page,
280
- answer: {
281
- ...page.answer,
282
- trackers: page.answer.trackers.filter(
283
- (tracker) => tracker.host.toLowerCase() === chosenHost,
282
+ // A server older than `excludeProjectIds` still answers for hidden projects.
283
+ const shown =
284
+ chosenHost || hiddenProjects.size > 0
285
+ ? new Map(
286
+ [...held].map(([environmentId, page]) => [
287
+ environmentId,
288
+ {
289
+ ...page,
290
+ entries: page.entries.filter(
291
+ (entry) =>
292
+ !hiddenProjects.has(
293
+ pullRequestProjectKey({ environmentId, id: entry.projectId }),
294
+ ),
295
+ ),
296
+ errors: page.errors.filter(
297
+ (error) =>
298
+ !hiddenProjects.has(
299
+ pullRequestProjectKey({ environmentId, id: error.projectId }),
300
+ ),
301
),
302
+ answer: {
303
+ ...page.answer,
304
+ scopes: page.answer.scopes?.filter(
305
+ (scope) =>
306
+ !hiddenProjects.has(
307
+ pullRequestProjectKey({ environmentId, id: scope.projectId }),
308
+ ),
309
+ ),
310
+ trackers: chosenHost
311
+ ? page.answer.trackers.filter(
312
+ (tracker) => tracker.host.toLowerCase() === chosenHost,
313
+ )
314
+ : page.answer.trackers,
315
+ },
316
},
286
- },
287
- ]),
288
- )
289
- : held;
317
+ ]),
318
+ )
319
+ : held;
320
const groups = groupIssues(shown, debouncedQuery, projects, search.order ?? "updated");
291
- const filterScopes = issueFilterScopes(shown, projects, scopedProject);
321
+ const filterScopes = issueFilterScopes(
322
+ shown,
323
+ projects.filter((project) => !hiddenProjects.has(pullRequestProjectKey(project))),
324
+ );
325
326
const hostOptions = hostOptionsFor(
327
[...held.values()].flatMap((page) => page.answer.trackers),
@@ -301,9 +334,7 @@ export function IssuesPage() {
334
const next: IssuesSearch = {
335
who: merged.who ?? search.who,
336
status: merged.status ?? search.status,
304
- ...(merged.issueServer && merged.issueProject
305
- ? { issueServer: merged.issueServer, issueProject: merged.issueProject }
306
- : {}),
337
+ ...(merged.hideProjects?.length ? { hideProjects: merged.hideProjects } : {}),
338
...(merged.host ? { host: merged.host } : {}),
339
q: merged.q || undefined,
340
...(merged.label?.length ? { label: merged.label } : {}),
@@ -485,6 +516,22 @@ export function IssuesPage() {
516
onRetry={list.retry}
517
refreshing={list.isPending}
518
/>
519
+ ) : everyProjectHidden ? (
520
+ <Empty>
521
+ <EmptyMedia variant="icon">
522
+ <IssueGlyph.issue />
523
+ </EmptyMedia>
524
+ <EmptyHeader>
525
+ <EmptyTitle>
526
+ <T>Every project is hidden</T>
527
+ </EmptyTitle>
528
+ </EmptyHeader>
529
+ <EmptyContent>
530
+ <Button variant="outline" onClick={() => updateSearch({ hideProjects: undefined })}>
531
+ <T>Show all projects</T>
532
+ </Button>
533
+ </EmptyContent>
534
+ </Empty>
535
) : groups.length === 0 ? (
536
<Empty>
537
<EmptyMedia variant="icon">
@@ -691,13 +738,8 @@ export function IssuesPage() {
738
assignee={search.assignee}
739
onAssignee={(assignee) => updateSearch({ assignee })}
740
projects={filterProjects}
694
- project={scopedProject}
695
- onProject={(project) =>
696
- updateSearch({
697
- issueServer: project?.environmentId,
698
- issueProject: project?.projectId,
699
- })
700
- }
741
+ hiddenProjects={hiddenProjects}
742
+ onHiddenProjects={(hideProjects) => updateSearch({ hideProjects })}
743
/>
744
<SavedViewsMenu
745
kind={ISSUE_SAVED_VIEWS}
@@ -707,8 +749,7 @@ export function IssuesPage() {
749
updateSearch({
750
who: view.who,
751
status: view.status,
710
- issueServer: view.issueServer,
711
- issueProject: view.issueProject,
752
+ hideProjects: view.hideProjects,
753
host: view.host,
754
q: view.q,
755
label: view.label,
apps/web/src/components/issue/issueListPreferences.ts
+17
-9
@@ -1,6 +1,12 @@
1
import * as Schema from "effect/Schema";
2
3
-import { EnvironmentId, IssueInvolvement, IssueListState, ProjectId } from "@t3tools/contracts";
3
+import {
4
+ EnvironmentId,
5
+ ISSUE_LIST_MAX_EXCLUDED_PROJECTS,
6
+ IssueInvolvement,
7
+ IssueListState,
8
+ ProjectId,
9
+} from "@t3tools/contracts";
10
11
/**
12
* What the issues page remembers between visits; the selection in the URL is not part of it.
@@ -11,8 +17,8 @@ import { EnvironmentId, IssueInvolvement, IssueListState, ProjectId } from "@t3t
17
export interface IssueListPreferences {
18
readonly who: IssueInvolvement;
19
readonly status: IssueListState;
14
- readonly issueServer?: EnvironmentId | undefined;
15
- readonly issueProject?: ProjectId | undefined;
20
+ /** Projects left out of the list, so a project added later shows. */
21
+ readonly hideProjects?: ReadonlyArray<readonly [EnvironmentId, ProjectId]> | undefined;
22
readonly host?: string | undefined;
23
readonly q?: string | undefined;
24
/** `label`, `assignee` and `order` for the same reason: the pull-request page has `labels` and `sort`. */
@@ -32,8 +38,11 @@ const BoundedPreference = Schema.String.check(Schema.isMaxLength(200));
38
export const IssueListPreferencesSchema = Schema.Struct({
39
who: IssueInvolvement,
40
status: IssueListState,
35
- issueServer: Schema.optional(EnvironmentId),
36
- issueProject: Schema.optional(ProjectId),
41
+ hideProjects: Schema.optional(
42
+ Schema.Array(Schema.Tuple([EnvironmentId, ProjectId])).check(
43
+ Schema.isMaxLength(ISSUE_LIST_MAX_EXCLUDED_PROJECTS),
44
+ ),
45
+ ),
46
host: Schema.optional(BoundedPreference),
47
q: Schema.optional(BoundedPreference),
48
label: Schema.optional(Schema.Array(BoundedPreference).check(Schema.isMaxLength(20))),
@@ -52,8 +61,7 @@ function storage(): PreferenceStorage | undefined {
61
export function issueListPreferences(search: {
62
readonly who: IssueInvolvement;
63
readonly status: IssueListState;
55
- readonly issueServer?: EnvironmentId | undefined;
56
- readonly issueProject?: ProjectId | undefined;
64
+ readonly hideProjects?: ReadonlyArray<readonly [EnvironmentId, ProjectId]> | undefined;
65
readonly host?: string | undefined;
66
readonly q?: string | undefined;
67
readonly label?: ReadonlyArray<string> | undefined;
@@ -63,8 +71,8 @@ export function issueListPreferences(search: {
71
return {
72
who: search.who,
73
status: search.status,
66
- ...(search.issueServer && search.issueProject
67
- ? { issueServer: search.issueServer, issueProject: search.issueProject }
74
+ ...(search.hideProjects?.length
75
+ ? { hideProjects: search.hideProjects.slice(0, ISSUE_LIST_MAX_EXCLUDED_PROJECTS) }
76
: {}),
77
...(search.host ? { host: search.host } : {}),
78
...(search.q ? { q: search.q } : {}),
apps/web/src/components/issue/issueSavedViews.test.ts
+26
-3
@@ -1,14 +1,21 @@
1
import { describe, expect, it } from "vite-plus/test";
2
3
+import * as Schema from "effect/Schema";
4
+
5
import { EnvironmentId, ProjectId } from "@t3tools/contracts";
6
7
+import { issueListPreferences, IssueListPreferencesSchema } from "./issueListPreferences";
8
import { issueViewMatches } from "./issueSavedViews";
9
10
+const decodePreferences = Schema.decodeOption(IssueListPreferencesSchema);
11
+
12
const preferences = {
13
who: "assigned",
14
status: "open",
10
- issueServer: EnvironmentId.make("env-1"),
11
- issueProject: ProjectId.make("project-1"),
15
+ hideProjects: [
16
+ [EnvironmentId.make("env-1"), ProjectId.make("project-1")],
17
+ [EnvironmentId.make("env-1"), ProjectId.make("project-2")],
18
+ ],
19
host: "github.com",
20
q: "crash",
21
label: ["bug", "priority"],
@@ -24,6 +31,22 @@ describe("saved issue views", () => {
31
);
32
expect(issueViewMatches(view, { ...preferences, assignee: undefined })).toBe(false);
33
expect(issueViewMatches(view, { ...preferences, label: ["bug"] })).toBe(false);
27
- expect(issueViewMatches(view, { ...preferences, issueProject: undefined })).toBe(false);
34
+ expect(
35
+ issueViewMatches(view, {
36
+ ...preferences,
37
+ hideProjects: preferences.hideProjects.toReversed(),
38
+ }),
39
+ ).toBe(true);
40
+ expect(issueViewMatches(view, { ...preferences, hideProjects: undefined })).toBe(false);
41
+ });
42
+
43
+ it("keeps a selection of every project within what it reads back", () => {
44
+ const many = Array.from(
45
+ { length: 1_001 },
46
+ (_, index) => [EnvironmentId.make("env-1"), ProjectId.make(`project-${index}`)] as const,
47
+ );
48
+ const stored = issueListPreferences({ ...preferences, hideProjects: many });
49
+ const restored = decodePreferences(stored);
50
+ expect(restored._tag === "Some" && restored.value.hideProjects).toEqual(many.slice(0, 1_000));
51
});
52
});
apps/web/src/components/issue/issueSavedViews.ts
+5
-1
@@ -15,7 +15,11 @@ export function issueViewMatches(
15
): boolean {
16
const key = (value: IssueListPreferences) => {
17
const normalized = issueListPreferences(value);
18
- return JSON.stringify({ ...normalized, label: normalized.label?.toSorted() });
18
+ return JSON.stringify({
19
+ ...normalized,
20
+ label: normalized.label?.toSorted(),
21
+ hideProjects: normalized.hideProjects?.map((pair) => JSON.stringify(pair)).toSorted(),
22
+ });
23
};
24
return key(issueListPreferences(view.preferences)) === key(preferences);
25
}
apps/web/src/components/issue/issuesSearch.logic.test.ts
+40
-2
@@ -3,7 +3,7 @@ import { describe, expect, it } from "vite-plus/test";
3
import type { EnvironmentProject } from "@t3tools/client-runtime/state/models";
4
import { EnvironmentId, ProjectId } from "@t3tools/contracts";
5
6
-import { issueFilterProjects, issuesSearchFromUrl } from "./issuesSearch.logic";
6
+import { issueFilterProjects, issueListTargets, issuesSearchFromUrl } from "./issuesSearch.logic";
7
8
describe("issuesSearchFromUrl", () => {
9
it("replaces a malformed filter instead of letting the raw value through", () => {
@@ -19,11 +19,48 @@ describe("issuesSearchFromUrl", () => {
19
label: ["bug", "ui"],
20
order: "created",
21
});
22
+ expect(
23
+ issuesSearchFromUrl({ hideProjects: [["env", "web"], ["env"], "api", ["env", 3]] })
24
+ .hideProjects,
25
+ ).toEqual([
26
+ ["env", "web"],
27
+ ["env", "3"],
28
+ ]);
29
+ });
30
+});
31
+
32
+describe("issueListTargets", () => {
33
+ it("leaves hidden projects out and skips an environment with every project hidden", () => {
34
+ const laptop = EnvironmentId.make("laptop");
35
+ const vps = EnvironmentId.make("vps");
36
+ const projects = [
37
+ { environmentId: laptop, id: ProjectId.make("web") },
38
+ { environmentId: laptop, id: ProjectId.make("api") },
39
+ { environmentId: vps, id: ProjectId.make("docs") },
40
+ ];
41
+ const input = { state: "open" } as const;
42
+ const hidden = [
43
+ [laptop, ProjectId.make("api")],
44
+ [laptop, ProjectId.make("removed")],
45
+ [vps, ProjectId.make("docs")],
46
+ ] as const;
47
+ expect(issueListTargets([laptop, vps], projects, hidden, input)).toEqual([
48
+ { environmentId: laptop, input: { state: "open", excludeProjectIds: ["api"] } },
49
+ ]);
50
+ // Before the project list loads, the saved choice still leaves its projects out.
51
+ expect(issueListTargets([laptop, vps], [], hidden, input)).toEqual([
52
+ { environmentId: laptop, input: { state: "open", excludeProjectIds: ["api", "removed"] } },
53
+ { environmentId: vps, input: { state: "open", excludeProjectIds: ["docs"] } },
54
+ ]);
55
+ expect(issueListTargets([laptop, vps], projects, undefined, input)).toEqual([
56
+ { environmentId: laptop, input },
57
+ { environmentId: vps, input },
58
+ ]);
59
});
60
});
61
62
describe("issueFilterProjects", () => {
26
- it("keeps every project on one repository as its own choice", () => {
63
+ it("keeps every project, scratch ones too, as its own choice", () => {
64
const environmentId = EnvironmentId.make("env");
65
const project = (id: string, isScratch = false) =>
66
({
@@ -40,6 +77,7 @@ describe("issueFilterProjects", () => {
77
);
78
expect(choices.map((choice) => [choice.id, choice.title])).toEqual([
79
["main", "t3code · laptop · /work/main"],
80
+ ["scratch", "t3code · laptop · /work/scratch"],
81
["worktree", "t3code · laptop · /work/worktree"],
82
]);
83
});
apps/web/src/components/issue/issuesSearch.logic.ts
+63
-7
@@ -1,6 +1,13 @@
1
import { pullRequestFilterProjects } from "@t3tools/client-runtime/pull-request-project-filter";
2
import type { EnvironmentProject } from "@t3tools/client-runtime/state/models";
3
-import type { EnvironmentId, ProjectId } from "@t3tools/contracts";
3
+import {
4
+ ISSUE_LIST_MAX_EXCLUDED_PROJECTS,
5
+ type EnvironmentId,
6
+ type IssueListInput,
7
+ type ProjectId,
8
+} from "@t3tools/contracts";
9
+
10
+import type { IssueListTarget } from "@t3tools/client-runtime/state/issues";
11
12
import type { IssuesSearch } from "./IssuesPage";
13
@@ -15,14 +22,24 @@ const labels = (raw: unknown): ReadonlyArray<string> | undefined => {
22
return names.length === 0 ? undefined : names.slice(0, 20);
23
};
24
25
+const projectPairs = (raw: unknown): IssuesSearch["hideProjects"] => {
26
+ const pairs = (Array.isArray(raw) ? raw : []).flatMap((pair) => {
27
+ const environmentId = Array.isArray(pair) ? bounded(pair[0]) : undefined;
28
+ const projectId = Array.isArray(pair) ? bounded(pair[1]) : undefined;
29
+ return environmentId && projectId
30
+ ? [[environmentId as EnvironmentId, projectId as ProjectId] as const]
31
+ : [];
32
+ });
33
+ return pairs.length === 0 ? undefined : pairs.slice(0, ISSUE_LIST_MAX_EXCLUDED_PROJECTS);
34
+};
35
+
36
// Every optional key is an own key, even when undefined: the router lays these over the parent
37
// route's unvalidated search, where a key left out would keep its raw value.
38
export const issuesSearchFromUrl = (raw: Record<string, unknown>): IssuesSearch => ({
39
who:
40
raw.who === "assigned" || raw.who === "authored" || raw.who === "mentioned" ? raw.who : "all",
41
status: raw.status === "closed" || raw.status === "all" ? raw.status : "open",
24
- issueServer: bounded(raw.issueServer) as EnvironmentId | undefined,
25
- issueProject: bounded(raw.issueProject) as ProjectId | undefined,
42
+ hideProjects: projectPairs(raw.hideProjects),
43
host: bounded(raw.host),
44
q: bounded(raw.q),
45
label: labels(raw.label),
@@ -36,14 +53,53 @@ export const issuesSearchFromUrl = (raw: Record<string, unknown>): IssuesSearch
53
key: bounded(raw.key),
54
});
55
39
-/** One choice per project: projects on one repository can read different Linear teams. */
56
+/**
57
+ * One choice per project: projects on one repository can read different Linear teams. Scratch
58
+ * projects stay, since Settings can bind one to a Linear team.
59
+ */
60
export const issueFilterProjects = (
61
projects: ReadonlyArray<EnvironmentProject>,
62
environmentLabels: ReadonlyMap<EnvironmentId, string>,
63
) =>
64
pullRequestFilterProjects(
45
- projects
46
- .filter((project) => !project.isScratch)
47
- .map((project) => ({ ...project, repositoryIdentity: null })),
65
+ projects.map((project) => ({ ...project, repositoryIdentity: null })),
66
environmentLabels,
67
);
68
+
69
+/** The same key as `pullRequestProjectKey`. */
70
+const projectKey = (project: { readonly id: ProjectId; readonly environmentId: EnvironmentId }) =>
71
+ JSON.stringify([project.environmentId, project.id]);
72
+
73
+export const issueProjectKeys = (pairs: IssuesSearch["hideProjects"]): ReadonlySet<string> =>
74
+ new Set((pairs ?? []).map((pair) => JSON.stringify(pair)));
75
+
76
+/**
77
+ * Each environment leaves out its hidden projects, named from the saved pairs so a listing sent
78
+ * before the project list loads still leaves them out. One with every project hidden is not read.
79
+ * Rows past the request limit are hidden on the client.
80
+ */
81
+export function issueListTargets(
82
+ environmentIds: ReadonlyArray<EnvironmentId>,
83
+ projects: ReadonlyArray<{ readonly id: ProjectId; readonly environmentId: EnvironmentId }>,
84
+ hidden: IssuesSearch["hideProjects"],
85
+ input: IssueListInput,
86
+): ReadonlyArray<IssueListTarget> {
87
+ const keys = issueProjectKeys(hidden);
88
+ return environmentIds.flatMap((environmentId) => {
89
+ const own = projects.filter((project) => project.environmentId === environmentId);
90
+ if (own.length > 0 && own.every((project) => keys.has(projectKey(project)))) return [];
91
+ const excludeProjectIds = (
92
+ own.length > 0
93
+ ? own.filter((project) => keys.has(projectKey(project))).map((project) => project.id)
94
+ : (hidden ?? [])
95
+ .filter(([environment]) => environment === environmentId)
96
+ .map(([, projectId]) => projectId)
97
+ ).slice(0, ISSUE_LIST_MAX_EXCLUDED_PROJECTS);
98
+ return [
99
+ {
100
+ environmentId,
101
+ input: excludeProjectIds.length ? { ...input, excludeProjectIds } : input,
102
+ },
103
+ ];
104
+ });
105
+}
apps/web/src/i18n/translations/de.json
+4
-1
@@ -5779,9 +5779,12 @@
5779
"1cf216566c1ee064": "Projekt nicht verfügbar",
5780
"b5ddadeb0810688c": "Status",
5781
"93c1fc19d9bf1db0": "Beteiligung",
5782
+ "d5a8b335d88b65bc": "{hidden} ausgeblendet",
5783
"2160067266a61dd8": "Beliebig",
5784
"cd4ec4acf33c65b9": "{count, plural, one {{count} Label} other {{count} Labels}}",
5785
"bfd20acb8b7dee6b": "Beliebig",
5786
+ "ad208e3e32c85029": "Alle ausblenden",
5787
+ "77ce79d865716719": "Keine passenden Projekte.",
5788
"af7eb4f9c7f0f575": "Filter",
5789
"08247dd39b0c85ff": "Zugewiesene Person",
5790
"5cad5a7879c8d38c": "Keine Labels gefunden",
@@ -5818,6 +5821,7 @@
5821
"297613ddcf68d031": "Sortieren",
5822
"4aa8190ec693085e": "Nach Tracker filtern",
5823
"d44aed6ee67982dd": "Issues aktualisieren",
5824
+ "df23678c28c56593": "Alle Projekte sind ausgeblendet",
5825
"2ccf231996dc89c2": "Keine Tracker zum Lesen",
5826
"ffdb63a22901a1fa": "Füge ein Projekt hinzu, dessen Remote bei einem unterstützten Tracker liegt.",
5827
"403e9debff81d7df": [
@@ -9724,7 +9728,6 @@
9728
"51497bd401292062": "Gedrückt halten",
9729
"9d6cc6ac23312071": "Doppelt drücken",
9730
"f001fa7b329c8fbf": "Erfolgreiche ausblenden",
9727
- "ad208e3e32c85029": "Alle ausblenden",
9731
"c80e4bb3201efd71": "Zen",
9732
"0cb9ffcd1fb46b0c": "Nur Status",
9733
"cf0f7fc3df26fa75": "Status und Nachrichten",
apps/web/src/i18n/translations/en.json
+4
-1
@@ -5780,9 +5780,12 @@
5780
"1cf216566c1ee064": "Unavailable project",
5781
"b5ddadeb0810688c": "State",
5782
"93c1fc19d9bf1db0": "Involvement",
5783
+ "d5a8b335d88b65bc": "{hidden} hidden",
5784
"2160067266a61dd8": "Any",
5785
"cd4ec4acf33c65b9": "{count, plural, one {{count} label} other {{count} labels}}",
5786
"bfd20acb8b7dee6b": "Anyone",
5787
+ "ad208e3e32c85029": "Hide all",
5788
+ "77ce79d865716719": "No matching projects.",
5789
"af7eb4f9c7f0f575": "Filters",
5790
"08247dd39b0c85ff": "Assignee",
5791
"5cad5a7879c8d38c": "No labels found",
@@ -5819,6 +5822,7 @@
5822
"297613ddcf68d031": "Sort",
5823
"4aa8190ec693085e": "Filter by tracker",
5824
"d44aed6ee67982dd": "Refresh issues",
5825
+ "df23678c28c56593": "Every project is hidden",
5826
"2ccf231996dc89c2": "No trackers to read",
5827
"ffdb63a22901a1fa": "Add a project whose remote is on a supported tracker.",
5828
"403e9debff81d7df": [
@@ -9733,7 +9737,6 @@
9737
"51497bd401292062": "Hold",
9738
"9d6cc6ac23312071": "Double press",
9739
"f001fa7b329c8fbf": "Hide successful",
9736
- "ad208e3e32c85029": "Hide all",
9740
"c80e4bb3201efd71": "Zen",
9741
"0cb9ffcd1fb46b0c": "Status only",
9742
"cf0f7fc3df26fa75": "Status and messages",
apps/web/src/i18n/translations/es.json
+4
-1
@@ -5778,9 +5778,12 @@
5778
"1cf216566c1ee064": "Proyecto no disponible",
5779
"b5ddadeb0810688c": "Estado",
5780
"93c1fc19d9bf1db0": "Participación",
5781
+ "d5a8b335d88b65bc": "{hidden} ocultos",
5782
"2160067266a61dd8": "Cualquiera",
5783
"cd4ec4acf33c65b9": "{count, plural, one {{count} etiqueta} other {{count} etiquetas}}",
5784
"bfd20acb8b7dee6b": "Cualquiera",
5785
+ "ad208e3e32c85029": "Ocultar todo",
5786
+ "77ce79d865716719": "No hay proyectos que coincidan.",
5787
"af7eb4f9c7f0f575": "Filtros",
5788
"08247dd39b0c85ff": "Asignado",
5789
"5cad5a7879c8d38c": "No se encontraron etiquetas",
@@ -5817,6 +5820,7 @@
5820
"297613ddcf68d031": "Ordenar",
5821
"4aa8190ec693085e": "Filtrar por gestor de issues",
5822
"d44aed6ee67982dd": "Actualizar issues",
5823
+ "df23678c28c56593": "Todos los proyectos están ocultos",
5824
"2ccf231996dc89c2": "No hay gestores de issues que leer",
5825
"ffdb63a22901a1fa": "Añade un proyecto cuyo remoto esté en un gestor de issues compatible.",
5826
"403e9debff81d7df": [
@@ -9721,7 +9725,6 @@
9725
"51497bd401292062": "Mantener pulsado",
9726
"9d6cc6ac23312071": "Doble pulsación",
9727
"f001fa7b329c8fbf": "Ocultar las correctas",
9724
- "ad208e3e32c85029": "Ocultar todo",
9728
"c80e4bb3201efd71": "Zen",
9729
"0cb9ffcd1fb46b0c": "Solo el estado",
9730
"cf0f7fc3df26fa75": "Estado y mensajes",
apps/web/src/i18n/translations/fr.json
+4
-1
@@ -5779,9 +5779,12 @@
5779
"1cf216566c1ee064": "Projet indisponible",
5780
"b5ddadeb0810688c": "État",
5781
"93c1fc19d9bf1db0": "Participation",
5782
+ "d5a8b335d88b65bc": "{hidden} masqués",
5783
"2160067266a61dd8": "Tous",
5784
"cd4ec4acf33c65b9": "{count, plural, one {{count} libellé} other {{count} libellés}}",
5785
"bfd20acb8b7dee6b": "N’importe qui",
5786
+ "ad208e3e32c85029": "Tout masquer",
5787
+ "77ce79d865716719": "Aucun projet correspondant.",
5788
"af7eb4f9c7f0f575": "Filtres",
5789
"08247dd39b0c85ff": "Assigné",
5790
"5cad5a7879c8d38c": "Aucun libellé trouvé",
@@ -5818,6 +5821,7 @@
5821
"297613ddcf68d031": "Trier",
5822
"4aa8190ec693085e": "Filtrer par gestionnaire de tickets",
5823
"d44aed6ee67982dd": "Actualiser les tickets",
5824
+ "df23678c28c56593": "Tous les projets sont masqués",
5825
"2ccf231996dc89c2": "Aucun gestionnaire de tickets à lire",
5826
"ffdb63a22901a1fa": "Ajoutez un projet dont le remote est sur un gestionnaire de tickets pris en charge.",
5827
"403e9debff81d7df": [
@@ -9723,7 +9727,6 @@
9727
"51497bd401292062": "Appui long",
9728
"9d6cc6ac23312071": "Double appui",
9729
"f001fa7b329c8fbf": "Masquer les réussis",
9726
- "ad208e3e32c85029": "Tout masquer",
9730
"c80e4bb3201efd71": "Zen",
9731
"0cb9ffcd1fb46b0c": "Statut uniquement",
9732
"cf0f7fc3df26fa75": "Statut et messages",
apps/web/src/i18n/translations/ja.json
+4
-1
@@ -5761,9 +5761,12 @@
5761
"1cf216566c1ee064": "利用できないプロジェクト",
5762
"b5ddadeb0810688c": "状態",
5763
"93c1fc19d9bf1db0": "関与",
5764
+ "d5a8b335d88b65bc": "{hidden} 件非表示",
5765
"2160067266a61dd8": "すべて",
5766
"cd4ec4acf33c65b9": "{count, plural, other {{count} 個のラベル}}",
5767
"bfd20acb8b7dee6b": "すべてのユーザー",
5768
+ "ad208e3e32c85029": "すべて非表示",
5769
+ "77ce79d865716719": "一致するプロジェクトはありません。",
5770
"af7eb4f9c7f0f575": "フィルター",
5771
"08247dd39b0c85ff": "担当者",
5772
"5cad5a7879c8d38c": "ラベルが見つかりません",
@@ -5800,6 +5803,7 @@
5803
"297613ddcf68d031": "並べ替え",
5804
"4aa8190ec693085e": "トラッカーで絞り込む",
5805
"d44aed6ee67982dd": "Issue を更新",
5806
+ "df23678c28c56593": "すべてのプロジェクトが非表示です",
5807
"2ccf231996dc89c2": "読み取れるトラッカーがありません",
5808
"ffdb63a22901a1fa": "リモートが対応トラッカー上にあるプロジェクトを追加してください。",
5809
"403e9debff81d7df": [
@@ -9675,7 +9679,6 @@
9679
"51497bd401292062": "長押し",
9680
"9d6cc6ac23312071": "2 回押し",
9681
"f001fa7b329c8fbf": "成功したものを非表示",
9678
- "ad208e3e32c85029": "すべて非表示",
9682
"c80e4bb3201efd71": "Zen",
9683
"0cb9ffcd1fb46b0c": "ステータスのみ",
9684
"cf0f7fc3df26fa75": "ステータスとメッセージ",
apps/web/src/i18n/translations/ko.json
+4
-1
@@ -5759,9 +5759,12 @@
5759
"1cf216566c1ee064": "사용할 수 없는 프로젝트",
5760
"b5ddadeb0810688c": "상태",
5761
"93c1fc19d9bf1db0": "참여",
5762
+ "d5a8b335d88b65bc": "{hidden}개 숨김",
5763
"2160067266a61dd8": "전체",
5764
"cd4ec4acf33c65b9": "{count, plural, other {레이블 {count}개}}",
5765
"bfd20acb8b7dee6b": "모든 사람",
5766
+ "ad208e3e32c85029": "모두 숨기기",
5767
+ "77ce79d865716719": "일치하는 프로젝트가 없습니다.",
5768
"af7eb4f9c7f0f575": "필터",
5769
"08247dd39b0c85ff": "담당자",
5770
"5cad5a7879c8d38c": "레이블을 찾을 수 없음",
@@ -5798,6 +5801,7 @@
5801
"297613ddcf68d031": "정렬",
5802
"4aa8190ec693085e": "트래커별 필터",
5803
"d44aed6ee67982dd": "이슈 새로 고침",
5804
+ "df23678c28c56593": "모든 프로젝트가 숨겨져 있습니다",
5805
"2ccf231996dc89c2": "읽을 트래커 없음",
5806
"ffdb63a22901a1fa": "원격 저장소가 지원되는 트래커에 있는 프로젝트를 추가하세요.",
5807
"403e9debff81d7df": [
@@ -9678,7 +9682,6 @@
9682
"51497bd401292062": "길게 누르기",
9683
"9d6cc6ac23312071": "두 번 누르기",
9684
"f001fa7b329c8fbf": "성공한 항목 숨기기",
9681
- "ad208e3e32c85029": "모두 숨기기",
9685
"c80e4bb3201efd71": "Zen",
9686
"0cb9ffcd1fb46b0c": "상태만",
9687
"cf0f7fc3df26fa75": "상태 및 메시지",
apps/web/src/i18n/translations/pt-BR.json
+4
-1
@@ -5778,9 +5778,12 @@
5778
"1cf216566c1ee064": "Projeto indisponível",
5779
"b5ddadeb0810688c": "Estado",
5780
"93c1fc19d9bf1db0": "Envolvimento",
5781
+ "d5a8b335d88b65bc": "{hidden} ocultos",
5782
"2160067266a61dd8": "Qualquer",
5783
"cd4ec4acf33c65b9": "{count, plural, one {{count} rótulo} other {{count} rótulos}}",
5784
"bfd20acb8b7dee6b": "Qualquer pessoa",
5785
+ "ad208e3e32c85029": "Ocultar todas",
5786
+ "77ce79d865716719": "Nenhum projeto correspondente.",
5787
"af7eb4f9c7f0f575": "Filtros",
5788
"08247dd39b0c85ff": "Responsável",
5789
"5cad5a7879c8d38c": "Nenhum rótulo encontrado",
@@ -5817,6 +5820,7 @@
5820
"297613ddcf68d031": "Ordenar",
5821
"4aa8190ec693085e": "Filtrar por rastreador",
5822
"d44aed6ee67982dd": "Atualizar issues",
5823
+ "df23678c28c56593": "Todos os projetos estão ocultos",
5824
"2ccf231996dc89c2": "Nenhum rastreador para ler",
5825
"ffdb63a22901a1fa": "Adicione um projeto cujo remoto esteja em um rastreador compatível.",
5826
"403e9debff81d7df": [
@@ -9722,7 +9726,6 @@
9726
"51497bd401292062": "Manter pressionado",
9727
"9d6cc6ac23312071": "Pressionar duas vezes",
9728
"f001fa7b329c8fbf": "Ocultar bem-sucedidas",
9725
- "ad208e3e32c85029": "Ocultar todas",
9729
"c80e4bb3201efd71": "Zen",
9730
"0cb9ffcd1fb46b0c": "Só status",
9731
"cf0f7fc3df26fa75": "Status e mensagens",
apps/web/src/i18n/translations/ru.json
+4
-1
@@ -5778,9 +5778,12 @@
5778
"1cf216566c1ee064": "Проект недоступен",
5779
"b5ddadeb0810688c": "Состояние",
5780
"93c1fc19d9bf1db0": "Участие",
5781
+ "d5a8b335d88b65bc": "Скрыто: {hidden}",
5782
"2160067266a61dd8": "Любая",
5783
"cd4ec4acf33c65b9": "{count, plural, one {{count} метка} few {{count} метки} many {{count} меток} other {{count} метки}}",
5784
"bfd20acb8b7dee6b": "Любой",
5785
+ "ad208e3e32c85029": "Скрывать все",
5786
+ "77ce79d865716719": "Нет подходящих проектов.",
5787
"af7eb4f9c7f0f575": "Фильтры",
5788
"08247dd39b0c85ff": "Исполнитель",
5789
"5cad5a7879c8d38c": "Метки не найдены",
@@ -5817,6 +5820,7 @@
5820
"297613ddcf68d031": "Сортировать",
5821
"4aa8190ec693085e": "Фильтр по трекеру",
5822
"d44aed6ee67982dd": "Обновить issue",
5823
+ "df23678c28c56593": "Все проекты скрыты",
5824
"2ccf231996dc89c2": "Нет трекеров для чтения",
5825
"ffdb63a22901a1fa": "Добавьте проект, у которого remote находится в поддерживаемом трекере.",
5826
"403e9debff81d7df": [
@@ -9725,7 +9729,6 @@
9729
"51497bd401292062": "Удержание",
9730
"9d6cc6ac23312071": "Двойное нажатие",
9731
"f001fa7b329c8fbf": "Скрывать успешные",
9728
- "ad208e3e32c85029": "Скрывать все",
9732
"c80e4bb3201efd71": "Дзен",
9733
"0cb9ffcd1fb46b0c": "Только статус",
9734
"cf0f7fc3df26fa75": "Статус и сообщения",
apps/web/src/i18n/translations/sv.json
+4
-1
@@ -5779,9 +5779,12 @@
5779
"1cf216566c1ee064": "Projektet är inte tillgängligt",
5780
"b5ddadeb0810688c": "Status",
5781
"93c1fc19d9bf1db0": "Inblandning",
5782
+ "d5a8b335d88b65bc": "{hidden} dolda",
5783
"2160067266a61dd8": "Alla",
5784
"cd4ec4acf33c65b9": "{count, plural, one {{count} etikett} other {{count} etiketter}}",
5785
"bfd20acb8b7dee6b": "Vem som helst",
5786
+ "ad208e3e32c85029": "Dölj alla",
5787
+ "77ce79d865716719": "Inga matchande projekt.",
5788
"af7eb4f9c7f0f575": "Filter",
5789
"08247dd39b0c85ff": "Tilldelad",
5790
"5cad5a7879c8d38c": "Inga etiketter hittades",
@@ -5818,6 +5821,7 @@
5821
"297613ddcf68d031": "Sortera",
5822
"4aa8190ec693085e": "Filtrera efter ärendehanterare",
5823
"d44aed6ee67982dd": "Uppdatera ärenden",
5824
+ "df23678c28c56593": "Alla projekt är dolda",
5825
"2ccf231996dc89c2": "Inga ärendehanterare att läsa",
5826
"ffdb63a22901a1fa": "Lägg till ett projekt vars fjärr finns i en ärendehanterare som stöds.",
5827
"403e9debff81d7df": [
@@ -9731,7 +9735,6 @@
9735
"51497bd401292062": "Håll ned",
9736
"9d6cc6ac23312071": "Dubbeltryck",
9737
"f001fa7b329c8fbf": "Dölj lyckade",
9734
- "ad208e3e32c85029": "Dölj alla",
9738
"c80e4bb3201efd71": "Zen",
9739
"0cb9ffcd1fb46b0c": "Endast status",
9740
"cf0f7fc3df26fa75": "Status och meddelanden",
apps/web/src/i18n/translations/zh.json
+4
-1
@@ -5785,9 +5785,12 @@
5785
"1cf216566c1ee064": "不可用的项目",
5786
"b5ddadeb0810688c": "状态",
5787
"93c1fc19d9bf1db0": "参与方式",
5788
+ "d5a8b335d88b65bc": "已隐藏 {hidden} 个",
5789
"2160067266a61dd8": "任意",
5790
"cd4ec4acf33c65b9": "{count, plural, other {{count} 个标签}}",
5791
"bfd20acb8b7dee6b": "任何人",
5792
+ "ad208e3e32c85029": "全部隐藏",
5793
+ "77ce79d865716719": "没有匹配的项目。",
5794
"af7eb4f9c7f0f575": "筛选条件",
5795
"08247dd39b0c85ff": "受理人",
5796
"5cad5a7879c8d38c": "未找到标签",
@@ -5824,6 +5827,7 @@
5827
"297613ddcf68d031": "排序",
5828
"4aa8190ec693085e": "按跟踪器筛选",
5829
"d44aed6ee67982dd": "刷新 issue",
5830
+ "df23678c28c56593": "所有项目均已隐藏",
5831
"2ccf231996dc89c2": "没有可读取的跟踪器",
5832
"ffdb63a22901a1fa": "请添加一个远端位于受支持跟踪器上的项目。",
5833
"403e9debff81d7df": [
@@ -9738,7 +9742,6 @@
9742
"51497bd401292062": "长按",
9743
"9d6cc6ac23312071": "连按两次",
9744
"f001fa7b329c8fbf": "隐藏成功的调用",
9741
- "ad208e3e32c85029": "全部隐藏",
9745
"c80e4bb3201efd71": "专注模式",
9746
"0cb9ffcd1fb46b0c": "仅状态",
9747
"cf0f7fc3df26fa75": "状态和消息",
docs/user/source-control.md
+3
-2
@@ -369,8 +369,9 @@ out from the matching organization and repository.
369
The Issues page lists the issues of every project whose remote is on GitHub, GitLab, Azure
370
DevOps or Forgejo, grouped per tracker account. Open it from the sidebar's utility row or with
371
**Open issues** in the command palette. Filter by open or closed, by your involvement
372
-(assigned, opened by you, mentioning you), by project, and by tracker; the search box asks the tracker
373
-itself where it can search. Press **Load more** at the end of a group to read further back.
372
+(assigned, opened by you, mentioning you), and by tracker. Under **Projects**, uncheck the
373
+projects you do not want to see; the list remembers them, and a project you add later shows.
374
+The search box asks the tracker itself where it can search. Press **Load more** at the end of a group to read further back.
375
The **Views** menu saves and restores a search, filter, and sort setup, as it does for pull
376
requests.
377
packages/client-runtime/src/issueList.test.ts
-41
@@ -6,7 +6,6 @@ import type {
6
IssueTrackerSummary,
7
ProjectId,
8
} from "@t3tools/contracts";
9
-import type { EnvironmentProject } from "./state/models.ts";
9
import { describe, expect, it } from "vite-plus/test";
10
11
import {
@@ -143,46 +142,6 @@ describe("issueFilterScopes", () => {
142
[environmentId, hold(answer({ trackers: [tracker({})], entries: [], scopes: [scope] }))],
143
]);
144
expect(issueFilterScopes(held, [])).toEqual([{ environmentId, input: scope }]);
146
- const otherProjectId = "web" as ProjectId;
147
- const projects = [api, otherProjectId].map((id) => ({
148
- id,
149
- environmentId,
150
- repositoryIdentity: {
151
- provider: "github",
152
- canonicalKey: `github.com/acme/${id}`,
153
- owner: "acme",
154
- name: id,
155
- },
156
- })) as unknown as ReadonlyArray<EnvironmentProject>;
157
- const withRepositories = new Map([
158
- [
159
- environmentId,
160
- hold(
161
- answer({
162
- trackers: [
163
- tracker({}),
164
- tracker({ tracker: "github" as IssueTrackerKind, host: "github.com" }),
165
- ],
166
- scopes: [scope, { ...scope, projectId: otherProjectId, scope: "WEB" }],
167
- }),
168
- ),
169
- ],
170
- ]);
171
- expect(
172
- issueFilterScopes(withRepositories, projects, { environmentId, projectId: api }),
173
- ).toEqual([
174
- {
175
- environmentId,
176
- input: { projectId: api, tracker: "github", host: "github.com", scope: "acme/api" },
177
- },
178
- { environmentId, input: scope },
179
- ]);
180
- expect(
181
- issueFilterScopes(withRepositories, projects, {
182
- environmentId: "other" as EnvironmentId,
183
- projectId: api,
184
- }),
185
- ).toEqual([]);
145
});
146
147
it("skips a tracker that cannot be read", () => {
packages/client-runtime/src/issueList.ts
-5
@@ -8,7 +8,6 @@ import type {
8
IssueScopeRef,
9
IssueTrackerSummary,
10
SourceControlProviderKind,
11
- ProjectId,
11
} from "@t3tools/contracts";
12
13
import { mergeIssueListPage } from "./state/issues.ts";
@@ -168,14 +167,11 @@ export function groupIssues(
167
export function issueFilterScopes(
168
held: ReadonlyMap<EnvironmentId, HeldIssuePage>,
169
projects: ReadonlyArray<EnvironmentProject>,
171
- selectedProject?: { readonly environmentId: EnvironmentId; readonly projectId: ProjectId },
170
) {
171
const scopes: Array<{ readonly environmentId: EnvironmentId; readonly input: IssueScopeRef }> =
172
[];
173
for (const [environmentId, page] of held) {
176
- if (selectedProject && selectedProject.environmentId !== environmentId) continue;
174
for (const project of projects) {
178
- if (selectedProject && selectedProject.projectId !== project.id) continue;
175
if (project.environmentId !== environmentId) continue;
176
const identity = project.repositoryIdentity;
177
const kind = identity?.provider as SourceControlProviderKind | undefined;
@@ -208,7 +204,6 @@ export function issueFilterScopes(
204
scope,
205
}));
206
for (const input of covered) {
211
- if (selectedProject && selectedProject.projectId !== input.projectId) continue;
207
const host = input.host?.toLowerCase();
208
const tracker = page.answer.trackers.find(
209
(t) => t.tracker === input.tracker && t.host.toLowerCase() === host,
packages/contracts/src/issue.ts
+6
@@ -256,10 +256,16 @@ export const IssueListCursors = Schema.Record(
256
);
257
export type IssueListCursors = typeof IssueListCursors.Type;
258
259
+export const ISSUE_LIST_MAX_EXCLUDED_PROJECTS = 1_000;
260
+
261
export const IssueListInput = Schema.Struct({
262
state: IssueListState,
263
involvement: Schema.optional(IssueInvolvement),
264
projectId: Schema.optional(ProjectId),
265
+ /** Projects left out of the listing, as the issues page hides them. */
266
+ excludeProjectIds: Schema.optional(
267
+ Schema.Array(ProjectId).check(Schema.isMaxLength(ISSUE_LIST_MAX_EXCLUDED_PROJECTS)),
268
+ ),
269
/** Narrows to one host, named as the host itself. Absent means every host the workspace has. */
270
host: Schema.optional(TrimmedNonEmptyString),
271
/** Rows per scope, which with a continuation is rows per slice. */