Skip to content
TypeScript

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

Bilal Bakrf0a0ead946ca
diff --git a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
index 59f40f95552..54cfc025868 100644
--- a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
@@ -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
diff --git a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
index cbbfaf1f33f..72d8d384541 100644
--- a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
@@ -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]}