Skip to content

Commit 3c8cced

Browse files
ScottN-PVclaude
andcommitted
fix(web): keep the diff panel head ref visible when the panel is narrow
In a narrow Diff panel the base-ref button never shrank (Button carries shrink-0), so the whole shortfall in the branch-scope row fell on the head ref group. It reached zero width, the head ref disappeared and the arrow was drawn over the base ref. The head ref group now keeps 3rem while the row has room and clips its arrow, and the base-ref button shrinks down to 2.25rem, so both refs truncate and the base-ref menu stays reachable in the narrowest rows. Refs #19048 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 98a6246 commit 3c8cced

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎apps/web/src/components/DiffPanel.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,14 @@ export default function DiffPanel({
792792
className="flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground"
793793
aria-label={`Comparing ${selectedGitSource.headRef ?? "HEAD"} against ${selectedGitSource.baseRef}`}
794794
>
795+
{/* The head ref keeps 3rem while the row has room; below that the
796+
base-ref button keeps 2.25rem so its menu stays reachable. */}
795797
<Tooltip>
796-
<TooltipTrigger render={<span className="flex min-w-0 items-center gap-2" />}>
798+
<TooltipTrigger
799+
render={
800+
<span className="flex min-w-[min(3rem,calc(100%-2.75rem))] items-center gap-2 overflow-hidden" />
801+
}
802+
>
797803
<span className="min-w-0 max-w-48 truncate">
798804
{selectedGitSource.headRef ?? "HEAD"}
799805
</span>
@@ -817,7 +823,7 @@ export default function DiffPanel({
817823
>
818824
<ComboboxTrigger
819825
render={<Button variant="ghost-muted" size="xs" />}
820-
className="min-w-0 max-w-48"
826+
className="min-w-9 max-w-48 shrink"
821827
aria-label={`Change comparison target. Currently ${selectedGitSource.baseRef}`}
822828
>
823829
<span className="min-w-0 truncate">{selectedGitSource.baseRef}</span>

0 commit comments

Comments
 (0)