Skip to content
TypeScript

fix(web): show repository names on linked pull requests (#13061)

Bilal Bakrcb1a3f34670b
diff --git a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx
index 15221f26e63..d9a8b60c36e 100644
--- a/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx
+++ b/apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx
@@ -16,6 +16,7 @@ import { useAtomCommand } from "~/state/use-atom-command";
import { formatRelativeTimeLabel } from "~/timestampFormat";
import { Button } from "../ui/button";
import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu";
+import { MiddleTruncate } from "../ui/middle-truncate";
import { ScrollArea } from "../ui/scroll-area";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { openLinkPullRequestDialog } from "./LinkPullRequestDialog";
@@ -161,7 +162,17 @@ function LinkRow({
/>
) : null}
{snapshot !== null ? (
- <PullRequestRowBranches head={snapshot.headBranch} base={snapshot.baseBranch} />
+ <>
+ {/* Cut in the middle: rows from one owner differ in the repository name at the
+ end, which a tail cut would hide. */}
+ <Tooltip>
+ <TooltipTrigger render={<span className="flex min-w-0 max-w-32 font-mono" />}>
+ <MiddleTruncate value={link.repository} showTitle={false} />
+ </TooltipTrigger>
+ <TooltipPopup>{link.repository}</TooltipPopup>
+ </Tooltip>
+ <PullRequestRowBranches head={snapshot.headBranch} base={snapshot.baseBranch} />
+ </>
) : (
<span className="truncate font-mono">
{link.host}/{link.repository}