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 834da0af9a6a..67a917c0079c 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 dd21e2d70ec4..48fe3abf5f66 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 330e31cb0171..5fdb90e19c65 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 79573635212e..72a119cb76ba 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 6a73a805fb67..2d724a726506 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 (