Skip to content

Enhance Evaluation Detail Page with Scoring Status Indicators & Resync Warning#94

Merged
Ayush8923 merged 6 commits intomainfrom
fix/partial-scores-ux-hydration
Mar 27, 2026
Merged

Enhance Evaluation Detail Page with Scoring Status Indicators & Resync Warning#94
Ayush8923 merged 6 commits intomainfrom
fix/partial-scores-ux-hydration

Conversation

@Ayush8923
Copy link
Copy Markdown
Collaborator

@Ayush8923 Ayush8923 commented Mar 25, 2026

Summary:

  • On the evaluation detail page, when a scoring pipeline is still processing total_pairs < total_items,
    now shows:
  • A warning banner: Some traces are still being scored - click Resync to get the latest
  • Amber X/Y pairs ⚠ label on each affected metric card instead of the plain pairs count

Summary by CodeRabbit

  • New Features

    • Warning banner and Resync callout when metrics are incomplete
    • Pair-counts now show total_pairs/total_items with warning icon and tooltip when lower
    • Loading state for datasets with a centered loader in the datasets panel
    • New header/sidebar/export/action iconography (several new icons and re-exports)
    • Minor UI tweak: updated OK button styling in No Traces modal
  • Style

    • Added new design theme tokens and adjusted summary/metrics card styling

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f52693da-30c2-4a54-91ed-bd26a2190482

📥 Commits

Reviewing files that changed from the base of the PR and between 9d695de and 76f7276.

📒 Files selected for processing (1)
  • app/(routes)/evaluations/[id]/page.tsx
✅ Files skipped from review due to trivial changes (1)
  • app/(routes)/evaluations/[id]/page.tsx

📝 Walkthrough

Walkthrough

Replaces inline fetches with apiFetch, introduces dataset-loading state and Loader UI, adds six evaluation icon components and re-exports them, surfaces a metrics warning/resync when summary pair counts are incomplete, adjusts metric card displays/styling, and adds new CSS theme tokens in globals.css.

Changes

Cohort / File(s) Summary
Evaluation details page
app/(routes)/evaluations/[id]/page.tsx
Replaced direct fetch calls with apiFetch (API key passed), swapped inline SVGs for imported icon components, added metrics warning/resync callout when summary_scores have fewer total_pairs than job.total_items, updated pair-count displays and card styling.
Datasets loading UI
app/(routes)/evaluations/page.tsx, app/components/evaluations/DatasetsTab.tsx
Added isDatasetsLoading state in the page; DatasetsTab gained isDatasetsLoading: boolean prop and renders a centered Loader while datasets load instead of the previous empty-state behavior.
Icons
app/components/icons/evaluations/ChevronLeftIcon.tsx, app/components/icons/evaluations/WarningTriangleIcon.tsx, app/components/icons/evaluations/MenuIcon.tsx, app/components/icons/evaluations/DatabaseIcon.tsx, app/components/icons/evaluations/GroupIcon.tsx, app/components/icons/evaluations/RefreshIcon.tsx, app/components/icons/index.tsx
Added six new small SVG icon components (accepting className/style) and re-exported them from the icons index.
Global styles / theme tokens
app/globals.css
Added new CSS theme token declarations via @theme inline for background, text, border, accent, and status colors (--color-bg-*, --color-text-*, --color-border, --color-accent-*, --color-status-*).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Prajna1999
  • vprashrex
  • nishika26

Poem

🐇 I hopped through code at dawn's first light,
New icons gleam and loaders bright,
Warnings whisper when pairs aren't right,
Tokens color day and night,
A happy rabbit gives a tiny bite — delight! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main objective of the PR: adding scoring status indicators and a resync warning to the evaluation detail page.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/partial-scores-ux-hydration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ayush8923 Ayush8923 changed the base branch from main to feat/folder-structure-refactoring March 25, 2026 17:29
@Ayush8923 Ayush8923 self-assigned this Mar 25, 2026
Base automatically changed from feat/folder-structure-refactoring to main March 26, 2026 16:17
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
app/globals.css (1)

22-50: New theme tokens lack dark mode variants.

The new @theme inline blocks define light-mode-only color values. When users have prefers-color-scheme: dark, these tokens will retain their light values while the existing :root variables (lines 52-60) update for dark mode, causing visual inconsistency.

For example, --color-bg-primary: #ffffff will remain white in dark mode, but `--background: `#000000 will correctly switch to black.

♻️ Suggested approach

Either:

  1. Reference the existing :root variables within @theme inline:
