Skip to content
Merged
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
14 changes: 6 additions & 8 deletions src/components/FeedbackButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export function FeedbackButtons({ traceId }: FeedbackButtonsProps) {
const [isPopoverOpen, setIsPopoverOpen] = useState(false)

const handleFeedback = (e: React.MouseEvent, value: 1 | -1) => {
// Stop event from propagating to the trigger so the trigger doesn't automatically open it when resetting
e.stopPropagation()
const next = feedbackGiven === value ? null : value
Comment thread
MrOrz marked this conversation as resolved.
setFeedbackGiven(next)

Expand Down Expand Up @@ -74,8 +72,8 @@ export function FeedbackButtons({ traceId }: FeedbackButtonsProps) {
if (!open) setIsPopoverOpen(false)
}}
>
<PopoverTrigger render={<div className="flex gap-3" />}>
<button
<div className="flex gap-3">
<PopoverTrigger
Comment thread
MrOrz marked this conversation as resolved.
onClick={(e) => handleFeedback(e, 1)}
className={`p-1 rounded hover:bg-gray-100 transition-colors ${
feedbackGiven === 1
Expand All @@ -86,8 +84,8 @@ export function FeedbackButtons({ traceId }: FeedbackButtonsProps) {
<span className="material-symbols-outlined text-[18px]">
thumb_up
</span>
</button>
<button
</PopoverTrigger>
<PopoverTrigger
onClick={(e) => handleFeedback(e, -1)}
className={`p-1 rounded hover:bg-gray-100 transition-colors ${
feedbackGiven === -1
Expand All @@ -98,8 +96,8 @@ export function FeedbackButtons({ traceId }: FeedbackButtonsProps) {
<span className="material-symbols-outlined text-[18px]">
thumb_down
</span>
</button>
</PopoverTrigger>
</PopoverTrigger>
</div>
<PopoverContent align="start">
<FeedbackPopoverContent
isPositive={feedbackGiven === 1}
Expand Down
Loading