fix(web): prevent pull request metadata overlap (#8790)

This commit is contained in:
Matthew Feroz authored and GitHub committed 2026-08-31 02:04:43 +00:00
1 parent 352710d497
commit cefec32d6f
3 files changed
+59 -29

No files matched your search

@@ -1,3 +1,4 @@
import { SearchIcon } from "lucide-react";
import { memo } from "react";
import { cn } from "~/lib/utils";
@@ -45,7 +46,7 @@ function PullRequestRowImpl({
aria-current={selected ? "true" : undefined}
onClick={() => onSelect(entry)}
className={cn(
"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",
"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",
// Offscreen rows are skipped for style, layout and paint: a long list costs what the
// viewport shows, not what the pages have loaded. The intrinsic size keeps the
// scrollbar honest while a row is skipped.
@@ -59,9 +60,30 @@ function PullRequestRowImpl({
mergeability={entry.mergeability}
baseBranch={entry.baseBranch}
/>
<span className="min-w-0">
<span className="block truncate text-sm font-medium text-foreground">{entry.title}</span>
<PullRequestMetaLine className="mt-0.5 text-xs text-muted-foreground/70">
<span className="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-0.5">
<span className="col-start-1 row-start-1 block truncate text-sm font-medium text-foreground">
{entry.title}
</span>
<span className="col-start-2 row-start-1 justify-self-end whitespace-nowrap text-xs text-muted-foreground/70 tabular-nums">
{formatRelativeTimeLabel(entry.updatedAt)}
</span>
<PullRequestMetaLine className="@container/pr-row-meta col-start-1 row-start-2 overflow-hidden text-xs text-muted-foreground/70">
{matchedElsewhere ? (
<Tooltip>
<TooltipTrigger
render={
<span className="flex min-w-6 items-center gap-1 overflow-hidden rounded-full border border-border/60 px-1 text-[10px]" />
}
>
<span className="sr-only">matched in the description</span>
<SearchIcon aria-hidden className="size-3 shrink-0" />
<span aria-hidden className="hidden truncate @xs/pr-row-meta:block">
matched in the description
</span>
</TooltipTrigger>
<TooltipPopup side="top">Matched in the description</TooltipPopup>
</Tooltip>
) : null}
<span className="flex shrink-0 items-center gap-1">
{showProvider ? (
<Tooltip>
@@ -89,15 +111,19 @@ function PullRequestRowImpl({
</span>
{showProjectTitle ? <span className="truncate">{entry.repository}</span> : null}
{environmentLabel ? (
<span className="max-w-32 shrink-0 truncate">{environmentLabel}</span>
<span className="min-w-0 max-w-32 truncate">{environmentLabel}</span>
) : null}
<PullRequestActorLabel actor={entry.author} className="max-w-40 shrink-0" />
<PullRequestActorLabel
actor={entry.author}
className="min-w-4 max-w-40"
labelClassName="sr-only @xs/pr-row-meta:not-sr-only @xs/pr-row-meta:truncate"
/>
{/* Only a verdict somebody has actually given: "review required" is the absence of
one, and saying so on every unreviewed row would say nothing. */}
{entry.reviewDecision === "approved" || entry.reviewDecision === "changes-requested" ? (
<span
className={cn(
"shrink-0",
"min-w-0 truncate",
entry.reviewDecision === "approved"
? "text-emerald-600/90 dark:text-emerald-400/80"
: "text-amber-600/90 dark:text-amber-400/80",
@@ -117,16 +143,12 @@ function PullRequestRowImpl({
}}
/>
)}
{matchedElsewhere ? (
<span className="shrink-0 rounded-full border border-border/60 px-1.5 text-[10px]">
matched in the description
</span>
) : null}
</PullRequestMetaLine>
</span>
<span className="flex shrink-0 flex-col items-end gap-0.5 text-xs text-muted-foreground/70 tabular-nums">
<span>{formatRelativeTimeLabel(entry.updatedAt)}</span>
<PullRequestDiffStat additions={entry.additions} deletions={entry.deletions} />
<PullRequestDiffStat
additions={entry.additions}
deletions={entry.deletions}
className="col-start-2 row-start-2 justify-self-end text-xs"
/>
</span>
</button>
);
@@ -339,17 +339,19 @@ export function PullRequestActorAvatar({
export function PullRequestActorLabel({
actor,
className,
labelClassName,
tooltip = true,
}: {
actor: PullRequestActor | null;
className?: string;
labelClassName?: string;
tooltip?: boolean;
}) {
const login = actor?.login ?? "ghost";
const label = (
<>
<PullRequestActorAvatar actor={actor} />
<span className="truncate">{login}</span>
<span className={cn("truncate", labelClassName)}>{login}</span>
</>
);
if (!tooltip) {