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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const CompareExperimentsFeedbackScoreCell: React.FC<
enableUserFeedbackEditing;
const isUserFeedbackColumn =
isEditingEnabled && context.column.id === "feedback_scores_User feedback";
const isSmall = rowHeight === ROW_HEIGHT.small;
const isCompact =
rowHeight === ROW_HEIGHT.small || rowHeight === ROW_HEIGHT.medium;

Comment on lines +50 to 52
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

isCompact treating ROW_HEIGHT.medium as compact removes the inline line-clamp-3 preview — should we keep ROW_HEIGHT.medium non-compact or otherwise render the inline preview unless OPIK-5553 required hiding it?

Finding type: Logical Bugs | Severity: 🟠 Medium


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-frontend/src/v2/pages-shared/experiments/CompareExperimentsFeedbackScoreCell/CompareExperimentsFeedbackScoreCell.tsx
around lines 50 to 52, the isCompact flag now returns true for both ROW_HEIGHT.small and
ROW_HEIGHT.medium which causes medium rows to use the tooltip-only branch. Change
isCompact to only be true for ROW_HEIGHT.small (const isCompact = rowHeight ===
ROW_HEIGHT.small) and restore the non-compact rendering branch for medium rows so they
show the inline, line-clamped reason preview (use rowHeight === ROW_HEIGHT.medium ->
line-clamp-3 and rowHeight === ROW_HEIGHT.large -> line-clamp-[16] as before). Ensure
size props and conditional rendering use the updated isCompact flag so medium rows
render inline text instead of only the tooltip.

const renderContent = (item: ExperimentItem | undefined) => {
const feedbackScore = item?.feedback_scores?.find(
Expand All @@ -61,6 +62,7 @@ const CompareExperimentsFeedbackScoreCell: React.FC<
<FeedbackScoreEditDropdown
feedbackScore={feedbackScore}
onValueChange={handleValueChange}
size={isCompact ? "sm" : "md"}
/>
)}
<span>-</span>
Expand Down Expand Up @@ -88,7 +90,7 @@ const CompareExperimentsFeedbackScoreCell: React.FC<
<div
className={cn(
"flex w-full justify-end gap-1",
isSmall
isCompact
? "h-4 items-center"
: "flex-col items-end justify-start overflow-hidden",
isUserFeedbackColumn && "group",
Expand All @@ -99,6 +101,7 @@ const CompareExperimentsFeedbackScoreCell: React.FC<
color={color}
isUserFeedbackColumn={isUserFeedbackColumn}
onValueChange={handleValueChange}
size={isCompact ? "sm" : "md"}
tooltipSuffix={
isAggregatedScore(feedbackScore)
? getTrialAvgTooltip(
Expand All @@ -108,23 +111,16 @@ const CompareExperimentsFeedbackScoreCell: React.FC<
: undefined
}
/>
{reasons.length > 0 && (
<FeedbackScoreReasonTooltip reasons={reasons}>
{!isSmall ? (
<span
className={cn(
"break-words text-xs text-muted-foreground",
rowHeight === ROW_HEIGHT.medium && "line-clamp-3",
rowHeight === ROW_HEIGHT.large && "line-clamp-[16]",
)}
>
{reasons.map((r) => r.reason).join(", ")}
</span>
) : (
{reasons.length > 0 &&
(isCompact ? (
<FeedbackScoreReasonTooltip reasons={reasons}>
<MessageSquareMore className="size-3.5 shrink-0 text-light-slate" />
)}
</FeedbackScoreReasonTooltip>
)}
</FeedbackScoreReasonTooltip>
) : (
<span className="w-full min-w-0 overflow-y-auto break-words text-xs text-muted-foreground">
{reasons.map((r) => r.reason).join(", ")}
</span>
))}
</div>
);
};
Expand Down
Loading