Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/web/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1584,10 +1584,10 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
useRightPanelStore.getState().open(threadRef, "pull-requests");
if (!props.isActive) onThreadActivate(threadRef);
}, [onThreadActivate, props.isActive, threadRef]);
const renderPrBadge = (iconOnly: boolean) =>
const renderPrBadge = (iconOnly: boolean, variant: "underline" | "badge" = "underline") =>
prBadgeShape?.kind === "stack" || pr || currentLinkedPr ? (
<ThreadPullRequestBadgeControl
variant="underline"
variant={variant}
badge={prBadgeShape}
number={pr?.number ?? currentLinkedPr?.number}
url={pr?.url ?? currentLinkedPr?.url}
Expand All @@ -1597,6 +1597,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
onOpenPullRequest={handlePrClick}
/>
) : null;
const hasPrBadge = prBadgeShape?.kind === "stack" || pr !== null || currentLinkedPr !== null;
const prBadge = renderPrBadge(false);
const terminalStatusIcon = terminalStatus ? (
<span
Expand Down Expand Up @@ -1719,6 +1720,11 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
</TooltipPopup>
</Tooltip>
) : null}
{hasPrBadge ? (
<span className="absolute -top-1 -right-1 inline-flex">
{renderPrBadge(true, "badge")}
</span>
) : null}
</span>
{topStatus ? (
<span
Expand Down
11 changes: 8 additions & 3 deletions apps/web/src/components/ThreadStatusIndicators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function ThreadPullRequestBadgeControl({
onOpenStack,
onOpenPullRequest,
}: {
variant: "underline" | "ghost";
variant: "underline" | "ghost" | "badge";
badge: ThreadPullRequestBadge | null;
number?: number | undefined;
url?: string | undefined;
Expand All @@ -171,7 +171,9 @@ export function ThreadPullRequestBadgeControl({
const className = cn(
variant === "ghost"
? buttonVariants({ variant: "ghost", size: "xs" })
: "inline-flex shrink-0 cursor-pointer items-center gap-0.5 whitespace-nowrap border-b border-transparent hover:border-current focus-visible:outline-2 focus-visible:outline-ring",
: variant === "badge"
? "inline-flex size-3 shrink-0 cursor-pointer items-center justify-center rounded-full bg-sidebar ring-1 ring-sidebar outline-none focus-visible:ring-2 focus-visible:ring-ring"
: "inline-flex shrink-0 cursor-pointer items-center gap-0.5 whitespace-nowrap border-b border-transparent hover:border-current focus-visible:outline-2 focus-visible:outline-ring",
"text-xs tabular-nums",
variant === "ghost" &&
"font-normal text-xs! active:scale-100 [--control-icon-color:currentColor]",
Expand All @@ -181,7 +183,10 @@ export function ThreadPullRequestBadgeControl({
);
const content = (
<>
<ThreadPullRequestBadgeIcon icon={badge?.kind ?? "pull-request"} />
<ThreadPullRequestBadgeIcon
icon={badge?.kind ?? "pull-request"}
className={variant === "badge" ? "size-2.5" : undefined}
/>
{iconOnly ? null : isStack ? badge.layers : linkedCount !== null ? `+${linkedCount}` : number}
</>
);
Expand Down
Loading