Skip to content

Commit 2e796d6

Browse files
authored
🤖 fix: prevent Tooltip controlled/uncontrolled switch in DiffIndicator (#1147)
The Tooltip in DiffIndicator was conditionally spreading `{ open: false }` when dragging/selecting and `{}` otherwise, causing React to warn about switching between controlled and uncontrolled modes. Fix by always passing the `open` prop with `undefined` for default behavior. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
1 parent 200025b commit 2e796d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/browser/components/shared/DiffRenderer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ export const SelectableDiffRenderer = React.memo<SelectableDiffRendererProps>(
901901
}}
902902
reviewButton={
903903
onReviewNote && (
904-
<Tooltip {...(selection || isDragging ? { open: false } : {})}>
904+
<Tooltip open={selection || isDragging ? false : undefined}>
905905
<TooltipTrigger asChild>
906906
<button
907907
className="pointer-events-none absolute inset-0 flex items-center justify-center rounded-sm text-[var(--color-review-accent)]/60 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 hover:text-[var(--color-review-accent)] active:scale-90"

0 commit comments

Comments
 (0)