`@theme` inline {
  --color-bg-primary: var(--background);
  --color-bg-secondary: var(--background-secondary);
  /* etc. */
}
  1. Or add corresponding dark mode overrides for the new tokens.

Note: The Stylelint scss/at-rule-no-unknown errors for @theme are false positives—@theme inline is valid Tailwind CSS v4 syntax.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/globals.css` around lines 22 - 50, The new `@theme` inline blocks set
light-only literals (e.g. --color-bg-primary, --color-bg-secondary,
--color-text-primary, --color-accent-primary, --color-status-success) which will
not adapt to dark mode; update the `@theme` inline declarations to either
reference the existing :root variables (for example point --color-bg-primary to
var(--background) and --color-bg-secondary to var(--background-secondary), and
similarly map text, accent and status tokens to their corresponding --foreground
/ --accent / --status variables) or add matching dark-mode overrides for these
tokens so they change when prefers-color-scheme or your existing dark :root
values are applied.
app/(routes)/evaluations/[id]/page.tsx (2)

690-695: Consider using colors object for categorical card styling.

Lines 690-731 use Tailwind theme classes like bg-bg-primary, text-text-secondary, bg-bg-secondary, and text-text-primary instead of the colors object used elsewhere in this file. This creates inconsistency with the numeric cards (lines 644-683) which use inline styles with colors.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(routes)/evaluations/[id]/page.tsx around lines 690 - 695, The
categorical card blocks use Tailwind theme classes (e.g., the outer div with
className "rounded-lg px-6 py-5 flex-1 min-w-[180px] relative bg-bg-primary" and
the inner label div "text-xs font-medium mb-3 text-center text-text-secondary",
as well as the alternate card using "bg-bg-secondary" and "text-text-primary")
which is inconsistent with the numeric cards that use the shared colors object;
update these categorical card elements to use inline style properties that
reference the same colors object (set backgroundColor and color from colors.*
while keeping existing utility classes like rounded-lg, px-6, py-5, flex-1,
min-w-[180px], relative) so styling is consistent with the numeric cards.

629-629: Hardcoded color value instead of using the colors object.

The class bg-[#171717] uses a hardcoded hex value. Per coding guidelines, colors should reference the colors object from /app/lib/colors.ts.

♻️ Suggested refactor
-                    className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-[`#171717`] text-white disabled:opacity-50"
+                    className="flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium disabled:opacity-50"
+                    style={{
+                      backgroundColor: colors.accent.primary,
+                      color: "#ffffff",
+                    }}

As per coding guidelines: "Use centralized colors from /app/lib/colors.ts instead of hardcoded hex values for styling."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(routes)/evaluations/[id]/page.tsx at line 629, The button currently
uses a hardcoded hex class "bg-[`#171717`]" in the className string; import the
centralized colors object from /app/lib/colors.ts and replace that hardcoded
value by using the color from the colors export (e.g., use
colors.<appropriateKey>) instead—update the component in page.tsx where the
className contains "bg-[`#171717`]" to either set an inline style backgroundColor:
colors.<key> or apply a CSS variable backed by colors.<key>, and remove the
hardcoded bg-[`#171717`] token so the component uses the shared colors object
(ensure you reference the same exported symbol name from colors.ts).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/`(routes)/evaluations/[id]/page.tsx:
- Around line 611-617: The Tailwind arbitrary background class in the div (the
element containing WarningTriangleIcon and the "Resync" copy) is malformed due
to spaces inside the brackets; update the background so it parses correctly by
either removing spaces (e.g., bg-[rgba(245,158,11,0.08)]) or—per project
guidelines—replace the bg-* class with an inline style that references the
shared colors object (set style={{ backgroundColor: colors.warning + "14" }} or
equivalent) while keeping the existing border-[rgba(245,158,11,0.3)] and other
Tailwind classes intact; modify the same div in page.tsx where the warning
banner is rendered.

In `@app/components/icons/evaluations/MenuIcon.tsx`:
- Line 9: The MenuIcon currently sets className with `className ?? "w-5 h-5"`
which replaces the default size when a className is provided; update the
className handling in MenuIcon (the JSX element using className) to append user
classes to the default sizing like the other icons by composing the string as
`w-5 h-5 ${className ?? ""}` so custom classes (e.g., text color) do not remove
sizing.

---

Nitpick comments:
In `@app/`(routes)/evaluations/[id]/page.tsx:
- Around line 690-695: The categorical card blocks use Tailwind theme classes
(e.g., the outer div with className "rounded-lg px-6 py-5 flex-1 min-w-[180px]
relative bg-bg-primary" and the inner label div "text-xs font-medium mb-3
text-center text-text-secondary", as well as the alternate card using
"bg-bg-secondary" and "text-text-primary") which is inconsistent with the
numeric cards that use the shared colors object; update these categorical card
elements to use inline style properties that reference the same colors object
(set backgroundColor and color from colors.* while keeping existing utility
classes like rounded-lg, px-6, py-5, flex-1, min-w-[180px], relative) so styling
is consistent with the numeric cards.
- Line 629: The button currently uses a hardcoded hex class "bg-[`#171717`]" in
the className string; import the centralized colors object from
/app/lib/colors.ts and replace that hardcoded value by using the color from the
colors export (e.g., use colors.<appropriateKey>) instead—update the component
in page.tsx where the className contains "bg-[`#171717`]" to either set an inline
style backgroundColor: colors.<key> or apply a CSS variable backed by
colors.<key>, and remove the hardcoded bg-[`#171717`] token so the component uses
the shared colors object (ensure you reference the same exported symbol name
from colors.ts).

