Skip to content

Commit f9749bf

Browse files
t3dotggclaude
andcommitted
fix(web): allow copying branch name while the trigger is disabled
The disabled trigger Button has pointer-events-none, so right-clicks never reached the context-menu handler during ref loading or branch actions. Move the handler to a wrapper span around the trigger. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 5e02b24 commit f9749bf

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,16 +717,23 @@ export function BranchToolbarBranchSelector({
717717
<TooltipPopup side="top">{branchPrTooltip}</TooltipPopup>
718718
</Tooltip>
719719
) : null}
720-
<ComboboxTrigger
721-
render={<Button variant="ghost" size="xs" />}
722-
className="min-w-0 text-muted-foreground/70 hover:text-foreground/80"
723-
disabled={isInitialBranchesLoadPending || isBranchActionPending}
720+
{/* Context menu lives on the wrapper: the disabled Button has
721+
pointer-events-none, so the trigger itself never sees right-clicks
722+
while refs are loading or a branch action is pending. */}
723+
<span
724+
className="flex min-w-0"
724725
onContextMenu={(event) => handleBranchContextMenu(event, resolvedActiveBranch)}
725726
>
726-
<GitBranchIcon className="size-3 shrink-0 opacity-70" />
727-
<span className="min-w-0 max-w-[240px] truncate">{triggerLabel}</span>
728-
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
729-
</ComboboxTrigger>
727+
<ComboboxTrigger
728+
render={<Button variant="ghost" size="xs" />}
729+
className="min-w-0 text-muted-foreground/70 hover:text-foreground/80"
730+
disabled={isInitialBranchesLoadPending || isBranchActionPending}
731+
>
732+
<GitBranchIcon className="size-3 shrink-0 opacity-70" />
733+
<span className="min-w-0 max-w-[240px] truncate">{triggerLabel}</span>
734+
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
735+
</ComboboxTrigger>
736+
</span>
730737
</div>
731738
<ComboboxPopup align="end" side="top" className="flex w-80 flex-col">
732739
<div className="shrink-0 px-3 pt-2.5">

0 commit comments

Comments
 (0)