Skip to content

Commit 8e3fcaf

Browse files
committed
fix(web): align pull request comment headers
1 parent a21702d commit 8e3fcaf

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
@@ -77,7 +77,7 @@ function CommentIdentity({
7777
? new URL(`/${encodeURIComponent(actor.login)}`, detail.url).toString()
7878
: null;
7979
return (
80-
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 text-xs">
80+
<div className="flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2 gap-y-1 text-xs">
8181
<PullRequestActorLabel actor={actor} profileUrl={profileUrl} className="max-w-full" />
8282
<Tooltip>
8383
<TooltipTrigger
@@ -214,7 +214,7 @@ function CollapsedComment({
214214
<Collapsible open={open} onOpenChange={setOpen}>
215215
<article className="group rounded-lg border border-border/60 [contain-intrinsic-block-size:44px] [content-visibility:auto]">
216216
<div className="p-3">
217-
<div className="flex flex-wrap items-start gap-2">
217+
<div className="flex flex-wrap items-baseline gap-2">
218218
<CommentIdentity comment={comment} detail={detail} />
219219
<CollapsibleTrigger
220220
ref={statusTriggerRef}
@@ -668,8 +668,8 @@ export function PullRequestSummaryTab({
668668
// highlighted code, and the conversation is below the description either way.
669669
className="group rounded-lg border border-border/60 bg-background [contain-intrinsic-block-size:160px] [content-visibility:auto]"
670670
>
671-
<div className="flex flex-wrap items-start gap-2 rounded-t-lg bg-muted/25 px-3 py-2.5">
672-
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-2 text-xs text-muted-foreground">
671+
<div className="flex flex-wrap items-baseline gap-2 rounded-t-lg bg-muted/25 px-3 py-2.5">
672+
<div className="flex min-w-0 flex-1 flex-wrap items-baseline gap-2 text-xs text-muted-foreground">
673673
<CommentIdentity comment={comment} detail={detail} />
674674
{outcome ? (
675675
<PullRequestReviewOutcomeBadge outcome={outcome} />
@@ -683,12 +683,19 @@ export function PullRequestSummaryTab({
683683
<Button
684684
size="xs"
685685
variant="ghost"
686-
className="-mt-1 shrink-0"
686+
className="shrink-0"
687687
disabled={pendingFinding !== null && pendingFinding !== undefined}
688688
onClick={() => onFixFinding(finding)}
689689
>
690-
<HammerIcon className="size-3" />
691-
{pendingFinding === pullRequestFindingKey(finding) ? "Preparing..." : fixFindingLabel}
690+
{/* Export the text baseline rather than the hammer icon's bottom edge. */}
691+
<span className="inline-flex items-baseline gap-1">
692+
<HammerIcon className="size-3 self-center" />
693+
<span>
694+
{pendingFinding === pullRequestFindingKey(finding)
695+
? "Preparing..."
696+
: fixFindingLabel}
697+
</span>
698+
</span>
692699
</Button>
693700
) : null}
694701
{reactionBar}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,11 @@ export function PullRequestReviewOutcomeBadge({
407407
const presentation = REVIEW_OUTCOME_PRESENTATION[outcome];
408408
return (
409409
<Badge size="sm" variant={presentation.badgeVariant} className={className}>
410-
<presentation.Icon aria-hidden className="size-3" />
411-
{presentation.label}
410+
{/* Align with surrounding text using the label, rather than the icon's bottom edge. */}
411+
<span className="inline-flex items-baseline gap-1">
412+
<presentation.Icon aria-hidden className="size-3 self-center" />
413+
<span>{presentation.label}</span>
414+
</span>
412415
</Badge>
413416
);
414417
}
@@ -466,9 +469,10 @@ export function PullRequestActorLabel({
466469
profileUrl?: string | null;
467470
}) {
468471
const login = actor?.login ?? "ghost";
472+
// Let the name supply the group's baseline while the avatar stays vertically centered.
469473
const label = (
470-
<span className={cn("flex min-w-0 items-center", variant === "label" && "gap-1.5")}>
471-
<PullRequestActorAvatar actor={actor} />
474+
<span className={cn("flex min-w-0 items-baseline", variant === "label" && "gap-1.5")}>
475+
<PullRequestActorAvatar actor={actor} className="self-center" />
472476
<span className={variant === "label" ? "truncate font-medium text-foreground" : "sr-only"}>
473477
{login}
474478
</span>

0 commit comments

Comments
 (0)