In `@app/globals.css`:
- Around line 22-50: The new `@theme` inline blocks set light-only literals (e.g.
--color-bg-primary, --color-bg-secondary, --color-text-primary,
--color-accent-primary, --color-status-success) which will not adapt to dark
mode; update the `@theme` inline declarations to either reference the existing
:root variables (for example point --color-bg-primary to var(--background) and
--color-bg-secondary to var(--background-secondary), and similarly map text,
accent and status tokens to their corresponding --foreground / --accent /
--status variables) or add matching dark-mode overrides for these tokens so they
change when prefers-color-scheme or your existing dark :root values are applied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 043d13c6-08ca-487c-b4fa-8e3311f181b8

📥 Commits

Reviewing files that changed from the base of the PR and between 5033825 and aa74255.

📒 Files selected for processing (11)
  • app/(routes)/evaluations/[id]/page.tsx
  • app/(routes)/evaluations/page.tsx
  • app/components/evaluations/DatasetsTab.tsx
  • app/components/icons/evaluations/ChevronLeftIcon.tsx
  • app/components/icons/evaluations/DatabaseIcon.tsx
  • app/components/icons/evaluations/GroupIcon.tsx
  • app/components/icons/evaluations/MenuIcon.tsx
  • app/components/icons/evaluations/RefreshIcon.tsx
  • app/components/icons/evaluations/WarningTriangleIcon.tsx
  • app/components/icons/index.tsx
  • app/globals.css

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
app/(routes)/evaluations/[id]/page.tsx (3)

660-689: Inconsistent styling approach within categorical cards.

The categorical metric cards mix Tailwind custom property classes (bg-bg-primary, text-text-secondary) with inline style props using the colors object (line 681). For consistency with the rest of the file and coding guidelines, consider using one approach throughout.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(routes)/evaluations/[id]/page.tsx around lines 660 - 689, The
categorical card UI mixes Tailwind CSS utility classes (e.g., className values
like "rounded-lg", "bg-bg-primary", "text-text-secondary") with an inline style
using the colors object for the value span (the inline style referencing
colors.text.primary in the map over summary.distribution). Replace the inline
style on that span with the matching Tailwind/custom CSS token class (or add a
utility class tied to the same token) so styling is consistent: locate the map
over summary.distribution in the component that renders summary cards (the code
referencing summary and colors) and change the span using style={{ color:
colors.text.primary }} to use the appropriate Tailwind/custom class (e.g.,
text-text-primary or a newly added class) to match the rest of the file.

146-160: Unused fetch results in fetchConfigInfo.

Both apiFetch calls discard their results. If this is intentional cache-warming, consider adding a brief comment. Otherwise, if these fetches serve no purpose, they could be removed to avoid unnecessary network requests.

