From 45e70b5d947c6ade76beb2418a7fe9f2933d7dc9 Mon Sep 17 00:00:00 2001 From: Ken Ojibe Date: Tue, 5 May 2026 10:55:39 -0400 Subject: [PATCH] fix: make Runs/Blueprints tooltips functional on model card page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extract stats into PerformanceSummaryStats client component so Radix UI tooltip hydration works (page.tsx is a Server Component) - Use TooltipTrigger as native button (no asChild) for reliable pointer-event capture - Add info icon (ℹ) to the right of each label - Set delayDuration={200} on TooltipProvider Co-Authored-By: Claude Sonnet 4.6 --- .../[modelId]/PerformanceSummaryStats.tsx | 48 +++++++++++++++++++ src/app/(standard)/cards/[modelId]/page.tsx | 39 ++------------- 2 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 src/app/(standard)/cards/[modelId]/PerformanceSummaryStats.tsx diff --git a/src/app/(standard)/cards/[modelId]/PerformanceSummaryStats.tsx b/src/app/(standard)/cards/[modelId]/PerformanceSummaryStats.tsx new file mode 100644 index 00000000..5f310fb8 --- /dev/null +++ b/src/app/(standard)/cards/[modelId]/PerformanceSummaryStats.tsx @@ -0,0 +1,48 @@ +"use client" + +import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@/components/ui/tooltip'; +import Icon from '@/components/ui/icon'; + +interface Props { + totalRuns: number; + totalBlueprints: number; +} + +export default function PerformanceSummaryStats({ totalRuns, totalBlueprints }: Props) { + return ( + +
+
+
+ + + + Runs + + + + Number of times this model was evaluated across all blueprints + + +
+ {totalRuns} +
+
+
+ + + + Blueprints + + + + Distinct evaluation blueprints/configs this model was tested on + + +
+ {totalBlueprints} +
+
+
+ ); +} diff --git a/src/app/(standard)/cards/[modelId]/page.tsx b/src/app/(standard)/cards/[modelId]/page.tsx index bf7b33d7..abad18db 100644 --- a/src/app/(standard)/cards/[modelId]/page.tsx +++ b/src/app/(standard)/cards/[modelId]/page.tsx @@ -8,7 +8,7 @@ import Link from 'next/link'; import Icon, { type IconName } from '@/components/ui/icon'; import ResponseRenderer from '@/app/components/ResponseRenderer'; import RemarkGfmPlugin from 'remark-gfm'; -import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@/components/ui/tooltip'; +import PerformanceSummaryStats from './PerformanceSummaryStats'; // Shared formatters const formatPercent = (value?: number | null, fractionDigits = 1): string => { @@ -285,41 +285,13 @@ export default async function ModelCardPage({ params }: ModelCardPageProps) { {/* Right Column - Stats & Metadata (Secondary) */}
- - {/* Quick Stats */}

Performance Summary

-
-
-
- - - - Runs - - - Number of times this model was evaluated across all blueprints - - -
- {modelCard.overallStats.totalRuns} -
-
-
- - - - Blueprints - - - Distinct evaluation blueprints/configs this model was tested on - - -
- {modelCard.overallStats.totalBlueprints} -
-
+
{/* Top Dimensional Performance */} @@ -496,7 +468,6 @@ export default async function ModelCardPage({ params }: ModelCardPageProps) {
Updated {new Date(modelCard.lastUpdated).toLocaleDateString()}
-