@@ -121,6 +121,7 @@ import {
121121import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
122122import { toastManager } from "../ui/toast";
123123import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "../ui/tooltip";
124+ import { MiddleTruncate } from "../ui/middle-truncate";
124125import { PullRequestDetailGhost, PullRequestTimelineGhost } from "./PullRequestGhosts";
125126import { PullRequestCopyableCode } from "./PullRequestCopyableCode";
126127import { PullRequestActivityUnavailableState } from "./PullRequestActivityUnavailableState";
@@ -848,6 +849,9 @@ export function PullRequestDetailPanel({
848849 // and at worst answer from it.
849850 const invalidate = useAtomCommand(pullRequestEnvironment.invalidate, { reportFailure: false });
850851 const [isInvalidating, setIsInvalidating] = useState(false);
852+ // One word for "the host is being asked again", whichever of the two halves is in flight:
853+ // the invalidation round trip, then the detail read it kicks off.
854+ const refreshing = isInvalidating || detailQuery.isPending;
851855 const refreshFromHost = useCallback(async () => {
852856 setIsInvalidating(true);
853857 try {
@@ -1986,18 +1990,29 @@ export function PullRequestDetailPanel({
19861990 <MenuTrigger
19871991 render={
19881992 <Button
1989- aria-label="More pull request actions"
1993+ aria-label={
1994+ refreshing ? "Refreshing pull request" : "More pull request actions"
1995+ }
19901996 className="size-6"
19911997 size="icon-xs"
19921998 variant="ghost-muted"
19931999 />
19942000 }
19952001 >
1996- <MoreHorizontalIcon className="size-4" />
2002+ {/* The refresh lives in this menu, so while one runs the trigger wears
2003+ the spinning glyph in place of the dots: the reader sees the panel
2004+ is fetching without a control appearing or the row shifting. */}
2005+ {refreshing ? (
2006+ <RefreshIcon refreshing className="size-4" />
2007+ ) : (
2008+ <MoreHorizontalIcon className="size-4" />
2009+ )}
19972010 </MenuTrigger>
19982011 }
19992012 />
2000- <TooltipPopup>More pull request actions</TooltipPopup>
2013+ <TooltipPopup>
2014+ {refreshing ? "Refreshing pull request" : "More pull request actions"}
2015+ </TooltipPopup>
20012016 </Tooltip>
20022017 <MenuPopup align="end" side="bottom" className="min-w-72">
20032018 <PullRequestThreadLinks
@@ -2011,14 +2026,8 @@ export function PullRequestDetailPanel({
20112026 }
20122027 onPickerOpenChange={setThreadPickerOpen}
20132028 />
2014- <MenuItem
2015- disabled={isInvalidating || detailQuery.isPending}
2016- onClick={() => void refreshFromHost()}
2017- >
2018- <RefreshIcon
2019- className="size-3.5"
2020- refreshing={isInvalidating || detailQuery.isPending}
2021- />
2029+ <MenuItem disabled={refreshing} onClick={() => void refreshFromHost()}>
2030+ <RefreshIcon className="size-3.5" refreshing={refreshing} />
20222031 Refresh
20232032 </MenuItem>
20242033 <MenuItem disabled={handoff !== null} onClick={askAboutPullRequest}>
@@ -2267,7 +2276,9 @@ export function PullRequestDetailPanel({
22672276 className="size-3 shrink-0"
22682277 />
22692278 ) : null}
2270- <code className="min-w-0 truncate">{detail.baseBranch}</code>
2279+ <code className="flex min-w-0">
2280+ <MiddleTruncate value={detail.baseBranch} showTitle={false} />
2281+ </code>
22712282 </PullRequestBaseFreshnessWarning>
22722283 ) : (
22732284 <Tooltip>
@@ -2280,7 +2291,9 @@ export function PullRequestDetailPanel({
22802291 className="size-3 shrink-0"
22812292 />
22822293 ) : null}
2283- <code className="min-w-0 truncate">{detail.baseBranch}</code>
2294+ <code className="flex min-w-0">
2295+ <MiddleTruncate value={detail.baseBranch} showTitle={false} />
2296+ </code>
22842297 </span>
22852298 }
22862299 />
@@ -2298,7 +2311,9 @@ export function PullRequestDetailPanel({
22982311 <Tooltip>
22992312 <TooltipTrigger
23002313 render={
2301- <code className="min-w-0 flex-1 truncate">{detail.headBranch}</code>
2314+ <code className="flex min-w-0 flex-1">
2315+ <MiddleTruncate value={detail.headBranch} showTitle={false} />
2316+ </code>
23022317 }
23032318 />
23042319 <TooltipPopup side="top">{detail.headBranch}</TooltipPopup>
@@ -2452,7 +2467,9 @@ export function PullRequestDetailPanel({
24522467 className="size-3 shrink-0"
24532468 />
24542469 ) : null}
2455- <code className="min-w-0 truncate">{detail.baseBranch}</code>
2470+ <code className="flex min-w-0">
2471+ <MiddleTruncate value={detail.baseBranch} showTitle={false} />
2472+ </code>
24562473 </PullRequestBaseFreshnessWarning>
24572474 ) : (
24582475 <Tooltip>
@@ -2465,7 +2482,9 @@ export function PullRequestDetailPanel({
24652482 className="size-3 shrink-0"
24662483 />
24672484 ) : null}
2468- <code className="min-w-0 truncate">{detail.baseBranch}</code>
2485+ <code className="flex min-w-0">
2486+ <MiddleTruncate value={detail.baseBranch} showTitle={false} />
2487+ </code>
24692488 </span>
24702489 }
24712490 />
0 commit comments