Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 9, 2025

This PR fixes two issues with the evals chart on the website:

Issues Fixed

  1. Negative cost values: The X-axis domain calculation could result in negative values when the minimum cost was less than $5. Added Math.max(0, ...) to ensure the cost axis always starts at $0 or higher.

  2. Truncated labels: Labels for data points at the top of the chart were being cut off due to insufficient top margin. Increased the top margin from 0 to 20 pixels to provide adequate space for labels.

Changes Made

  • Modified apps/web-roo-code/src/app/evals/plot.tsx:
    • Updated X-axis domain calculation to prevent negative values
    • Increased chart top margin from 0 to 20 pixels

Testing

The changes have been verified to:

  • Ensure cost axis never shows negative values
  • Provide sufficient space for labels at the top of the chart
  • Maintain all existing functionality

Fixes requested via Slack mention.


Important

Fixes negative cost values and improves label visibility in evals/plot.tsx by adjusting X-axis domain and chart margin.

  • Behavior:
    • Prevents negative cost values on X-axis in plot.tsx by using Math.max(0, ...).
    • Increases top margin from 0 to 20 pixels in plot.tsx to prevent label truncation.
  • Testing:
    • Verified cost axis starts at $0 or higher.
    • Ensured labels at the top of the chart are fully visible.
    • Confirmed no existing functionality is broken.

This description was created by Ellipsis for 92efe55. You can customize this summary. It will automatically update as commits are pushed.

@roomote roomote bot requested review from cte, jr and mrubens as code owners September 9, 2025 21:43
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working UI/UX UI/UX related or focused labels Sep 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

🚀 Preview deployed!

Your changes have been deployed to Vercel:

Preview URL: https://roo-code-website-gkcg5sa1n-roo-code.vercel.app

This preview will be updated automatically when you push new commits to this PR.

Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code because apparently I trust no one, not even myself.

name="Cost"
domain={[
(dataMin: number) => Math.round((dataMin - 5) / 5) * 5,
(dataMin: number) => Math.max(0, Math.round((dataMin - 5) / 5) * 5),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good fix for preventing negative costs! I notice the Y-axis already uses this same pattern on line 194, so this improves consistency.

One thought: could we also consider adding a small right margin (maybe 10-20px) to prevent potential label truncation on the right edge, similar to what we did for the top margin?

domain={[
(dataMin: number) => Math.round((dataMin - 5) / 5) * 5,
(dataMin: number) => Math.max(0, Math.round((dataMin - 5) / 5) * 5),
(dataMax: number) => Math.round((dataMax + 5) / 5) * 5,
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 value 5 appears to be used as a rounding factor here and in other domain calculations. Would it make sense to extract this to a named constant like AXIS_ROUNDING_FACTOR or add a comment explaining why 5 was chosen? This would make the intent clearer for future maintenance.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 9, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 9, 2025
@mrubens mrubens merged commit 48d592f into main Sep 9, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 9, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 9, 2025
@mrubens mrubens deleted the fix/evals-chart-cost-and-labels branch September 9, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants