Skip to content

Conversation

@jverre
Copy link
Collaborator

@jverre jverre commented Nov 18, 2025

Details

When the baseline score for an optimization run was 0, there were a number of issues:

  1. No "Best prompt" tag in the chart
  2. No scores in the table
  3. No prompt diff
Screenshot 2025-11-18 at 14 29 12

This PR addresses all of these:
Screenshot 2025-11-18 at 14 11 45

Change checklist

  • User facing
  • Documentation update

Issues

  • Resolves #
  • OPIK-000

Testing

Tested locally

Documentation

N/A

@jverre jverre requested a review from a team as a code owner November 18, 2025 14:28
Copilot AI review requested due to automatic review settings November 18, 2025 14:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes display issues in the optimization comparison UI when the baseline score is zero. The fix ensures proper rendering of scores, trend indicators, and prompt diffs by replacing percentage-based comparisons with absolute difference calculations when percentage calculations are not possible.

Key changes:

  • Modified trend calculation logic to use absolute differences instead of percentages when baseline is 0
  • Added visual indicators (TrendingUp/TrendingDown/MoveRight icons with Tags) for absolute score changes
  • Preserved percentage-based trend display when baseline is non-zero

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ObjectiveScoreCell.tsx Implements absolute difference display with trend icons when percentage calculation isn't possible
CompareOptimizationsPage.tsx Removes early return that prevented score calculation when baseline is 0, adds baseScore to column metadata
BestPrompt.tsx Adds absolute difference calculation and corresponding visual indicators for the best prompt card

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants