From 68e54f4b141da7b13404192dcfa897c31e351499 Mon Sep 17 00:00:00 2001 From: M4NU5 <31220123+M4NU5@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:42:53 +0000 Subject: [PATCH 1/4] feat(web): sort, filter and group linked pull requests by status so drafts and open work stay on top Co-Authored-By: Claude Opus 5.5 --- .../pullRequest/ThreadPullRequestsPanel.tsx | 227 +++++++++++++++--- .../threadPullRequestsView.logic.test.ts | 120 +++++++++ .../threadPullRequestsView.logic.ts | 164 +++++++++++++ packages/contracts/src/settings.ts | 18 ++ 4 files changed, 496 insertions(+), 33 deletions(-) create mode 100644 apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts create mode 100644 apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts diff --git a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx index 4b1ccae1597a0..fc309999d322b 100644 --- a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx +++ b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx @@ -1,11 +1,17 @@ -import type { ProjectId, ScopedThreadRef, ThreadPullRequestLink } from "@t3tools/contracts"; +import { + DEFAULT_CLIENT_SETTINGS, + type LinkedPullRequestSort, + type LinkedPullRequestStatus, + type ProjectId, + type ScopedThreadRef, + type ThreadPullRequestLink, +} from "@t3tools/contracts"; import { sourceControlClients, UNKNOWN_SOURCE_CONTROL_CLIENT, } from "@t3tools/client-runtime/source-control-clients"; import { type PullRequestListLine, - pullRequestListLines, resolveThreadPullRequestChains, visibleThreadPullRequests, } from "@t3tools/client-runtime/thread-pull-requests"; @@ -14,6 +20,7 @@ import { EyeIcon, EyeOffIcon, LinkIcon, + ListFilterIcon, MoreHorizontalIcon, PlusIcon, } from "lucide-react"; @@ -25,6 +32,7 @@ import { encodePullRequestDragPayload, } from "~/components/chat/composerMentionDrag"; import { writeTextToClipboard } from "~/hooks/useCopyToClipboard"; +import { updateClientSettings, useClientSettings } from "~/hooks/useSettings"; import { findProjectForChangeRequest } from "@t3tools/client-runtime/change-request-links"; import { useOpenPrLink } from "~/lib/openPullRequestLink"; import { cn } from "~/lib/utils"; @@ -36,7 +44,20 @@ import { threadEnvironment } from "~/state/threads"; import { useAtomCommand } from "~/state/use-atom-command"; import { RelativeTime } from "~/components/RelativeTime"; import { Button } from "../ui/button"; -import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; +import { + Menu, + MenuCheckboxItem, + MenuGroup, + MenuGroupLabel, + MenuItem, + MenuPopup, + MenuRadioGroup, + MenuRadioItem, + MenuRadioItemIndicator, + MenuSeparator, + MenuTrigger, +} from "../ui/menu"; +import { Separator } from "../ui/separator"; import { MiddleTruncate } from "../ui/middle-truncate"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { openLinkPullRequestDialog } from "./LinkPullRequestDialog"; @@ -51,11 +72,20 @@ import { import { PullRequestDiffStat, PullRequestReviewDecisionGlyph, + PullRequestStateGlyph, pullRequestChecksStatePresentation, } from "./pullRequestPresentation"; import { PullRequestGlyph } from "./pullRequestIcons"; import { pullRequestQuickActions } from "./pullRequestList.logic"; import { PullRequestSpeedActions, PullRequestSpeedModeContext } from "./PullRequestSpeedActions"; +import { + LINKED_PULL_REQUEST_STATUS_LABELS, + LINKED_PULL_REQUEST_STATUS_ORDER, + type LinkedPullRequestRow, + type LinkedPullRequestView, + linkedPullRequestRows, + linkedPullRequestStatus, +} from "./threadPullRequestsView.logic"; const SOURCE_LABELS: Record = { manual: "Linked by you", @@ -87,6 +117,8 @@ function ChecksGlyph({ function LinkRowImpl({ line, + position, + dimmed, threadRef, projectId, speedMode, @@ -94,6 +126,8 @@ function LinkRowImpl({ onSetWatching, }: { line: PullRequestListLine; + position: number | null; + dimmed: boolean; threadRef: ScopedThreadRef; projectId: ProjectId | null; speedMode: boolean; @@ -130,7 +164,7 @@ function LinkRowImpl({ actionEntry !== null && pullRequestQuickActions(actionEntry, linkHostActions).length > 0; return (
{ event.preventDefault(); event.stopPropagation(); @@ -241,7 +275,7 @@ function LinkRowImpl({ } > - {stack.size} + {position === null ? stack.size : `${position}/${stack.size}`} {stack.kind === "native" @@ -358,8 +392,102 @@ function latestSyncedAt(links: ReadonlyArray): string | n return latest; } -const lineKey = (line: PullRequestListLine) => - `${line.link.host}/${line.link.repository}#${line.link.number}`; +const SORT_LABELS: Record = { + status: "Status", + updated: "Recently updated", + linked: "Recently linked", + repository: "Repository", +}; + +function LinkedPullRequestViewMenu({ + view, + counts, +}: { + view: LinkedPullRequestView; + counts: ReadonlyMap; +}) { + return ( + + }> + + {SORT_LABELS[view.sort]} + + + + void updateClientSettings({ linkedPullRequestSort: next as LinkedPullRequestSort }) + } + > + Sort by + {(Object.keys(SORT_LABELS) as Array).map((sort) => ( + + + {SORT_LABELS[sort]} + + + + ))} + + + + Status + {LINKED_PULL_REQUEST_STATUS_ORDER.map((status) => ( + + void updateClientSettings({ + linkedPullRequestHiddenStatuses: checked + ? view.hiddenStatuses.filter((hidden) => hidden !== status) + : [...view.hiddenStatuses, status], + }) + } + > + + + + {LINKED_PULL_REQUEST_STATUS_LABELS[status]} + + + {counts.get(status) ?? 0} + + + + ))} + + void updateClientSettings({ linkedPullRequestGroupStacks: checked }) + } + > + + + Group stacks + + + + + + void updateClientSettings({ + linkedPullRequestSort: DEFAULT_CLIENT_SETTINGS.linkedPullRequestSort, + linkedPullRequestHiddenStatuses: + DEFAULT_CLIENT_SETTINGS.linkedPullRequestHiddenStatuses, + linkedPullRequestGroupStacks: DEFAULT_CLIENT_SETTINGS.linkedPullRequestGroupStacks, + }) + } + > + Reset to default + + + + ); +} export function ThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThreadRef }) { const configs = useServerConfigs(); @@ -382,9 +510,18 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread .toSorted((left, right) => left.id === thread?.projectId ? -1 : right.id === thread?.projectId ? 1 : 0, ); - // Derive lines before later hooks to preserve compiler caching and avoid LegendList renders. + const sort = useClientSettings((settings) => settings.linkedPullRequestSort); + const hiddenStatuses = useClientSettings((settings) => settings.linkedPullRequestHiddenStatuses); + const groupStacks = useClientSettings((settings) => settings.linkedPullRequestGroupStacks); + const view = { sort, hiddenStatuses, groupStacks }; + // Derive rows before later hooks to preserve compiler caching and avoid LegendList renders. const links = visibleThreadPullRequests(thread?.pullRequests ?? []); - const lines = pullRequestListLines(resolveThreadPullRequestChains(links)); + const rows = linkedPullRequestRows(resolveThreadPullRequestChains(links), view); + const statusCounts = new Map(); + for (const link of links) { + const status = linkedPullRequestStatus(link); + statusCounts.set(status, (statusCounts.get(status) ?? 0) + 1); + } const openCount = links.filter( (link) => link.snapshot === null || link.snapshot.state === "open", ).length; @@ -447,32 +584,53 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread
{/* Threads that run a stack or a sweep link hundreds of pull requests; only the rows in view are mounted. */} - - data={lines} - keyExtractor={lineKey} + + data={rows} + keyExtractor={(row) => row.key} + getItemType={(row) => row.kind} extraData={rowInputs} - renderItem={({ item: line }) => ( - - )} + renderItem={({ item: row }) => + row.kind === "header" ? ( +
+

{row.label}

+ {row.count} + +
+ ) : row.kind === "hidden" ? ( +
+ +
+ ) : ( + + ) + } estimatedItemSize={44} drawDistance={440} className="min-h-0 flex-1 overscroll-contain p-1.5" />
- + {openCount} open · {linkCount} linked {lastSynced ? ( <> @@ -481,10 +639,13 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread ) : null} - + + + +
diff --git a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts new file mode 100644 index 0000000000000..94e7f2766d4b4 --- /dev/null +++ b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts @@ -0,0 +1,120 @@ +import { ThreadPullRequestLink } from "@t3tools/contracts"; +import type { ThreadPullRequestChain } from "@t3tools/client-runtime/thread-pull-requests"; +import { Schema } from "effect"; +import { describe, expect, it } from "vite-plus/test"; + +import { type LinkedPullRequestView, linkedPullRequestRows } from "./threadPullRequestsView.logic"; + +const decodeLink = Schema.decodeUnknownSync(ThreadPullRequestLink); + +function link( + number: number, + status: "draft" | "open" | "merged" | "closed", + updatedAt: string, + repository = "acme/web", +) { + return decodeLink({ + host: "github.com", + repository, + number, + url: `https://github.com/${repository}/pull/${number}`, + source: "agent", + linkedAt: "2026-11-01T00:00:00Z", + stack: null, + snapshot: { + state: status === "draft" ? "open" : status, + isDraft: status === "draft", + title: `PR ${number}`, + headBranch: `branch-${number}`, + baseBranch: "main", + updatedAt, + syncedAt: updatedAt, + }, + }); +} + +const single = (pr: ThreadPullRequestLink): ThreadPullRequestChain => ({ + kind: "derived", + layers: [pr], + depths: [0], +}); + +const DEFAULT_VIEW: LinkedPullRequestView = { + sort: "status", + hiddenStatuses: ["closed"], + groupStacks: true, +}; + +// Base #1 and #2 merged, #3 still open on top. +const stack: ThreadPullRequestChain = { + kind: "native", + layers: [ + link(1, "merged", "2026-11-01T01:00:00Z"), + link(2, "merged", "2026-11-01T02:00:00Z"), + link(3, "open", "2026-11-01T03:00:00Z"), + ], + depths: [0, 1, 2], +}; + +const summarize = (rows: ReturnType) => + rows.map((row) => + row.kind === "header" + ? `[${row.label} ${row.count}]` + : row.kind === "hidden" + ? `(${row.count} hidden)` + : `#${row.line.link.number}${row.position === null ? "" : ` ${row.position}/${row.line.stack?.size}`}${row.dimmed ? " dim" : ""}`, + ); + +describe("linkedPullRequestRows", () => { + it("groups by status from draft to merged and hides closed by default", () => { + const chains = [ + single(link(10, "merged", "2026-11-02T00:00:00Z")), + single(link(11, "open", "2026-11-02T01:00:00Z")), + single(link(12, "closed", "2026-11-02T02:00:00Z")), + single(link(13, "draft", "2026-11-02T03:00:00Z")), + single(link(14, "open", "2026-11-02T04:00:00Z")), + ]; + expect(summarize(linkedPullRequestRows(chains, DEFAULT_VIEW))).toEqual([ + "[Draft 1]", + "#13", + "[Open 2]", + "#14", + "#11", + "[Merged 1]", + "#10", + "(1 hidden)", + ]); + }); + + it("keeps a grouped stack with its least finished layer and dims finished layers", () => { + const chains = [single(link(20, "merged", "2026-11-02T00:00:00Z")), stack]; + expect(summarize(linkedPullRequestRows(chains, DEFAULT_VIEW))).toEqual([ + "[Open 3]", + "#1 dim", + "#2 dim", + "#3", + "[Merged 1]", + "#20", + ]); + expect( + summarize(linkedPullRequestRows(chains, { ...DEFAULT_VIEW, hiddenStatuses: ["open"] })), + ).toEqual(["[Merged 4]", "#20", "#1", "#2", "#3 dim"]); + }); + + it("flattens stacks into their own status groups with each layer's position", () => { + expect( + summarize(linkedPullRequestRows([stack], { ...DEFAULT_VIEW, groupStacks: false })), + ).toEqual(["[Open 1]", "#3 3/3", "[Merged 2]", "#2 2/3", "#1 1/3"]); + }); + + it("groups by repository and sorts newest first inside each group", () => { + const chains = [ + single(link(30, "open", "2026-11-02T00:00:00Z", "acme/web")), + single(link(31, "open", "2026-11-02T01:00:00Z", "acme/api")), + single(link(32, "merged", "2026-11-02T02:00:00Z", "acme/web")), + ]; + expect( + summarize(linkedPullRequestRows(chains, { ...DEFAULT_VIEW, sort: "repository" })), + ).toEqual(["[acme/api 1]", "#31", "[acme/web 2]", "#32", "#30"]); + }); +}); diff --git a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts new file mode 100644 index 0000000000000..0e4f423e17458 --- /dev/null +++ b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts @@ -0,0 +1,164 @@ +import type { + LinkedPullRequestSort, + LinkedPullRequestStatus, + ThreadPullRequestLink, +} from "@t3tools/contracts"; +import type { + PullRequestListLine, + ThreadPullRequestChain, +} from "@t3tools/client-runtime/thread-pull-requests"; + +export const LINKED_PULL_REQUEST_STATUS_ORDER: ReadonlyArray = [ + "draft", + "open", + "merged", + "closed", +]; + +export const LINKED_PULL_REQUEST_STATUS_LABELS: Record = { + draft: "Draft", + open: "Open", + merged: "Merged", + closed: "Closed", +}; + +export interface LinkedPullRequestView { + readonly sort: LinkedPullRequestSort; + readonly hiddenStatuses: ReadonlyArray; + readonly groupStacks: boolean; +} + +export type LinkedPullRequestRow = + | { + readonly kind: "header"; + readonly key: string; + readonly label: string; + readonly count: number; + } + | { + readonly kind: "line"; + readonly key: string; + readonly line: PullRequestListLine; + /** 1-based place in its stack when stacks are flattened. */ + readonly position: number | null; + readonly dimmed: boolean; + } + | { readonly kind: "hidden"; readonly key: string; readonly count: number }; + +export function linkedPullRequestStatus(link: ThreadPullRequestLink): LinkedPullRequestStatus { + const snapshot = link.snapshot; + if (snapshot === null) return "open"; + if (snapshot.state === "open") return snapshot.isDraft ? "draft" : "open"; + return snapshot.state; +} + +const rank = (link: ThreadPullRequestLink) => + LINKED_PULL_REQUEST_STATUS_ORDER.indexOf(linkedPullRequestStatus(link)); + +function timeOf(value: string | null | undefined): number { + const ms = value ? Date.parse(value) : Number.NaN; + return Number.isNaN(ms) ? 0 : ms; +} + +const linkKey = (link: ThreadPullRequestLink) => `${link.host}/${link.repository}#${link.number}`; + +interface Unit { + readonly chain: ThreadPullRequestChain; + readonly key: string; + readonly rank: number; + readonly repository: string; + readonly updatedAt: number; + readonly linkedAt: number; + /** Set when a stack is flattened into one unit per layer. */ + readonly layerOf: { readonly position: number; readonly size: number } | null; +} + +export function linkedPullRequestRows( + chains: ReadonlyArray, + view: LinkedPullRequestView, +): ReadonlyArray { + const hidden = new Set(view.hiddenStatuses); + const isHidden = (link: ThreadPullRequestLink) => hidden.has(linkedPullRequestStatus(link)); + const units: Array = []; + let hiddenCount = 0; + const addUnit = (chain: ThreadPullRequestChain, layerOf: Unit["layerOf"]) => { + const shown = chain.layers.filter((link) => !isHidden(link)); + if (shown.length === 0) { + hiddenCount += chain.layers.length; + return; + } + const base = chain.layers[0]!; + units.push({ + chain, + key: linkKey(base), + // A stack sorts with its least finished visible layer. + rank: Math.min(...shown.map(rank)), + repository: `${base.host}/${base.repository}`, + updatedAt: Math.max( + ...chain.layers.map((link) => timeOf(link.snapshot?.updatedAt ?? link.linkedAt)), + ), + linkedAt: Math.max(...chain.layers.map((link) => timeOf(link.linkedAt))), + layerOf, + }); + }; + for (const chain of chains) { + if (view.groupStacks || chain.layers.length === 1) { + addUnit(chain, null); + continue; + } + chain.layers.forEach((link, index) => + addUnit( + { kind: chain.kind, layers: [link], depths: [0] }, + { position: index + 1, size: chain.layers.length }, + ), + ); + } + + const byUpdated = (left: Unit, right: Unit) => right.updatedAt - left.updatedAt; + const compare: Record number> = { + status: (left, right) => left.rank - right.rank || byUpdated(left, right), + updated: byUpdated, + linked: (left, right) => right.linkedAt - left.linkedAt, + repository: (left, right) => + left.repository.localeCompare(right.repository) || byUpdated(left, right), + }; + units.sort(compare[view.sort]); + + const groupOf = (unit: Unit): { key: string; label: string } | null => + view.sort === "status" + ? { + key: LINKED_PULL_REQUEST_STATUS_ORDER[unit.rank]!, + label: LINKED_PULL_REQUEST_STATUS_LABELS[LINKED_PULL_REQUEST_STATUS_ORDER[unit.rank]!], + } + : view.sort === "repository" + ? { key: unit.repository, label: unit.repository.slice(unit.repository.indexOf("/") + 1) } + : null; + + const rows: Array = []; + let header: { kind: "header"; key: string; label: string; count: number } | null = null; + for (const unit of units) { + const group = groupOf(unit); + if (group !== null && header?.key !== `header:${group.key}`) { + header = { kind: "header", key: `header:${group.key}`, label: group.label, count: 0 }; + rows.push(header); + } + if (header !== null) header.count += unit.chain.layers.length; + const size = unit.layerOf?.size ?? unit.chain.layers.length; + unit.chain.layers.forEach((link, index) => { + rows.push({ + kind: "line", + key: linkKey(link), + line: { + link, + depth: unit.chain.depths[index]!, + chainKey: unit.key, + stack: index === 0 && size > 1 ? { kind: unit.chain.kind, size } : null, + }, + position: unit.layerOf?.position ?? null, + dimmed: isHidden(link) || rank(link) > unit.rank, + }); + }); + } + if (hiddenCount > 0) rows.push({ kind: "hidden", key: "hidden", count: hiddenCount }); + return rows; +} diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 798e076495a95..c57e99eddcec5 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -60,6 +60,12 @@ export const DiffLayout = Schema.Literals(["stacked", "split"]); export type DiffLayout = typeof DiffLayout.Type; const DEFAULT_DIFF_LAYOUT: DiffLayout = "stacked"; +export const LinkedPullRequestSort = Schema.Literals(["status", "updated", "linked", "repository"]); +export type LinkedPullRequestSort = typeof LinkedPullRequestSort.Type; + +export const LinkedPullRequestStatus = Schema.Literals(["draft", "open", "merged", "closed"]); +export type LinkedPullRequestStatus = typeof LinkedPullRequestStatus.Type; + export const SidebarProjectSortOrder = Schema.Literals(["updated_at", "created_at", "manual"]); export type SidebarProjectSortOrder = typeof SidebarProjectSortOrder.Type; export const DEFAULT_SIDEBAR_PROJECT_SORT_ORDER: SidebarProjectSortOrder = "updated_at"; @@ -422,6 +428,15 @@ export const ClientSettingsSchema = Schema.Struct({ diffFilesCollapsed: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), diffIgnoreWhitespace: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), diffLayout: DiffLayout.pipe(Schema.withDecodingDefault(Effect.succeed(DEFAULT_DIFF_LAYOUT))), + linkedPullRequestSort: LinkedPullRequestSort.pipe( + Schema.withDecodingDefault(Effect.succeed("status" as const)), + ), + linkedPullRequestHiddenStatuses: Schema.Array(LinkedPullRequestStatus).pipe( + Schema.withDecodingDefault(Effect.succeed(["closed" as const])), + ), + linkedPullRequestGroupStacks: Schema.Boolean.pipe( + Schema.withDecodingDefault(Effect.succeed(true)), + ), environmentIdentificationMode: EnvironmentIdentificationMode.pipe( Schema.withDecodingDefault(Effect.succeed(DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE)), ), @@ -1792,6 +1807,9 @@ export const ClientSettingsPatch = Schema.Struct({ diffFilesCollapsed: Schema.optionalKey(Schema.Boolean), diffIgnoreWhitespace: Schema.optionalKey(Schema.Boolean), diffLayout: Schema.optionalKey(DiffLayout), + linkedPullRequestSort: Schema.optionalKey(LinkedPullRequestSort), + linkedPullRequestHiddenStatuses: Schema.optionalKey(Schema.Array(LinkedPullRequestStatus)), + linkedPullRequestGroupStacks: Schema.optionalKey(Schema.Boolean), environmentIdentificationMode: Schema.optionalKey(EnvironmentIdentificationMode), glassOpacity: Schema.optionalKey(GlassOpacity), onboardingCompletedAt: Schema.optionalKey(Schema.NullOr(Schema.String)), From a3a7313fd5ae20c41fdc8968de82b9eb37900271 Mon Sep 17 00:00:00 2001 From: M4NU5 <31220123+M4NU5@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:27:19 +0000 Subject: [PATCH 2/4] fix(web): keep open layers undimmed in a stack that has a draft, since only finished layers should fade Co-Authored-By: Claude Opus 5.5 --- .../pullRequest/threadPullRequestsView.logic.test.ts | 10 ++++++++++ .../pullRequest/threadPullRequestsView.logic.ts | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts index 94e7f2766d4b4..1d445a0b5780a 100644 --- a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts +++ b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.test.ts @@ -99,6 +99,16 @@ describe("linkedPullRequestRows", () => { expect( summarize(linkedPullRequestRows(chains, { ...DEFAULT_VIEW, hiddenStatuses: ["open"] })), ).toEqual(["[Merged 4]", "#20", "#1", "#2", "#3 dim"]); + const draftStack: ThreadPullRequestChain = { + kind: "native", + layers: [link(4, "open", "2026-11-01T01:00:00Z"), link(5, "draft", "2026-11-01T02:00:00Z")], + depths: [0, 1], + }; + expect(summarize(linkedPullRequestRows([draftStack], DEFAULT_VIEW))).toEqual([ + "[Draft 2]", + "#4", + "#5", + ]); }); it("flattens stacks into their own status groups with each layer's position", () => { diff --git a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts index 0e4f423e17458..61e37a54f42de 100644 --- a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts +++ b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts @@ -52,6 +52,9 @@ export function linkedPullRequestStatus(link: ThreadPullRequestLink): LinkedPull return snapshot.state; } +const isOpen = (link: ThreadPullRequestLink) => + link.snapshot === null || link.snapshot.state === "open"; + const rank = (link: ThreadPullRequestLink) => LINKED_PULL_REQUEST_STATUS_ORDER.indexOf(linkedPullRequestStatus(link)); @@ -155,7 +158,7 @@ export function linkedPullRequestRows( stack: index === 0 && size > 1 ? { kind: unit.chain.kind, size } : null, }, position: unit.layerOf?.position ?? null, - dimmed: isHidden(link) || rank(link) > unit.rank, + dimmed: isHidden(link) || (rank(link) > unit.rank && !isOpen(link)), }); }); } From 09856b4ee1f3041ae5bff1db8291f1b2bf8240c9 Mon Sep 17 00:00:00 2001 From: maria-rcks Date: Wed, 18 Nov 2026 08:37:43 +0000 Subject: [PATCH 3/4] fix(web): translate linked pull request view labels --- .../pullRequest/ThreadPullRequestsPanel.tsx | 19 +++++++++++-------- .../threadPullRequestsView.logic.ts | 9 +++++---- apps/web/src/i18n/translations/de.json | 7 ++++++- apps/web/src/i18n/translations/en.json | 7 ++++++- apps/web/src/i18n/translations/es.json | 7 ++++++- apps/web/src/i18n/translations/fr.json | 7 ++++++- apps/web/src/i18n/translations/ja.json | 7 ++++++- apps/web/src/i18n/translations/ko.json | 7 ++++++- apps/web/src/i18n/translations/pt-BR.json | 7 ++++++- apps/web/src/i18n/translations/ru.json | 7 ++++++- apps/web/src/i18n/translations/sv.json | 7 ++++++- apps/web/src/i18n/translations/zh.json | 7 ++++++- 12 files changed, 76 insertions(+), 22 deletions(-) diff --git a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx index be5c1fa823918..ea5470f3d22ca 100644 --- a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx +++ b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx @@ -433,10 +433,10 @@ function latestSyncedAt(links: ReadonlyArray): string | n } const SORT_LABELS: Record = { - status: "Status", - updated: "Recently updated", - linked: "Recently linked", - repository: "Repository", + status: msg("Status"), + updated: msg("Recently updated"), + linked: msg("Recently linked"), + repository: msg("Repository"), }; function LinkedPullRequestViewMenu({ @@ -446,11 +446,12 @@ function LinkedPullRequestViewMenu({ view: LinkedPullRequestView; counts: ReadonlyMap; }) { + const resolve = useMessages(); return ( }> - {SORT_LABELS[view.sort]} + {resolve(SORT_LABELS[view.sort])} ).map((sort) => ( - {SORT_LABELS[sort]} + {resolve(SORT_LABELS[sort])} @@ -494,7 +495,7 @@ function LinkedPullRequestViewMenu({ isDraft={status === "draft"} /> - {LINKED_PULL_REQUEST_STATUS_LABELS[status]} + {resolve(LINKED_PULL_REQUEST_STATUS_LABELS[status])} {counts.get(status) ?? 0} @@ -549,6 +550,7 @@ export function ThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThreadRef }) { const gt = useGT(); + const resolve = useMessages(); const thread = useThreadShell(threadRef); const projects = useProjects(); const environmentProjects = projects @@ -646,6 +648,7 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread thread, opensInApp, primaryEnvironmentId, + resolve, }; if (linkCount === 0) { @@ -682,7 +685,7 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread renderItem={({ item: row }) => row.kind === "header" ? (
-

{row.label}

+

{sort === "status" ? resolve(row.label) : row.label}

{row.count}
diff --git a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts index 61e37a54f42de..94f4a9c3be167 100644 --- a/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts +++ b/apps/web/src/components/pullRequest/threadPullRequestsView.logic.ts @@ -1,3 +1,4 @@ +import { msg } from "gt-react"; import type { LinkedPullRequestSort, LinkedPullRequestStatus, @@ -16,10 +17,10 @@ export const LINKED_PULL_REQUEST_STATUS_ORDER: ReadonlyArray = { - draft: "Draft", - open: "Open", - merged: "Merged", - closed: "Closed", + draft: msg("Draft"), + open: msg("Open"), + merged: msg("Merged"), + closed: msg("Closed"), }; export interface LinkedPullRequestView { diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 6b69e9682a416..0585dff0d4eb3 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -6970,6 +6970,8 @@ "2b91e67b513c524e": "Vom Agenten verknüpft", "29a3741379160657": "Im Stack gefunden", "c39dd238b84966bd": "Verworfen", + "21d0ef064eefa159": "Status", + "79fcc1b620b652bf": "Kürzlich verknüpft", "50fdb607048e425a": "Warte auf Status des Hosts", "1e64c95da299ca6c": "Beobachtet", "b07208f457872b13": "{host}-Stack aus {size}: Das Mergen einer Ebene übernimmt die darunterliegenden.", @@ -7073,6 +7075,10 @@ "9a8fd03416860d24": "PRs mit Review-Anfrage an mich", "26de318a087aa5ba": "Die Stack-Daten sind möglicherweise veraltet. Wir konnten sie nicht aktualisieren.", "a1784dea82c2c283": "Stack wird aktualisiert… Gespeicherte Daten werden angezeigt.", + "e0b196715ec7a4a6": "Entwurf", + "b2be70822d55f16a": "Offen", + "2f8f985531c0c748": "Zusammengeführt", + "7f7f6116f1c8f3a9": "Geschlossen", "731b95ffeba539c2": "Merge angefordert", "646b611650064cb9": "Als bereit für Review markiert", "a35d421d18e5fa87": "In Entwurf umgewandelt", @@ -8939,7 +8945,6 @@ "aea940c95ef946b1": "{provider} aktivieren", "74abd6f7968e9fe0": "Instanz {instanceId} löschen", "eee76b40711fd902": "Treiber", - "21d0ef064eefa159": "Status", "f31ce60f3f118c0d": "Anzeigename", "c45028de5c2f6cbb": "Instanzbezeichnung", "cf69675106e4bf46": "Einrichtung", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index c43717473cda5..e492a300e1b9e 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -6978,6 +6978,8 @@ "2b91e67b513c524e": "Linked by the agent", "29a3741379160657": "Found in the stack", "c39dd238b84966bd": "Dismissed", + "21d0ef064eefa159": "Status", + "79fcc1b620b652bf": "Recently linked", "50fdb607048e425a": "Waiting for host state", "1e64c95da299ca6c": "Watching", "b07208f457872b13": "{host} stack of {size}: merging a layer lands the ones below it.", @@ -7081,6 +7083,10 @@ "9a8fd03416860d24": "PRs Requesting My Review", "26de318a087aa5ba": "Stack data may be stale. We couldn’t refresh it.", "a1784dea82c2c283": "Refreshing stack… Showing saved data.", + "e0b196715ec7a4a6": "Draft", + "b2be70822d55f16a": "Open", + "2f8f985531c0c748": "Merged", + "7f7f6116f1c8f3a9": "Closed", "731b95ffeba539c2": "Merge requested", "646b611650064cb9": "Marked ready for review", "a35d421d18e5fa87": "Converted to draft", @@ -8947,7 +8953,6 @@ "aea940c95ef946b1": "Enable {provider}", "74abd6f7968e9fe0": "Delete instance {instanceId}", "eee76b40711fd902": "Driver", - "21d0ef064eefa159": "Status", "f31ce60f3f118c0d": "Display name", "c45028de5c2f6cbb": "Instance label", "cf69675106e4bf46": "Setup", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 3f39d5d774e04..c8f85d5231296 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -6971,6 +6971,8 @@ "2b91e67b513c524e": "Vinculada por el agente", "29a3741379160657": "Encontrada en la pila", "c39dd238b84966bd": "Descartada", + "21d0ef064eefa159": "Estado", + "79fcc1b620b652bf": "Vinculadas recientemente", "50fdb607048e425a": "Esperando el estado del host", "1e64c95da299ca6c": "Siguiendo", "b07208f457872b13": "Pila de {size} en {host}: fusionar una capa integra las que están debajo.", @@ -7074,6 +7076,10 @@ "9a8fd03416860d24": "PR que solicitan mi revisión", "26de318a087aa5ba": "Puede que los datos de la pila estén desactualizados. No pudimos actualizarlos.", "a1784dea82c2c283": "Actualizando la pila… Se muestran los datos guardados.", + "e0b196715ec7a4a6": "Borrador", + "b2be70822d55f16a": "Abierta", + "2f8f985531c0c748": "Fusionada", + "7f7f6116f1c8f3a9": "Cerrada", "731b95ffeba539c2": "Fusión solicitada", "646b611650064cb9": "Marcada como lista para revisión", "a35d421d18e5fa87": "Convertida en borrador", @@ -8937,7 +8943,6 @@ "aea940c95ef946b1": "Activar {provider}", "74abd6f7968e9fe0": "Eliminar la instancia {instanceId}", "eee76b40711fd902": "Controlador", - "21d0ef064eefa159": "Estado", "f31ce60f3f118c0d": "Nombre visible", "c45028de5c2f6cbb": "Etiqueta de la instancia", "cf69675106e4bf46": "Configuración", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 943a032a8fd40..e0bfc48943b1a 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -6972,6 +6972,8 @@ "2b91e67b513c524e": "Associée par l’agent", "29a3741379160657": "Trouvée dans la pile", "c39dd238b84966bd": "Écartée", + "21d0ef064eefa159": "Statut", + "79fcc1b620b652bf": "Liées récemment", "50fdb607048e425a": "En attente de l’état de l’hôte", "1e64c95da299ca6c": "Surveillance", "b07208f457872b13": "Pile {host} de {size} : fusionner une couche intègre aussi celles du dessous.", @@ -7075,6 +7077,10 @@ "9a8fd03416860d24": "PR qui demandent ma revue", "26de318a087aa5ba": "Les données de la pile sont peut-être obsolètes. Nous n’avons pas pu les actualiser.", "a1784dea82c2c283": "Actualisation de la pile… Affichage des données enregistrées.", + "e0b196715ec7a4a6": "Brouillon", + "b2be70822d55f16a": "Ouverte", + "2f8f985531c0c748": "Fusionnée", + "7f7f6116f1c8f3a9": "Fermée", "731b95ffeba539c2": "Fusion demandée", "646b611650064cb9": "Marquée comme prête pour la revue", "a35d421d18e5fa87": "Convertie en brouillon", @@ -8939,7 +8945,6 @@ "aea940c95ef946b1": "Activer {provider}", "74abd6f7968e9fe0": "Supprimer l’instance {instanceId}", "eee76b40711fd902": "Pilote", - "21d0ef064eefa159": "Statut", "f31ce60f3f118c0d": "Nom affiché", "c45028de5c2f6cbb": "Libellé de l’instance", "cf69675106e4bf46": "Configuration", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 45f0e46e0319f..2f8ca02f905cc 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -6938,6 +6938,8 @@ "2b91e67b513c524e": "エージェントがリンク", "29a3741379160657": "スタックで検出", "c39dd238b84966bd": "除外済み", + "21d0ef064eefa159": "ステータス", + "79fcc1b620b652bf": "最近リンクした順", "50fdb607048e425a": "ホストの状態を待っています", "1e64c95da299ca6c": "ウォッチ中", "b07208f457872b13": "{size} 件の {host} スタック: レイヤーをマージすると、その下のレイヤーも取り込まれます。", @@ -7041,6 +7043,10 @@ "9a8fd03416860d24": "自分にレビューがリクエストされた PR", "26de318a087aa5ba": "スタックのデータが古い可能性があります。更新できませんでした。", "a1784dea82c2c283": "スタックを更新しています… 保存されたデータを表示しています。", + "e0b196715ec7a4a6": "下書き", + "b2be70822d55f16a": "オープン", + "2f8f985531c0c748": "マージ済み", + "7f7f6116f1c8f3a9": "クローズ済み", "731b95ffeba539c2": "マージをリクエストしました", "646b611650064cb9": "レビューの準備完了にしました", "a35d421d18e5fa87": "下書きに変換しました", @@ -8895,7 +8901,6 @@ "aea940c95ef946b1": "{provider} を有効にする", "74abd6f7968e9fe0": "インスタンス {instanceId} を削除", "eee76b40711fd902": "ドライバー", - "21d0ef064eefa159": "ステータス", "f31ce60f3f118c0d": "表示名", "c45028de5c2f6cbb": "インスタンスのラベル", "cf69675106e4bf46": "セットアップ", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index e4c3a56434af6..c876429141aa2 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -6941,6 +6941,8 @@ "2b91e67b513c524e": "에이전트가 연결함", "29a3741379160657": "스택에서 발견됨", "c39dd238b84966bd": "무시됨", + "21d0ef064eefa159": "상태", + "79fcc1b620b652bf": "최근 연결순", "50fdb607048e425a": "호스트 상태 대기 중", "1e64c95da299ca6c": "지켜보는 중", "b07208f457872b13": "{host} 스택({size}개): 레이어를 병합하면 그 아래 레이어도 함께 반영됩니다.", @@ -7044,6 +7046,10 @@ "9a8fd03416860d24": "내 검토를 요청한 PR", "26de318a087aa5ba": "스택 데이터가 오래되었을 수 있습니다. 새로 고칠 수 없었습니다.", "a1784dea82c2c283": "스택 새로 고치는 중… 저장된 데이터를 표시합니다.", + "e0b196715ec7a4a6": "초안", + "b2be70822d55f16a": "열림", + "2f8f985531c0c748": "병합됨", + "7f7f6116f1c8f3a9": "닫힘", "731b95ffeba539c2": "병합 요청됨", "646b611650064cb9": "검토 준비 완료로 표시됨", "a35d421d18e5fa87": "초안으로 변환됨", @@ -8897,7 +8903,6 @@ "aea940c95ef946b1": "{provider} 사용", "74abd6f7968e9fe0": "인스턴스 {instanceId} 삭제", "eee76b40711fd902": "드라이버", - "21d0ef064eefa159": "상태", "f31ce60f3f118c0d": "표시 이름", "c45028de5c2f6cbb": "인스턴스 레이블", "cf69675106e4bf46": "설정", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 3d2c7798eff4c..470404551e03c 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -6971,6 +6971,8 @@ "2b91e67b513c524e": "Vinculado pelo agente", "29a3741379160657": "Encontrado na pilha", "c39dd238b84966bd": "Dispensado", + "21d0ef064eefa159": "Status", + "79fcc1b620b652bf": "Vinculadas recentemente", "50fdb607048e425a": "Aguardando o estado do host", "1e64c95da299ca6c": "Acompanhando", "b07208f457872b13": "Pilha de {size} no {host}: mesclar uma camada também integra as que estão abaixo dela.", @@ -7074,6 +7076,10 @@ "9a8fd03416860d24": "PRs que pedem minha revisão", "26de318a087aa5ba": "Os dados da pilha podem estar desatualizados. Não foi possível atualizá-los.", "a1784dea82c2c283": "Atualizando a pilha… Mostrando os dados salvos.", + "e0b196715ec7a4a6": "Rascunho", + "b2be70822d55f16a": "Aberta", + "2f8f985531c0c748": "Mesclada", + "7f7f6116f1c8f3a9": "Fechada", "731b95ffeba539c2": "Merge solicitado", "646b611650064cb9": "Marcado como pronto para revisão", "a35d421d18e5fa87": "Convertido em rascunho", @@ -8938,7 +8944,6 @@ "aea940c95ef946b1": "Ativar {provider}", "74abd6f7968e9fe0": "Excluir a instância {instanceId}", "eee76b40711fd902": "Driver", - "21d0ef064eefa159": "Status", "f31ce60f3f118c0d": "Nome de exibição", "c45028de5c2f6cbb": "Rótulo da instância", "cf69675106e4bf46": "Configuração", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 817f120a83593..c911356c1d123 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -6971,6 +6971,8 @@ "2b91e67b513c524e": "Привязан агентом", "29a3741379160657": "Найден в стеке", "c39dd238b84966bd": "Скрыт", + "21d0ef064eefa159": "Статус", + "79fcc1b620b652bf": "Недавно связанные", "50fdb607048e425a": "Ожидание состояния хоста", "1e64c95da299ca6c": "Отслеживается", "b07208f457872b13": "Стек {host} из {size}: слияние слоя сливает и слои под ним.", @@ -7074,6 +7076,10 @@ "9a8fd03416860d24": "PR, где запрошено моё ревью", "26de318a087aa5ba": "Данные стека могут быть устаревшими. Не удалось их обновить.", "a1784dea82c2c283": "Обновление стека… Показаны сохранённые данные.", + "e0b196715ec7a4a6": "Черновик", + "b2be70822d55f16a": "Открыт", + "2f8f985531c0c748": "Слит", + "7f7f6116f1c8f3a9": "Закрыт", "731b95ffeba539c2": "Слияние запрошено", "646b611650064cb9": "Отмечен как готовый к ревью", "a35d421d18e5fa87": "Переведён в черновик", @@ -8939,7 +8945,6 @@ "aea940c95ef946b1": "Включить {provider}", "74abd6f7968e9fe0": "Удалить экземпляр {instanceId}", "eee76b40711fd902": "Драйвер", - "21d0ef064eefa159": "Статус", "f31ce60f3f118c0d": "Отображаемое имя", "c45028de5c2f6cbb": "Название экземпляра", "cf69675106e4bf46": "Настройка", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index a34f1d905a143..1e8825c2834c7 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -6977,6 +6977,8 @@ "2b91e67b513c524e": "Länkad av agenten", "29a3741379160657": "Hittad i stacken", "c39dd238b84966bd": "Avfärdad", + "21d0ef064eefa159": "Status", + "79fcc1b620b652bf": "Nyligen länkade", "50fdb607048e425a": "Väntar på värdens status", "1e64c95da299ca6c": "Bevakar", "b07208f457872b13": "{host}-stack med {size}: om du mergar ett lager landar de under det.", @@ -7080,6 +7082,10 @@ "9a8fd03416860d24": "PR:er som väntar på min granskning", "26de318a087aa5ba": "Stackdata kan vara inaktuella. Vi kunde inte uppdatera dem.", "a1784dea82c2c283": "Uppdaterar stacken… Visar sparade data.", + "e0b196715ec7a4a6": "Utkast", + "b2be70822d55f16a": "Öppen", + "2f8f985531c0c748": "Sammanslagen", + "7f7f6116f1c8f3a9": "Stängd", "731b95ffeba539c2": "Merge begärd", "646b611650064cb9": "Markerad som redo för granskning", "a35d421d18e5fa87": "Konverterad till utkast", @@ -8945,7 +8951,6 @@ "aea940c95ef946b1": "Aktivera {provider}", "74abd6f7968e9fe0": "Ta bort instansen {instanceId}", "eee76b40711fd902": "Drivrutin", - "21d0ef064eefa159": "Status", "f31ce60f3f118c0d": "Visningsnamn", "c45028de5c2f6cbb": "Instansetikett", "cf69675106e4bf46": "Konfiguration", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index e1b331fa5d545..f543f35ea4cbb 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -6986,6 +6986,8 @@ "2b91e67b513c524e": "由智能体关联", "29a3741379160657": "在堆叠中发现", "c39dd238b84966bd": "已忽略", + "21d0ef064eefa159": "状态", + "79fcc1b620b652bf": "最近关联", "50fdb607048e425a": "等待托管平台状态", "1e64c95da299ca6c": "关注中", "b07208f457872b13": "{host} 堆叠共 {size} 层:合并某一层会同时合并其下方的层。", @@ -7089,6 +7091,10 @@ "9a8fd03416860d24": "请求我审查的 PR", "26de318a087aa5ba": "堆叠数据可能已过期,未能刷新。", "a1784dea82c2c283": "正在刷新堆叠… 当前显示已保存的数据。", + "e0b196715ec7a4a6": "草稿", + "b2be70822d55f16a": "开放", + "2f8f985531c0c748": "已合并", + "7f7f6116f1c8f3a9": "已关闭", "731b95ffeba539c2": "已请求合并", "646b611650064cb9": "已标记为可审查", "a35d421d18e5fa87": "已转为草稿", @@ -8955,7 +8961,6 @@ "aea940c95ef946b1": "启用 {provider}", "74abd6f7968e9fe0": "删除实例 {instanceId}", "eee76b40711fd902": "驱动", - "21d0ef064eefa159": "状态", "f31ce60f3f118c0d": "显示名称", "c45028de5c2f6cbb": "实例标签", "cf69675106e4bf46": "设置", From ea971366ee9d7f49f81f9255ef84a4fd6f705020 Mon Sep 17 00:00:00 2001 From: maria-rcks Date: Wed, 18 Nov 2026 08:51:41 +0000 Subject: [PATCH 4/4] fix(web): preserve queued pull request filters and header layout --- .../pullRequest/ThreadPullRequestsPanel.tsx | 40 +++++++++++++------ apps/web/src/i18n/translations/de.json | 9 +---- apps/web/src/i18n/translations/en.json | 9 +---- apps/web/src/i18n/translations/es.json | 9 +---- apps/web/src/i18n/translations/fr.json | 9 +---- apps/web/src/i18n/translations/ja.json | 9 +---- apps/web/src/i18n/translations/ko.json | 9 +---- apps/web/src/i18n/translations/pt-BR.json | 9 +---- apps/web/src/i18n/translations/ru.json | 9 +---- apps/web/src/i18n/translations/sv.json | 9 +---- apps/web/src/i18n/translations/zh.json | 9 +---- 11 files changed, 38 insertions(+), 92 deletions(-) diff --git a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx index ea5470f3d22ca..346b7956927a8 100644 --- a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx +++ b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx @@ -34,7 +34,11 @@ import { encodePullRequestDragPayload, } from "~/components/chat/composerMentionDrag"; import { writeTextToClipboard } from "~/hooks/useCopyToClipboard"; -import { updateClientSettings, useClientSettings } from "~/hooks/useSettings"; +import { + persistClientSettingsUpdate, + updateClientSettings, + useClientSettings, +} from "~/hooks/useSettings"; import { findProjectForChangeRequest } from "@t3tools/client-runtime/change-request-links"; import { pullRequestLinkPanelTarget, useOpenPrLink } from "~/lib/openPullRequestLink"; import { usePrimaryEnvironmentId } from "~/state/environments"; @@ -482,11 +486,12 @@ function LinkedPullRequestViewMenu({ key={status} checked={!view.hiddenStatuses.includes(status)} onCheckedChange={(checked) => - void updateClientSettings({ + void persistClientSettingsUpdate((current) => ({ + ...current, linkedPullRequestHiddenStatuses: checked - ? view.hiddenStatuses.filter((hidden) => hidden !== status) - : [...view.hiddenStatuses, status], - }) + ? current.linkedPullRequestHiddenStatuses.filter((hidden) => hidden !== status) + : [...new Set([...current.linkedPullRequestHiddenStatuses, status])], + })) } > @@ -519,12 +524,13 @@ function LinkedPullRequestViewMenu({ - void updateClientSettings({ + void persistClientSettingsUpdate((current) => ({ + ...current, linkedPullRequestSort: DEFAULT_CLIENT_SETTINGS.linkedPullRequestSort, linkedPullRequestHiddenStatuses: DEFAULT_CLIENT_SETTINGS.linkedPullRequestHiddenStatuses, linkedPullRequestGroupStacks: DEFAULT_CLIENT_SETTINGS.linkedPullRequestGroupStacks, - }) + })) } > Reset to default @@ -685,7 +691,12 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread renderItem={({ item: row }) => row.kind === "header" ? (
-

{sort === "status" ? resolve(row.label) : row.label}

+ + }> + {sort === "status" ? resolve(row.label) : row.label} + + {sort === "status" ? resolve(row.label) : row.label} + {row.count}
@@ -694,11 +705,16 @@ function EnabledThreadPullRequestsPanel({ threadRef }: { threadRef: ScopedThread
) : ( diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 0585dff0d4eb3..74d0886e9cfbe 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -6982,6 +6982,7 @@ "13eb3e529a3e9bff": "Aus dem Thread entfernen", "93cebe7fdcc9821e": "Verknüpfte Pull Requests nicht verfügbar", "47c92b77099a6346": "Diese Umgebung unterstützt nicht mehrere verknüpfte Pull Requests.", + "96a45e508e9ede58": "{count, plural, one {# ausgeblendet} other {# ausgeblendet}} · Alle anzeigen", "e18c90152452a50e": "{openCount, plural, one {{openCount} offen} other {{openCount} offen}} · {linkCount, plural, one {{linkCount} verknüpft} other {{linkCount} verknüpft}}", "106c1bf3308a8c33": "Beobachtet: Der Agent wird geweckt, wenn Checks fertig sind, jemand kommentiert oder der Branch Konflikte hat", "15a560968264b0ed": "Öffnen", @@ -6990,14 +6991,6 @@ "55cffd2c96741220": "Stacks gruppieren", "a4e0e1e0bad3dcd8": "Keine verknüpften Pull Requests", "973b668999e33451": "Pull Requests, die der Agent aus diesem Thread öffnet, landen hier. Verknüpfe selbst einen über URL oder Nummer.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " ausgeblendet · Alle anzeigen" - ], "f034c05267f161ce": [ "synchronisiert", " ", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index e492a300e1b9e..a790c795a1e90 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -6990,6 +6990,7 @@ "13eb3e529a3e9bff": "Dismiss from thread", "93cebe7fdcc9821e": "Linked pull requests unavailable", "47c92b77099a6346": "This environment does not support multiple linked pull requests.", + "96a45e508e9ede58": "{count, plural, one {# hidden} other {# hidden}} · Show all", "e18c90152452a50e": "{openCount, plural, one {{openCount} open} other {{openCount} open}} · {linkCount, plural, one {{linkCount} linked} other {{linkCount} linked}}", "106c1bf3308a8c33": "Watching: the agent wakes when checks finish, someone comments, or the branch conflicts", "15a560968264b0ed": "Open", @@ -6998,14 +6999,6 @@ "55cffd2c96741220": "Group stacks", "a4e0e1e0bad3dcd8": "No linked pull requests", "973b668999e33451": "Pull requests the agent opens from this thread land here. Link one yourself from a URL or a number.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " hidden · Show all" - ], "f034c05267f161ce": [ "synced", " ", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index c8f85d5231296..ce9d333deb4a3 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -6983,6 +6983,7 @@ "13eb3e529a3e9bff": "Descartar del hilo", "93cebe7fdcc9821e": "Pull requests vinculadas no disponibles", "47c92b77099a6346": "Este entorno no admite varias pull requests vinculadas.", + "96a45e508e9ede58": "{count, plural, one {# oculta} other {# ocultas}} · Mostrar todas", "e18c90152452a50e": "{openCount, plural, one {{openCount} abierta} other {{openCount} abiertas}} · {linkCount, plural, one {{linkCount} vinculada} other {{linkCount} vinculadas}}", "106c1bf3308a8c33": "Siguiendo: el agente se activa cuando terminan las comprobaciones, alguien comenta o la rama tiene conflictos", "15a560968264b0ed": "Abrir", @@ -6991,14 +6992,6 @@ "55cffd2c96741220": "Agrupar pilas", "a4e0e1e0bad3dcd8": "No hay pull requests vinculadas", "973b668999e33451": "Aquí llegan las pull requests que el agente abre desde este hilo. Vincula una tú mismo desde una URL o un número.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " ocultas · Mostrar todas" - ], "f034c05267f161ce": [ "sincronizado", " ", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index e0bfc48943b1a..06cf57d3ba119 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -6984,6 +6984,7 @@ "13eb3e529a3e9bff": "Écarter du fil", "93cebe7fdcc9821e": "Pull requests associées indisponibles", "47c92b77099a6346": "Cet environnement ne prend pas en charge plusieurs pull requests associées.", + "96a45e508e9ede58": "{count, plural, one {# masquée} other {# masquées}} · Tout afficher", "e18c90152452a50e": "{openCount, plural, one {{openCount} ouverte} other {{openCount} ouvertes}} · {linkCount, plural, one {{linkCount} associée} other {{linkCount} associées}}", "106c1bf3308a8c33": "Surveillance : l’agent se réveille quand les checks se terminent, que quelqu’un commente ou que la branche entre en conflit", "15a560968264b0ed": "Ouvrir", @@ -6992,14 +6993,6 @@ "55cffd2c96741220": "Regrouper les piles", "a4e0e1e0bad3dcd8": "Aucune pull request associée", "973b668999e33451": "Les pull requests que l’agent ouvre depuis ce fil arrivent ici. Associez-en une vous-même à partir d’une URL ou d’un numéro.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " masquées · Tout afficher" - ], "f034c05267f161ce": [ "synchronisé", " ", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 2f8ca02f905cc..e42e525440725 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -6950,6 +6950,7 @@ "13eb3e529a3e9bff": "スレッドから除外", "93cebe7fdcc9821e": "リンクされたプルリクエストを利用できません", "47c92b77099a6346": "この環境は複数のプルリクエストのリンクをサポートしていません。", + "96a45e508e9ede58": "{count, plural, other {# 件非表示}} · すべて表示", "e18c90152452a50e": "{openCount, plural, other {{openCount} 件オープン}} · {linkCount, plural, other {{linkCount} 件リンク済み}}", "106c1bf3308a8c33": "監視中: チェックの完了、コメントの追加、ブランチの競合が発生するとエージェントが起動します", "15a560968264b0ed": "開く", @@ -6958,14 +6959,6 @@ "55cffd2c96741220": "スタックをグループ化", "a4e0e1e0bad3dcd8": "リンクされたプルリクエストはありません", "973b668999e33451": "このスレッドからエージェントが作成したプルリクエストがここに表示されます。URL や番号から自分でリンクすることもできます。", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " 件非表示 · すべて表示" - ], "f034c05267f161ce": [ "同期:", " ", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index c876429141aa2..b51ef42cba820 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -6953,6 +6953,7 @@ "13eb3e529a3e9bff": "스레드에서 제외", "93cebe7fdcc9821e": "연결된 풀 리퀘스트를 사용할 수 없음", "47c92b77099a6346": "이 환경은 여러 풀 리퀘스트 연결을 지원하지 않습니다.", + "96a45e508e9ede58": "{count, plural, other {#개 숨김}} · 모두 표시", "e18c90152452a50e": "{openCount, plural, other {{openCount}개 열림}} · {linkCount, plural, other {{linkCount}개 연결됨}}", "106c1bf3308a8c33": "지켜보는 중: 검사가 끝나거나, 누군가 댓글을 달거나, 브랜치가 충돌하면 에이전트가 깨어납니다", "15a560968264b0ed": "열기", @@ -6961,14 +6962,6 @@ "55cffd2c96741220": "스택 그룹화", "a4e0e1e0bad3dcd8": "연결된 풀 리퀘스트 없음", "973b668999e33451": "에이전트가 이 스레드에서 연 풀 리퀘스트가 여기에 표시됩니다. URL이나 번호로 직접 연결할 수도 있습니다.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - "개 숨김 · 모두 표시" - ], "f034c05267f161ce": [ { "i": 1, diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 470404551e03c..45dc91d0e5bb0 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -6983,6 +6983,7 @@ "13eb3e529a3e9bff": "Dispensar da thread", "93cebe7fdcc9821e": "Pull requests vinculados indisponíveis", "47c92b77099a6346": "Este ambiente não permite vários pull requests vinculados.", + "96a45e508e9ede58": "{count, plural, one {# oculta} other {# ocultas}} · Mostrar todas", "e18c90152452a50e": "{openCount, plural, one {{openCount} aberto} other {{openCount} abertos}} · {linkCount, plural, one {{linkCount} vinculado} other {{linkCount} vinculados}}", "106c1bf3308a8c33": "Acompanhando: o agente é ativado quando as verificações terminam, alguém comenta ou o branch entra em conflito", "15a560968264b0ed": "Abrir", @@ -6991,14 +6992,6 @@ "55cffd2c96741220": "Agrupar pilhas", "a4e0e1e0bad3dcd8": "Nenhum pull request vinculado", "973b668999e33451": "Os pull requests que o agente abrir a partir desta thread aparecem aqui. Vincule um você mesmo por URL ou número.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " ocultas · Mostrar todas" - ], "f034c05267f161ce": [ "sincronizado", " ", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index c911356c1d123..fffccf7c32c4a 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -6983,6 +6983,7 @@ "13eb3e529a3e9bff": "Убрать из треда", "93cebe7fdcc9821e": "Привязанные пул-реквесты недоступны", "47c92b77099a6346": "Это окружение не поддерживает несколько привязанных пул-реквестов.", + "96a45e508e9ede58": "{count, plural, one {# скрыт} few {# скрыто} many {# скрыто} other {# скрыто}} · Показать все", "e18c90152452a50e": "{openCount, plural, one {{openCount} открыт} few {{openCount} открыто} many {{openCount} открыто} other {{openCount} открыто}} · {linkCount, plural, one {{linkCount} привязан} few {{linkCount} привязано} many {{linkCount} привязано} other {{linkCount} привязано}}", "106c1bf3308a8c33": "Отслеживается: агент проснётся, когда завершатся проверки, кто-то оставит комментарий или в ветке появится конфликт", "15a560968264b0ed": "Открыть", @@ -6991,14 +6992,6 @@ "55cffd2c96741220": "Группировать стеки", "a4e0e1e0bad3dcd8": "Нет привязанных пул-реквестов", "973b668999e33451": "Сюда попадают пул-реквесты, которые агент открывает из этого треда. Привяжите пул-реквест сами по URL или номеру.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " скрыто · Показать все" - ], "f034c05267f161ce": [ "синхронизировано", " ", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index 1e8825c2834c7..60796958428c0 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -6989,6 +6989,7 @@ "13eb3e529a3e9bff": "Avfärda från tråden", "93cebe7fdcc9821e": "Länkade pull requests är inte tillgängliga", "47c92b77099a6346": "Den här miljön stöder inte flera länkade pull requests.", + "96a45e508e9ede58": "{count, plural, one {# dold} other {# dolda}} · Visa alla", "e18c90152452a50e": "{openCount, plural, one {{openCount} öppen} other {{openCount} öppna}} · {linkCount, plural, one {{linkCount} länkad} other {{linkCount} länkade}}", "106c1bf3308a8c33": "Bevakar: agenten vaknar när kontrollerna är klara, någon kommenterar eller grenen får konflikter", "15a560968264b0ed": "Öppna", @@ -6997,14 +6998,6 @@ "55cffd2c96741220": "Gruppera stackar", "a4e0e1e0bad3dcd8": "Inga länkade pull requests", "973b668999e33451": "Pull requests som agenten öppnar från den här tråden hamnar här. Länka en själv från en URL eller ett nummer.", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " dolda · Visa alla" - ], "f034c05267f161ce": [ "synkad", " ", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index f543f35ea4cbb..bc1a5cd8612d9 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -6998,6 +6998,7 @@ "13eb3e529a3e9bff": "从会话中忽略", "93cebe7fdcc9821e": "已关联的 PR 不可用", "47c92b77099a6346": "此环境不支持关联多个 pull request。", + "96a45e508e9ede58": "{count, plural, other {# 项已隐藏}} · 显示全部", "e18c90152452a50e": "{openCount, plural, other {{openCount} 个开放}} · {linkCount, plural, other {{linkCount} 个已关联}}", "106c1bf3308a8c33": "关注中:检查完成、有人评论或分支出现冲突时,智能体会被唤醒", "15a560968264b0ed": "打开", @@ -7006,14 +7007,6 @@ "55cffd2c96741220": "分组堆栈", "a4e0e1e0bad3dcd8": "没有已关联的 PR", "973b668999e33451": "智能体从本会话打开的 pull request 会显示在这里。你也可以通过 URL 或编号自行关联。", - "8e2de95df86dfeb7": [ - { - "i": 1, - "k": "_gt_value_1", - "v": "v" - }, - " 项已隐藏 · 显示全部" - ], "f034c05267f161ce": [ "同步于", " ",