Skip to content

Commit 89d4e8b

Browse files
authored
fix(web): align pull request comment headers (pingdotgg#15341)
1 parent bd438fb commit 89d4e8b

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function CommentIdentity({
8787
? sourceControlClients.get(detail.provider).authorProfileUrl(actor.login, detail.url)
8888
: null;
8989
return (
90-
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 text-xs">
90+
<div className="flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-1 text-xs">
9191
<PullRequestActorLabel actor={actor} profileUrl={profileUrl} className="max-w-full" />
9292
<Tooltip>
9393
<TooltipTrigger
@@ -218,7 +218,7 @@ function CollapsedComment({
218218
<Collapsible open={open} onOpenChange={setOpen}>
219219
<article className="group rounded-lg border border-border/60 [contain-intrinsic-block-size:44px] [content-visibility:auto]">
220220
<div className="p-3">
221-
<div className="flex flex-wrap items-start gap-2">
221+
<div className="flex flex-wrap items-baseline gap-2">
222222
<CommentIdentity comment={comment} detail={detail} />
223223
<CollapsibleTrigger
224224
ref={statusTriggerRef}
@@ -580,8 +580,8 @@ export function PullRequestSummaryTab({
580580
// highlighted code, and the conversation is below the description either way.
581581
className="group rounded-lg border border-border/60 bg-background [contain-intrinsic-block-size:160px] [content-visibility:auto]"
582582
>
583-
<div className="flex flex-wrap items-start gap-2 rounded-t-lg bg-muted/25 px-3 py-2.5">
584-
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-2 text-xs text-muted-foreground">
583+
<div className="flex flex-wrap items-baseline gap-2 rounded-t-lg bg-muted/25 px-3 py-2.5">
584+
<div className="flex min-w-0 flex-1 flex-wrap items-baseline gap-2 text-xs text-muted-foreground">
585585
<CommentIdentity comment={comment} detail={detail} />
586586
{outcome ? (
587587
<PullRequestReviewOutcomeBadge outcome={outcome} />
@@ -593,12 +593,19 @@ export function PullRequestSummaryTab({
593593
<Button
594594
size="xs"
595595
variant="ghost"
596-
className="-mt-1 shrink-0"
596+
className="shrink-0"
597597
disabled={pendingFinding !== null && pendingFinding !== undefined}
598598
onClick={() => onFixFinding(finding)}
599599
>
600-
<HammerIcon className="size-3" />
601-
{pendingFinding === pullRequestFindingKey(finding) ? "Preparing..." : fixFindingLabel}
600+
{/* Export the text baseline rather than the hammer icon's bottom edge. */}
601+
<span className="inline-flex items-baseline gap-1">
602+
<HammerIcon className="size-3 self-center" />
603+
<span>
604+
{pendingFinding === pullRequestFindingKey(finding)
605+
? "Preparing..."
606+
: fixFindingLabel}
607+
</span>
608+
</span>
602609
</Button>
603610
) : null}
604611
{reactionBar}

‎apps/web/src/components/pullRequest/pullRequestPresentation.tsx‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,11 @@ export function PullRequestReviewOutcomeBadge({
363363
const presentation = REVIEW_OUTCOME_PRESENTATION[outcome];
364364
return (
365365
<Badge size="sm" variant={presentation.badgeVariant} className={className}>
366-
<presentation.Icon aria-hidden className="size-3" />
367-
{presentation.label}
366+
{/* Align with surrounding text using the label, rather than the icon's bottom edge. */}
367+
<span className="inline-flex items-baseline gap-1">
368+
<presentation.Icon aria-hidden className="size-3 self-center" />
369+
<span>{presentation.label}</span>
370+
</span>
368371
</Badge>
369372
);
370373
}
@@ -415,9 +418,10 @@ export function PullRequestActorLabel({
415418
profileUrl?: string | null;
416419
}) {
417420
const login = actor?.login ?? "ghost";
421+
// Let the name supply the group's baseline while the avatar stays vertically centered.
418422
const label = (
419-
<span className={cn("flex min-w-0 items-center", variant === "label" && "gap-1.5")}>
420-
<PullRequestActorAvatar actor={actor} />
423+
<span className={cn("flex min-w-0 items-baseline", variant === "label" && "gap-1.5")}>
424+
<PullRequestActorAvatar actor={actor} className="self-center" />
421425
<span className={variant === "label" ? "truncate font-medium text-foreground" : "sr-only"}>
422426
{login}
423427
</span>

0 commit comments

Comments
 (0)