💡 Add clarifying comment if intentional
 const fetchConfigInfo = async (
   configId: string,
   configVersion: number,
   apiKey: string,
 ) => {
   try {
+    // Pre-warm cache for config data (results used elsewhere)
     await apiFetch(`/api/configs/${configId}`, apiKey);
     await apiFetch(
       `/api/configs/${configId}/versions/${configVersion}`,
       apiKey,
     );
   } catch (error) {
     console.error("Error fetching config version info:", error);
   }
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(routes)/evaluations/[id]/page.tsx around lines 146 - 160, The two
apiFetch calls inside fetchConfigInfo currently discard their results; either
use the returned data (e.g., assign to variables or pass to a consumer) or, if
these calls are only intended to warm caches/prime session state, add a concise
comment above the calls stating that intent and why the results are ignored;
alternatively remove the unnecessary apiFetch calls entirely if they serve no
purpose. Ensure you update the fetchConfigInfo function signature/return type if
you choose to return data, and reference the apiFetch calls and fetchConfigInfo
to locate and modify the code.

578-588: Consider using colors object for color values.

The warning banner now uses valid Tailwind classes (bg-amber-500/10, border-amber-500/30), fixing the previous malformed arbitrary value. However, per coding guidelines, color values should reference the colors object via inline styles rather than hardcoded Tailwind color classes.

♻️ Proposed refactor using colors object
-                    <div className="flex items-center gap-2 px-3 py-2 rounded-lg mb-3 text-xs bg-amber-500/10 border border-amber-500/30 text-status-warning">
+                    <div 
+                      className="flex items-center gap-2 px-3 py-2 rounded-lg mb-3 text-xs border"
+                      style={{
+                        backgroundColor: `${colors.status.warning}1A`,
+                        borderColor: `${colors.status.warning}4D`,
+                        color: colors.status.warning,
+                      }}
+                    >

As per coding guidelines: "Use Tailwind CSS for layout and spacing, and inline styles (referencing the colors object) for colors."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`(routes)/evaluations/[id]/page.tsx around lines 578 - 588, The banner is
using hardcoded Tailwind color classes (bg-amber-500/10, border-amber-500/30);
change it to use the shared colors object instead: import the colors map and
remove the Tailwind color utility classes from the div around the
WarningTriangleIcon (the JSX that checks summaryScores and job), then apply
equivalent inline style properties (backgroundColor, borderColor, color) derived
from colors.amber at the appropriate shades/opacity so spacing/layout classes
remain in Tailwind while all color values come from the colors object.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/`(routes)/evaluations/[id]/page.tsx:
- Line 132: This file has Prettier formatting issues (extra trailing
whitespace); run Prettier to fix and reformat the file and remove the stray
whitespace on the offending line—run `npx prettier --write` for the page
component (the top-level default export in page.tsx), then stage the updated
file and push the formatted changes so CI will pass.

---

Nitpick comments:
In `@app/`(routes)/evaluations/[id]/page.tsx:
- Around line 660-689: The categorical card UI mixes Tailwind CSS utility
classes (e.g., className values like "rounded-lg", "bg-bg-primary",
"text-text-secondary") with an inline style using the colors object for the
value span (the inline style referencing colors.text.primary in the map over
summary.distribution). Replace the inline style on that span with the matching
Tailwind/custom CSS token class (or add a utility class tied to the same token)
so styling is consistent: locate the map over summary.distribution in the
component that renders summary cards (the code referencing summary and colors)
and change the span using style={{ color: colors.text.primary }} to use the
appropriate Tailwind/custom class (e.g., text-text-primary or a newly added
class) to match the rest of the file.
- Around line 146-160: The two apiFetch calls inside fetchConfigInfo currently
discard their results; either use the returned data (e.g., assign to variables
or pass to a consumer) or, if these calls are only intended to warm caches/prime
session state, add a concise comment above the calls stating that intent and why
the results are ignored; alternatively remove the unnecessary apiFetch calls
entirely if they serve no purpose. Ensure you update the fetchConfigInfo
function signature/return type if you choose to return data, and reference the
apiFetch calls and fetchConfigInfo to locate and modify the code.
- Around line 578-588: The banner is using hardcoded Tailwind color classes
(bg-amber-500/10, border-amber-500/30); change it to use the shared colors
object instead: import the colors map and remove the Tailwind color utility
classes from the div around the WarningTriangleIcon (the JSX that checks
summaryScores and job), then apply equivalent inline style properties
(backgroundColor, borderColor, color) derived from colors.amber at the
appropriate shades/opacity so spacing/layout classes remain in Tailwind while
all color values come from the colors object.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 369b94a0-51d9-4489-8a59-d6ae50036cad

📥 Commits

Reviewing files that changed from the base of the PR and between aa74255 and 9d695de.

📒 Files selected for processing (1)
  • app/(routes)/evaluations/[id]/page.tsx

@Ayush8923 Ayush8923 merged commit 419b9e7 into main Mar 27, 2026
2 checks passed
@Ayush8923 Ayush8923 deleted the fix/partial-scores-ux-hydration branch March 27, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants