Skip to content

Commit cb1a3f3

Browse files
authored
fix(web): show repository names on linked pull requests (#13061)
1 parent b2b43be commit cb1a3f3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useAtomCommand } from "~/state/use-atom-command";
1616
import { formatRelativeTimeLabel } from "~/timestampFormat";
1717
import { Button } from "../ui/button";
1818
import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu";
19+
import { MiddleTruncate } from "../ui/middle-truncate";
1920
import { ScrollArea } from "../ui/scroll-area";
2021
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
2122
import { openLinkPullRequestDialog } from "./LinkPullRequestDialog";
@@ -161,7 +162,17 @@ function LinkRow({
161162
/>
162163
) : null}
163164
{snapshot !== null ? (
164-
<PullRequestRowBranches head={snapshot.headBranch} base={snapshot.baseBranch} />
165+
<>
166+
{/* Cut in the middle: rows from one owner differ in the repository name at the
167+
end, which a tail cut would hide. */}
168+
<Tooltip>
169+
<TooltipTrigger render={<span className="flex min-w-0 max-w-32 font-mono" />}>
170+
<MiddleTruncate value={link.repository} showTitle={false} />
171+
</TooltipTrigger>
172+
<TooltipPopup>{link.repository}</TooltipPopup>
173+
</Tooltip>
174+
<PullRequestRowBranches head={snapshot.headBranch} base={snapshot.baseBranch} />
175+
</>
165176
) : (
166177
<span className="truncate font-mono">
167178
{link.host}/{link.repository}

0 commit comments

Comments
 (0)