Spaces:
Running
Running
Avijit Ghosh
commited on
Commit
·
7bfe5bc
1
Parent(s):
94700ed
fixed some bugs
Browse files- app/page.tsx +15 -14
- components/evaluation-card.tsx +8 -8
app/page.tsx
CHANGED
|
@@ -488,17 +488,17 @@ export default function HomePage() {
|
|
| 488 |
return (
|
| 489 |
<div className="min-h-screen bg-background">
|
| 490 |
<header className="border-b bg-card">
|
| 491 |
-
<div className="container mx-auto px-6 py-4">
|
| 492 |
-
<div className="flex items-center justify-between">
|
| 493 |
<div>
|
| 494 |
-
<h1 className="text-2xl font-bold font-heading text-foreground">AI Evaluation Dashboard</h1>
|
| 495 |
<p className="text-sm text-muted-foreground">Manage and track your AI system evaluations</p>
|
| 496 |
</div>
|
| 497 |
-
<div className="flex items-center gap-3">
|
| 498 |
<Link href="/about">
|
| 499 |
<Button variant="ghost" size="sm" className="gap-2">
|
| 500 |
<Info className="h-4 w-4" />
|
| 501 |
-
About
|
| 502 |
</Button>
|
| 503 |
</Link>
|
| 504 |
<Button
|
|
@@ -513,26 +513,27 @@ export default function HomePage() {
|
|
| 513 |
</Button>
|
| 514 |
<Button onClick={() => setShowNewEvaluation(true)} className="gap-2">
|
| 515 |
<Plus className="h-4 w-4" />
|
| 516 |
-
New Eval Card
|
|
|
|
| 517 |
</Button>
|
| 518 |
</div>
|
| 519 |
</div>
|
| 520 |
</div>
|
| 521 |
</header>
|
| 522 |
|
| 523 |
-
<div className="container mx-auto px-6 py-6">
|
| 524 |
<div className="space-y-6">
|
| 525 |
<div className="flex items-center justify-between">
|
| 526 |
<h2 className="text-xl font-semibold font-heading">Evaluation Cards</h2>
|
| 527 |
<p className="text-sm text-muted-foreground">{filteredAndSortedEvaluations.length} eval cards</p>
|
| 528 |
</div>
|
| 529 |
|
| 530 |
-
<div className="flex flex-wrap items-center gap-4 p-4 bg-card rounded-lg border">
|
| 531 |
-
<div className="flex items-center gap-2">
|
| 532 |
<ArrowUpDown className="h-4 w-4 text-muted-foreground" />
|
| 533 |
<span className="text-sm font-medium">Sort by:</span>
|
| 534 |
<Select value={sortBy} onValueChange={(value: "date-newest" | "date-oldest" | "completeness-highest" | "completeness-lowest") => setSortBy(value)}>
|
| 535 |
-
<SelectTrigger className="w-48">
|
| 536 |
<SelectValue />
|
| 537 |
</SelectTrigger>
|
| 538 |
<SelectContent>
|
|
@@ -544,11 +545,11 @@ export default function HomePage() {
|
|
| 544 |
</Select>
|
| 545 |
</div>
|
| 546 |
|
| 547 |
-
<div className="flex items-center gap-2">
|
| 548 |
<Filter className="h-4 w-4 text-muted-foreground" />
|
| 549 |
<span className="text-sm font-medium">Provider:</span>
|
| 550 |
<Select value={filterByProvider} onValueChange={setFilterByProvider}>
|
| 551 |
-
<SelectTrigger className="w-40">
|
| 552 |
<SelectValue />
|
| 553 |
</SelectTrigger>
|
| 554 |
<SelectContent>
|
|
@@ -562,11 +563,11 @@ export default function HomePage() {
|
|
| 562 |
</Select>
|
| 563 |
</div>
|
| 564 |
|
| 565 |
-
<div className="flex items-center gap-2">
|
| 566 |
<Filter className="h-4 w-4 text-muted-foreground" />
|
| 567 |
<span className="text-sm font-medium">Modality:</span>
|
| 568 |
<Select value={filterByModality} onValueChange={setFilterByModality}>
|
| 569 |
-
<SelectTrigger className="w-40">
|
| 570 |
<SelectValue />
|
| 571 |
</SelectTrigger>
|
| 572 |
<SelectContent>
|
|
|
|
| 488 |
return (
|
| 489 |
<div className="min-h-screen bg-background">
|
| 490 |
<header className="border-b bg-card">
|
| 491 |
+
<div className="container mx-auto px-4 sm:px-6 py-4">
|
| 492 |
+
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
|
| 493 |
<div>
|
| 494 |
+
<h1 className="text-xl sm:text-2xl font-bold font-heading text-foreground">AI Evaluation Dashboard</h1>
|
| 495 |
<p className="text-sm text-muted-foreground">Manage and track your AI system evaluations</p>
|
| 496 |
</div>
|
| 497 |
+
<div className="flex items-center gap-2 sm:gap-3">
|
| 498 |
<Link href="/about">
|
| 499 |
<Button variant="ghost" size="sm" className="gap-2">
|
| 500 |
<Info className="h-4 w-4" />
|
| 501 |
+
<span className="hidden sm:inline">About</span>
|
| 502 |
</Button>
|
| 503 |
</Link>
|
| 504 |
<Button
|
|
|
|
| 513 |
</Button>
|
| 514 |
<Button onClick={() => setShowNewEvaluation(true)} className="gap-2">
|
| 515 |
<Plus className="h-4 w-4" />
|
| 516 |
+
<span className="hidden sm:inline">New Eval Card</span>
|
| 517 |
+
<span className="sm:hidden">New</span>
|
| 518 |
</Button>
|
| 519 |
</div>
|
| 520 |
</div>
|
| 521 |
</div>
|
| 522 |
</header>
|
| 523 |
|
| 524 |
+
<div className="container mx-auto px-4 sm:px-6 py-4 sm:py-6">
|
| 525 |
<div className="space-y-6">
|
| 526 |
<div className="flex items-center justify-between">
|
| 527 |
<h2 className="text-xl font-semibold font-heading">Evaluation Cards</h2>
|
| 528 |
<p className="text-sm text-muted-foreground">{filteredAndSortedEvaluations.length} eval cards</p>
|
| 529 |
</div>
|
| 530 |
|
| 531 |
+
<div className="flex flex-col sm:flex-row sm:flex-wrap items-start sm:items-center gap-3 sm:gap-4 p-4 bg-card rounded-lg border">
|
| 532 |
+
<div className="flex items-center gap-2 w-full sm:w-auto">
|
| 533 |
<ArrowUpDown className="h-4 w-4 text-muted-foreground" />
|
| 534 |
<span className="text-sm font-medium">Sort by:</span>
|
| 535 |
<Select value={sortBy} onValueChange={(value: "date-newest" | "date-oldest" | "completeness-highest" | "completeness-lowest") => setSortBy(value)}>
|
| 536 |
+
<SelectTrigger className="w-full sm:w-48">
|
| 537 |
<SelectValue />
|
| 538 |
</SelectTrigger>
|
| 539 |
<SelectContent>
|
|
|
|
| 545 |
</Select>
|
| 546 |
</div>
|
| 547 |
|
| 548 |
+
<div className="flex items-center gap-2 w-full sm:w-auto">
|
| 549 |
<Filter className="h-4 w-4 text-muted-foreground" />
|
| 550 |
<span className="text-sm font-medium">Provider:</span>
|
| 551 |
<Select value={filterByProvider} onValueChange={setFilterByProvider}>
|
| 552 |
+
<SelectTrigger className="w-full sm:w-40">
|
| 553 |
<SelectValue />
|
| 554 |
</SelectTrigger>
|
| 555 |
<SelectContent>
|
|
|
|
| 563 |
</Select>
|
| 564 |
</div>
|
| 565 |
|
| 566 |
+
<div className="flex items-center gap-2 w-full sm:w-auto">
|
| 567 |
<Filter className="h-4 w-4 text-muted-foreground" />
|
| 568 |
<span className="text-sm font-medium">Modality:</span>
|
| 569 |
<Select value={filterByModality} onValueChange={setFilterByModality}>
|
| 570 |
+
<SelectTrigger className="w-full sm:w-40">
|
| 571 |
<SelectValue />
|
| 572 |
</SelectTrigger>
|
| 573 |
<SelectContent>
|
components/evaluation-card.tsx
CHANGED
|
@@ -214,17 +214,17 @@ export function EvaluationCard({ evaluation, onView, onDelete }: EvaluationCardP
|
|
| 214 |
onClick={handleCardClick}
|
| 215 |
>
|
| 216 |
<CardHeader className="pb-3">
|
| 217 |
-
<div className="flex items-start justify-between">
|
| 218 |
<div className="space-y-1 flex-1 min-w-0">
|
| 219 |
-
<CardTitle className="text-xl font-bold
|
| 220 |
-
<p className="text-sm text-muted-foreground
|
| 221 |
{/* Enhanced modality badge with emoji and hover detail */}
|
| 222 |
{(() => {
|
| 223 |
const info = getModalityDisplay(evaluation.inputModalities, evaluation.outputModalities)
|
| 224 |
return (
|
| 225 |
<Tooltip>
|
| 226 |
<TooltipTrigger asChild>
|
| 227 |
-
<Badge variant="secondary" className="text-xs px-2 py-1 w-fit flex items-center gap-
|
| 228 |
{info.emoji ? <span aria-hidden className="text-sm">{info.emoji}</span> : null}
|
| 229 |
<span className="whitespace-nowrap">{info.label}</span>
|
| 230 |
</Badge>
|
|
@@ -268,7 +268,7 @@ export function EvaluationCard({ evaluation, onView, onDelete }: EvaluationCardP
|
|
| 268 |
</CardHeader>
|
| 269 |
<CardContent className="space-y-4">
|
| 270 |
{/* Top row: Key metrics */}
|
| 271 |
-
<div className="grid grid-cols-2 gap-4">
|
| 272 |
<div className="space-y-1">
|
| 273 |
<span className="text-sm text-muted-foreground font-medium">Completeness</span>
|
| 274 |
<div className="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-6 overflow-hidden">
|
|
@@ -288,9 +288,9 @@ export function EvaluationCard({ evaluation, onView, onDelete }: EvaluationCardP
|
|
| 288 |
|
| 289 |
{/* Quick summary stats */}
|
| 290 |
<div className="space-y-3">
|
| 291 |
-
<div className="grid grid-cols-2 gap-
|
| 292 |
<div className="space-y-2">
|
| 293 |
-
<div className="flex items-center justify-between">
|
| 294 |
<span className="text-sm text-muted-foreground font-medium">Capability Eval</span>
|
| 295 |
<span className="text-xs text-muted-foreground">({evaluation.capabilityEval.totalApplicable} applicable)</span>
|
| 296 |
</div>
|
|
@@ -355,7 +355,7 @@ export function EvaluationCard({ evaluation, onView, onDelete }: EvaluationCardP
|
|
| 355 |
</div>
|
| 356 |
|
| 357 |
<div className="space-y-2">
|
| 358 |
-
<div className="flex items-center justify-between">
|
| 359 |
<span className="text-sm text-muted-foreground font-medium">Risk Eval</span>
|
| 360 |
<span className="text-xs text-muted-foreground">({evaluation.riskEval.totalApplicable} applicable)</span>
|
| 361 |
</div>
|
|
|
|
| 214 |
onClick={handleCardClick}
|
| 215 |
>
|
| 216 |
<CardHeader className="pb-3">
|
| 217 |
+
<div className="flex items-start justify-between gap-3">
|
| 218 |
<div className="space-y-1 flex-1 min-w-0">
|
| 219 |
+
<CardTitle className="text-lg sm:text-xl font-bold leading-tight">{evaluation.systemName}</CardTitle>
|
| 220 |
+
<p className="text-sm text-muted-foreground font-medium">{evaluation.provider}</p>
|
| 221 |
{/* Enhanced modality badge with emoji and hover detail */}
|
| 222 |
{(() => {
|
| 223 |
const info = getModalityDisplay(evaluation.inputModalities, evaluation.outputModalities)
|
| 224 |
return (
|
| 225 |
<Tooltip>
|
| 226 |
<TooltipTrigger asChild>
|
| 227 |
+
<Badge variant="secondary" className="text-xs px-2 py-1 w-fit flex items-center gap-1 cursor-help">
|
| 228 |
{info.emoji ? <span aria-hidden className="text-sm">{info.emoji}</span> : null}
|
| 229 |
<span className="whitespace-nowrap">{info.label}</span>
|
| 230 |
</Badge>
|
|
|
|
| 268 |
</CardHeader>
|
| 269 |
<CardContent className="space-y-4">
|
| 270 |
{/* Top row: Key metrics */}
|
| 271 |
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
| 272 |
<div className="space-y-1">
|
| 273 |
<span className="text-sm text-muted-foreground font-medium">Completeness</span>
|
| 274 |
<div className="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-6 overflow-hidden">
|
|
|
|
| 288 |
|
| 289 |
{/* Quick summary stats */}
|
| 290 |
<div className="space-y-3">
|
| 291 |
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
| 292 |
<div className="space-y-2">
|
| 293 |
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1">
|
| 294 |
<span className="text-sm text-muted-foreground font-medium">Capability Eval</span>
|
| 295 |
<span className="text-xs text-muted-foreground">({evaluation.capabilityEval.totalApplicable} applicable)</span>
|
| 296 |
</div>
|
|
|
|
| 355 |
</div>
|
| 356 |
|
| 357 |
<div className="space-y-2">
|
| 358 |
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1">
|
| 359 |
<span className="text-sm text-muted-foreground font-medium">Risk Eval</span>
|
| 360 |
<span className="text-xs text-muted-foreground">({evaluation.riskEval.totalApplicable} applicable)</span>
|
| 361 |
</div>
|