Skip to content

Commit 9773ee2

Browse files
committed
fix(web): align pull request row metadata
1 parent b4a2c72 commit 9773ee2

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function PullRequestRowImpl({
4646
aria-current={selected ? "true" : undefined}
4747
onClick={() => onSelect(entry)}
4848
className={cn(
49-
"grid w-full grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
49+
"grid w-full grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
5050
// Offscreen rows are skipped for style, layout and paint: a long list costs what the
5151
// viewport shows, not what the pages have loaded. The intrinsic size keeps the
5252
// scrollbar honest while a row is skipped.
@@ -60,19 +60,24 @@ function PullRequestRowImpl({
6060
mergeability={entry.mergeability}
6161
baseBranch={entry.baseBranch}
6262
/>
63-
<span className="@container/pr-row-meta min-w-0 overflow-hidden">
64-
<span className="block truncate text-sm font-medium text-foreground">{entry.title}</span>
65-
<PullRequestMetaLine className="mt-0.5 overflow-hidden text-xs text-muted-foreground/70">
63+
<span className="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-3 gap-y-0.5">
64+
<span className="col-start-1 row-start-1 block truncate text-sm font-medium text-foreground">
65+
{entry.title}
66+
</span>
67+
<span className="col-start-2 row-start-1 justify-self-end whitespace-nowrap text-xs text-muted-foreground/70 tabular-nums">
68+
{formatRelativeTimeLabel(entry.updatedAt)}
69+
</span>
70+
<PullRequestMetaLine className="@container/pr-row-meta col-start-1 row-start-2 overflow-hidden text-xs text-muted-foreground/70">
6671
{matchedElsewhere ? (
6772
<Tooltip>
6873
<TooltipTrigger
6974
render={
70-
<span className="flex shrink-0 items-center gap-1 rounded-full border border-border/60 px-1 text-[10px]" />
75+
<span className="flex min-w-0 items-center gap-1 rounded-full border border-border/60 px-1 text-[10px]" />
7176
}
7277
>
7378
<span className="sr-only">matched in the description</span>
7479
<SearchIcon aria-hidden className="size-3 shrink-0" />
75-
<span aria-hidden className="hidden @xs/pr-row-meta:inline">
80+
<span aria-hidden className="hidden truncate @xs/pr-row-meta:block">
7681
matched in the description
7782
</span>
7883
</TooltipTrigger>
@@ -135,10 +140,11 @@ function PullRequestRowImpl({
135140
/>
136141
)}
137142
</PullRequestMetaLine>
138-
</span>
139-
<span className="flex shrink-0 flex-col items-end gap-0.5 text-xs text-muted-foreground/70 tabular-nums">
140-
<span>{formatRelativeTimeLabel(entry.updatedAt)}</span>
141-
<PullRequestDiffStat additions={entry.additions} deletions={entry.deletions} />
143+
<PullRequestDiffStat
144+
additions={entry.additions}
145+
deletions={entry.deletions}
146+
className="col-start-2 row-start-2 justify-self-end text-xs"
147+
/>
142148
</span>
143149
</button>
144150
);

0 commit comments

Comments
 (0)