fix(web): keep PR controls readable in narrow panels (#11962)

This commit is contained in:
Bilal Bakr authored and GitHub committed 2026-09-15 15:12:36 -07:00
1 parent 2c16c1d264
commit f0a0ead946
2 files changed
+4 -10

No files matched your search

@@ -38,7 +38,6 @@ import { orderDiffFiles } from "./pullRequestFileOrder.logic";
import {
buildFileDiffRenderKey,
fnv1a32,
getDiffLineStat,
getRenderablePatch,
resolveDiffThemeName,
resolveFileDiffPath,
@@ -546,7 +545,6 @@ function PullRequestCodeTab({
toggledFiles,
],
);
const lineStat = useMemo(() => getDiffLineStat(files), [files]);
const omittedFileStats = useMemo(
() =>
new Map(
@@ -1040,7 +1038,7 @@ function PullRequestCodeTab({
{orderedCommits.length > 0 ? (
<DropdownMenu>
<DropdownMenuTrigger
className="inline-flex h-6 max-w-64 items-center gap-1 rounded-md bg-accent px-2 text-xs font-medium text-accent-foreground outline-none transition-colors hover:bg-accent/80 focus-visible:ring-2 focus-visible:ring-ring"
className="inline-flex h-6 min-w-0 max-w-64 items-center gap-1 rounded-md bg-accent px-2 text-xs font-medium text-accent-foreground outline-none transition-colors hover:bg-accent/80 focus-visible:ring-2 focus-visible:ring-ring"
aria-label={`Diff scope: ${scopeLabel}`}
>
<span className="truncate">{scopeLabel}</span>
@@ -1089,7 +1087,7 @@ function PullRequestCodeTab({
) : null}
{/* One count, and the caveats as icons that carry their own words. Spelled out they
competed for a strip this narrow and every one of them truncated to nothing. */}
<PullRequestMetaLine>
<PullRequestMetaLine className="shrink-0">
<span className="shrink-0 tabular-nums">
{files.length} {files.length === 1 ? "file" : "files"}
{nextCursor === null ? "" : "+"}
@@ -1124,11 +1122,6 @@ function PullRequestCodeTab({
</PullRequestMetaLine>
</div>
<div className="flex shrink-0 items-center gap-1">
<PullRequestDiffStat
additions={lineStat.additions}
deletions={lineStat.deletions}
className="mr-1"
/>
{fileKeys.length > 0 ? (
<Tooltip>
<TooltipTrigger
@@ -2459,10 +2459,11 @@ export function PullRequestDetailPanel({
{detail ? (
<nav
className="col-span-2 flex min-w-0 items-center gap-1 overflow-x-auto border-t border-border/60 px-4 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
className="col-span-2 flex min-w-0 flex-wrap items-center gap-2 border-t border-border/60 px-4 py-2"
aria-label="Pull request tabs"
>
<ToggleGroup
className="shrink-0"
size="segmented"
variant="segmented"
value={[tab]}