Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 6, 2025

This PR updates the evals page to display "-" instead of "0" for missing data, providing better visual clarity when data is not available.

Changes

  • Updated formatting functions (formatCurrency, formatDuration, formatTokens) to handle null/undefined values and return "-"
  • Modified evals.tsx to pass undefined for missing model info and language scores instead of defaulting to 0
  • Language scores now explicitly check for undefined values and display "-" when data is missing

Context

This change was requested via Slack to improve the user experience by clearly distinguishing between actual zero values and missing data on the evals page.

Fixes: Display "-" instead of "0" for missing data on evals page


Important

Display "-" instead of "0" for missing data on the evals page by updating formatting functions and evals component.

  • Behavior:
    • Display "-" instead of "0" for missing data on the evals page.
    • evals.tsx: Pass undefined for missing model info and language scores.
  • Formatting Functions:
    • formatCurrency, formatDuration, formatTokens: Return "-" for null or undefined values.
  • Context:
    • Improves user experience by distinguishing between zero and missing data.

This description was created by Ellipsis for be1ef46. 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 6, 2025 20:59
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused labels Sep 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2025

🚀 Preview deployed!

Your changes have been deployed to Vercel:

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

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 6, 2025
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 is like debugging in production - technically possible but morally questionable.


export const formatCurrency = (amount: number) => formatter.format(amount)
export const formatCurrency = (amount: number | null | undefined) => {
if (amount === null || amount === undefined) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would it be good to add unit tests for this new null/undefined handling behavior? I notice there aren't any tests for these formatting functions yet, and it would help ensure the "-" fallback works correctly across all edge cases.

export const formatDuration = (durationMs: number) => {
export const formatDuration = (durationMs: number | null | undefined) => {
if (durationMs === null || durationMs === undefined) {
return "-"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same null-checking pattern as the other formatters. Could we consider extracting this into a shared utility like formatWithFallback(value, formatter) to reduce duplication? Though I understand if we prefer the explicit approach for clarity.

<TableCell className="border-r">{formatCurrency(run.taskMetrics.cost)}</TableCell>
<TableCell className="text-muted-foreground">
{formatScore(run.languageScores?.go ?? 0)}%
{run.languageScores?.go !== undefined ? `${formatScore(run.languageScores.go)}%` : "-"}
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 this intentional that we're distinguishing between genuine zero values and missing data? For example, a model with 0% score will show "0%" while missing scores show "-". Just confirming this is the desired UX behavior.

export const formatTokens = (tokens: number, decimals = 0) => {
export const formatTokens = (tokens: number | null | undefined, decimals = 0) => {
if (tokens === null || tokens === undefined) {
return "-"
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 chart rendering code in evals.tsx still passes potentially null/undefined values to formatCurrency within the chart components. Is the Recharts library handling these gracefully, or should we add null checks before passing to the chart components?

...run,
label: run.description || run.model,
score: formatScore(run.passed / (run.passed + run.failed)),
score: Math.round((run.passed / (run.passed + run.failed)) * 100),
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider guarding against a zero or missing denominator. If run.passed + run.failed is 0 (or if either is undefined), Math.round(NaN) will return NaN rather than '-' for missing data. Add a check to return an appropriate fallback (e.g. undefined or '-' value) when data is missing.

Suggested change
score: Math.round((run.passed / (run.passed + run.failed)) * 100),
score: (run.passed != null && run.failed != null && (run.passed + run.failed) > 0) ? Math.round((run.passed / (run.passed + run.failed)) * 100) : "-",

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 6, 2025
@mrubens mrubens merged commit 9378a4e into main Sep 6, 2025
16 checks passed
@mrubens mrubens deleted the feat/evals-show-dash-for-missing-data branch September 6, 2025 21:15
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 6, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 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.

3 participants