diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx index 834da0af9a6a5365487dd301a6558ad982ee04fa..67a917c0079c23d0d9ef9b7997afddadc0cc5241 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -871,16 +871,22 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { )} {pr ? ( - {pr.kind === "stack" ? ( + {pr.kind === "stack" || pr.others > 0 ? ( ) : null} @@ -896,7 +902,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { )} style={{ fontFamily: MONO_FONT }} > - {pr.kind === "stack" ? pr.label : `#${pr.label}`} + {pr.kind === "stack" || pr.others > 0 ? pr.label : `#${pr.label}`} ) : null} diff --git a/apps/mobile/src/state/thread-pr-presentation.ts b/apps/mobile/src/state/thread-pr-presentation.ts index dd21e2d70ec4f4ef80227137212c3ad83bd9e107..48fe3abf5f66cd246c39c7ada603160da403b6f4 100644 --- a/apps/mobile/src/state/thread-pr-presentation.ts +++ b/apps/mobile/src/state/thread-pr-presentation.ts @@ -17,11 +17,12 @@ export interface ThreadPrPresentation { readonly number: number; readonly state: ThreadPr["state"] | null; readonly kind: "pull-request" | "stack"; + readonly others: number; readonly isDraft: boolean; /** Provider-side last activity, bounding when a terminal state landed. */ readonly updatedAt: string | null; readonly url: string; - /** Compact pull request number label, e.g. "3774". */ + /** Compact pull request number or linked count, e.g. "3774" or "+2". */ readonly label: string; /** Full, provider-aware label for assistive technologies. */ readonly accessibilityLabel: string; @@ -42,6 +43,7 @@ export function presentThreadPr( const isDraft = pr.state === "open" && pr.isDraft === true; return { kind: "pull-request", + others: 0, number: pr.number, state: pr.state, isDraft, @@ -66,9 +68,12 @@ export function presentThreadLinkedPullRequests( const label = badge.kind === "stack" ? String(badge.layers) - : `${link.number}${badge.others > 0 ? ` +${badge.others}` : ""}`; + : badge.others > 0 + ? `+${badge.others}` + : String(link.number); return { kind: badge.kind, + others: badge.kind === "pull-request" ? badge.others : 0, number: link.number, state, isDraft, diff --git a/apps/mobile/src/state/use-thread-pr.test.ts b/apps/mobile/src/state/use-thread-pr.test.ts index 330e31cb0171831be431439b1b21894f08e1e1ab..5fdb90e19c65ac0723f54f53bc8c87565284c972 100644 --- a/apps/mobile/src/state/use-thread-pr.test.ts +++ b/apps/mobile/src/state/use-thread-pr.test.ts @@ -87,7 +87,7 @@ describe("presentThreadLinkedPullRequests", () => { it("counts unrelated links without labelling them a stack", () => { expect(presentThreadLinkedPullRequests([linkedPr(1), linkedPr(2)])).toMatchObject({ kind: "pull-request", - label: "1 +1", + label: "+1", }); }); diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 79573635212ec5ee4591900e90283c9e1fd53c20..72a119cb76ba1c5cf4a40fee727c4c83fa790b8d 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1485,7 +1485,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { ); - // Stacks show their layer count; unrelated links show the current PR and a remainder count. + // Stacks show their layer count; unrelated links show only the remainder count. // Plain clicks open T3; individual PR links also support opening the host in a new tab. const prBadgeShape = supportsMultiplePullRequests ? resolveThreadPullRequestBadge(thread.pullRequests) diff --git a/apps/web/src/components/ThreadStatusIndicators.tsx b/apps/web/src/components/ThreadStatusIndicators.tsx index 6a73a805fb6709ca84e73cc5470cc527654c23b4..2d724a72650682f9df656900a91bbff37e92b3d1 100644 --- a/apps/web/src/components/ThreadStatusIndicators.tsx +++ b/apps/web/src/components/ThreadStatusIndicators.tsx @@ -174,10 +174,11 @@ export function ThreadPullRequestBadgeControl({ const content = ( <> - {isStack ? badge.layers : number} - {badge?.kind === "pull-request" && badge.others > 0 ? ( - +{badge.others} - ) : null} + {isStack + ? badge.layers + : badge?.kind === "pull-request" && badge.others > 0 + ? `+${badge.others}` + : number} ); return (