diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx index 9ca02389b192..469f0ddc4f05 100644 --- a/apps/web/src/components/BranchToolbarBranchSelector.tsx +++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx @@ -796,7 +796,7 @@ export function BranchToolbarBranchSelector({ number={prNumber} url={prUrl} status={displayedPrStatus} - onOpenStack={() => useRightPanelStore.getState().open(threadRef, "pull-requests")} + onOpenList={() => useRightPanelStore.getState().open(threadRef, "pull-requests")} onOpenPullRequest={(event) => { if (prUrl) openPrLink(event, prUrl); }} diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 3ec0f981d386..19b03d7ed1a1 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1499,11 +1499,12 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { ); // Stacks show their layer count; multiple unrelated links show their total count. - // Plain clicks open T3; individual PR links also support opening the host in a new tab. + // Either opens the thread's pull requests tab; a single PR link opens that PR and still + // supports opening the host in a new tab. const prBadgeShape = supportsMultiplePullRequests ? resolveThreadPullRequestBadge(thread.pullRequests) : null; - const handlePrStackClick = useCallback(() => { + const handlePrListClick = useCallback(() => { useRightPanelStore.getState().open(threadRef, "pull-requests"); if (!props.isActive) onThreadActivate(threadRef); }, [onThreadActivate, props.isActive, threadRef]); @@ -1515,7 +1516,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: { number={pr?.number ?? currentLinkedPr?.number} url={pr?.url ?? currentLinkedPr?.url} status={prStatus} - onOpenStack={handlePrStackClick} + onOpenList={handlePrListClick} onOpenPullRequest={handlePrClick} /> ) : null; diff --git a/apps/web/src/components/ThreadStatusIndicators.tsx b/apps/web/src/components/ThreadStatusIndicators.tsx index 29020f4975a3..a463dae2d7e6 100644 --- a/apps/web/src/components/ThreadStatusIndicators.tsx +++ b/apps/web/src/components/ThreadStatusIndicators.tsx @@ -195,7 +195,8 @@ export function resolveThreadPullRequestBadgePresentation({ * The linked-PR badge shared by the sidebar and composer footer. The badge owns what it shows: * the state glyph and number at the meta size, in the state's color. The caller owns the control * it sits in through `render` (an inline link in a sidebar row, a toolbar control in the - * composer), and the badge fills in the link or stack button behavior. + * composer), and the badge fills in the behavior: a single PR is a link to it, while a stack or + * several linked PRs is a button that opens the thread's pull requests tab. */ export function ThreadPullRequestBadgeControl({ render, @@ -203,7 +204,7 @@ export function ThreadPullRequestBadgeControl({ number, url, status, - onOpenStack, + onOpenList, onOpenPullRequest, }: { render: ReactElement<{ render?: useRender.RenderProp }>; @@ -211,7 +212,7 @@ export function ThreadPullRequestBadgeControl({ number?: number | undefined; url?: string | undefined; status: PrStatusIndicator | null; - onOpenStack: () => void; + onOpenList: () => void; onOpenPullRequest: (event: MouseEvent) => void; }) { const presentation = resolveThreadPullRequestBadgePresentation({ badge, number, url, status }); @@ -220,9 +221,9 @@ export function ThreadPullRequestBadgeControl({ 0)} url={url} - onOpenStack={onOpenStack} + onOpenList={onOpenList} onOpenPullRequest={onOpenPullRequest} /> ); @@ -231,26 +232,26 @@ export function ThreadPullRequestBadgeControl({ function PullRequestBadge({ render, presentation, - isStack, + opensList, url, - onOpenStack, + onOpenList, onOpenPullRequest, }: { render: ReactElement<{ render?: useRender.RenderProp }>; presentation: NonNullable>; - isStack: boolean; + opensList: boolean; url: string | undefined; - onOpenStack: () => void; + onOpenList: () => void; onOpenPullRequest: (event: MouseEvent) => void; }) { - const onClick = isStack + const onClick = opensList ? (event: MouseEvent) => { event.preventDefault(); event.stopPropagation(); - onOpenStack(); + onOpenList(); } : onOpenPullRequest; - const element = isStack ? ( + const element = opensList ? (