Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion webview-ui/src/components/chat/CodeIndexPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
sideOffset={5}
collisionPadding={16}
avoidCollisions={true}
container={portalContainer}>
container={portalContainer}
onPointerDownOutside={(e) => e.preventDefault()}
style={{ pointerEvents: "auto" }}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting pointerEvents: "auto" here still necessary since it's now the default in the base PopoverContent component? We might be able to remove this explicit setting to reduce redundancy.

<div className="p-3 border-b border-vscode-dropdown-border cursor-default">
<div className="flex flex-row items-center gap-1 p-0 mt-0 mb-1 w-full">
<h4 className="m-0 pb-2 flex-1">{t("settings:codeIndex.title")}</h4>
Expand Down
5 changes: 3 additions & 2 deletions webview-ui/src/components/ui/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ const PopoverAnchor = PopoverPrimitive.Anchor
const PopoverContent = React.forwardRef<
React.ElementRef<typeof PopoverPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & Pick<PortalProps, "container">
>(({ className, align = "center", sideOffset = 4, container, ...props }, ref) => (
>(({ className, align = "center", sideOffset = 4, container, style, ...props }, ref) => (
<PopoverPrimitive.Portal container={container}>
<PopoverPrimitive.Content
ref={ref}
align={align}
sideOffset={sideOffset}
className={cn(
"z-50 w-72 rounded-xs p-4 shadow-xs outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
"z-[100] w-72 rounded-xs p-4 shadow-xs outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The z-index change from z-50 to z-[100] affects all popovers across the application. Have we verified this doesn't create any z-index conflicts with other UI elements like modals or tooltips? I found 15+ components using PopoverContent that will inherit this change.

"bg-popover",
"border border-vscode-focusBorder",
"text-popover-foreground",
className,
)}
style={{ ...style, pointerEvents: "auto" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment here explaining why pointerEvents: "auto" is set as the default. This would help future developers understand that this is intentional to prevent event bleed-through issues:

{...props}
/>
</PopoverPrimitive.Portal>
Expand Down
Loading