The user wants me to create a sophisticated AI label quality UI for reinforcement learning. This is a professional data labeling/annotation quality management interface. Let me think about what this should include:
-
Triage Queues - Different priority queues for labels that need review
- High priority (disagreements, low confidence)
- Medium priority
- Low priority
- Ability to filter and sort
-
Disagreement Heatmaps - Visual representation of where annotators disagree
- Could be a grid/matrix showing label categories vs disagreement levels
- Color-coded intensity
- Interactive hover states
-
Reviewer Analytics - Stats about reviewer performance
- Accuracy rates
- Speed/throughput
- Agreement rates with others
- Activity over time
Design considerations:
- Professional, data-heavy dashboard feel
- Dark theme would work well for this kind of tool (reduces eye strain for data workers)
- Clean typography, good data visualization
- Multiple interactive elements
- Animated transitions for data states
Color palette:
- Dark background (not pure black)
- Accent colors for different priority levels (red/orange for high, yellow for medium, green for low)
- Good contrast for readability
Let me build this as a comprehensive single-page dashboard with:
- Header with navigation
- Stats cards at top
- Main content area with:
- Triage queue panel (left)
- Disagreement heatmap (center/top right)
- Reviewer analytics (bottom)
- Animated elements, hover states, click interactions
- Simulated data
I'll make it visually impressive with:
- Smooth animations
- Interactive heatmap cells
- Sortable/filterable queue
- Real-time feel with number animations
- Professional dark theme with good contrast
AI Label Quality UI for Reinforcement Learning
This is a professional dashboard for managing label quality in RL workflows. Here's my approach:
- Triage Queues - Interactive priority-based queues with filtering and batch actions
- Disagreement Heatmaps - Visual matrix showing annotator disagreement patterns
- Reviewer Analytics - Performance metrics with animated charts and rankings
The design uses a dark professional theme with high contrast for data-heavy workflows.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Label Quality Dashboard | RL Training</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0a0e14;
--bg-elevated: #12171f;
--bg-card: #181e28;
--fg: #e8edf5;
--fg-muted: #6b7a8f;
--border: #252d3a;
--accent: #00d9a5;
--accent-dim: rgba(0, 217, 165, 0.15);
--high: #ff4d6a;
--medium: #ffb020;
--low: #00d9a5;
--info: #3b9eff;
}
* { box-sizing: border-box; }
body {
font-family: 'Space Grotesk', sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
}
.font-mono { font-family: 'JetBrains Mono', monospace; }
/* Background pattern */
.bg-pattern {
background-image:
radial-gradient(circle at 20% 20%, rgba(0, 217, 165, 0.03) 0%, transparent 50%),
radial-gradient(circle at 80% 80%, rgba(59, 158, 255, 0.03) 0%, transparent 50%),
linear-gradient(rgba(37, 45, 58, 0.3) 1px, transparent 1px),
linear-gradient(90deg, rgba(37, 45, 58, 0.3) 1px, transparent 1px);
background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}
/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }
/* Animations */
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@keyframes countUp {
from { opacity: 0; transform: scale(0.8); }
to { opacity: 1; transform: scale(1); }
}
.animate-fade-up {
animation: fadeSlideUp 0.6s ease-out forwards;
opacity: 0;
}
.animate-pulse-slow { animation: pulse 2s ease-in-out infinite; }
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Heatmap cell */
.heatmap-cell {
transition: all 0.2s ease;
cursor: pointer;
}
.heatmap-cell:hover {
transform: scale(1.1);
z-index: 10;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
/* Queue item */
.queue-item {
transition: all 0.2s ease;
border-left: 3px solid transparent;
}
.queue-item:hover {
background: var(--bg-elevated);
border-left-color: var(--accent);
}
.queue-item.selected {
background: var(--accent-dim);
border-left-color: var(--accent);
}
/* Button styles */
.btn {
transition: all 0.15s ease;
}
.btn:hover:not(:disabled) {
transform: translateY(-1px);
}
.btn:active:not(:disabled) {
transform: translateY(0);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Tab styles */
.tab {
position: relative;
transition: color 0.2s ease;
}
.tab::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
width: 100%;
height: 2px;
background: var(--accent);
transform: scaleX(0);
transition: transform 0.2s ease;
}
.tab.active::after {
transform: scaleX(1);
}
.tab.active {
color: var(--accent);
}
/* Progress bar */
.progress-bar {
background: var(--border);
border-radius: 4px;
overflow: hidden;
}
.progress-fill {
height: 100%;
transition: width 0.5s ease;
}
/* Tooltip */
.tooltip {
position: absolute;
background: var(--bg-card);
border: 1px solid var(--border);
padding: 8px 12px;
border-radius: 6px;
font-size: 12px;
pointer-events: none;
opacity: 0;
transform: translateY(5px);
transition: all 0.2s ease;
z-index: 100;
white-space: nowrap;
}
.tooltip.visible {
opacity: 1;
transform: translateY(0);
}
/* Focus states */
*:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Status badge */
.badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Card hover */
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
transition: all 0.2s ease;
}
.card:hover {
border-color: rgba(0, 217, 165, 0.3);
}
</style>
</head>
<body class="bg-pattern">
<!-- Header -->
<header class="sticky top-0 z-50 backdrop-blur-md bg-[var(--bg)]/80 border-b border-[var(--border)]">
<div class="max-w-[1600px] mx-auto px-6 py-4 flex items-center justify-between">
<div class="flex items-center gap-4">
<div class="flex items-center gap-2">
<svg class="w-8 h-8 text-[var(--accent)]" viewBox="0 0 32 32" fill="none">
<rect x="2" y="2" width="28" height="28" rx="6" stroke="currentColor" stroke-width="2"/>
<path d="M10 16h12M16 10v12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
<circle cx="16" cy="16" r="4" fill="currentColor" fill-opacity="0.3"/>
</svg>
<span class="font-semibold text-lg">LabelQ</span>
</div>
<nav class="hidden md:flex items-center gap-1 ml-8">
<button class="tab active px-4 py-2 text-sm font-medium">Dashboard</button>
<button class="tab px-4 py-2 text-sm font-medium text-[var(--fg-muted)] hover:text-[var(--fg)]">Datasets</button>
<button class="tab px-4 py-2 text-sm font-medium text-[var(--fg-muted)] hover:text-[var(--fg)]">Annotators</button>
<button class="tab px-4 py-2 text-sm font-medium text-[var(--fg-muted)] hover:text-[var(--fg)]">Settings</button>
</nav>
</div>
<div class="flex items-center gap-4">
<button class="p-2 rounded-lg hover:bg-[var(--bg-elevated)] text-[var(--fg-muted)] hover:text-[var(--fg)]" aria-label="Notifications">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
</svg>
</button>
<div class="flex items-center gap-3 pl-4 border-l border-[var(--border)]">
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-[var(--accent)] to-[var(--info)] flex items-center justify-center text-sm font-semibold text-[var(--bg)]">A</div>
<span class="text-sm font-medium hidden sm:block">Admin</span>
</div>
</div>
</div>
</header>
<main class="max-w-[1600px] mx-auto px-6 py-8">
<!-- Stats Row -->
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8">
<div class="card p-5 animate-fade-up stagger-1">
<div class="flex items-center justify-between mb-3">
<span class="text-[var(--fg-muted)] text-sm">Queue Size</span>
<svg class="w-5 h-5 text-[var(--high)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
</svg>
</div>
<div class="font-mono text-3xl font-semibold" id="stat-queue">2,847</div>
<div class="text-[var(--high)] text-xs mt-2 flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"/>
</svg>
+12% from yesterday
</div>
</div>
<div class="card p-5 animate-fade-up stagger-2">
<div class="flex items-center justify-between mb-3">
<span class="text-[var(--fg-muted)] text-sm">Agreement Rate</span>
<svg class="w-5 h-5 text-[var(--accent)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<div class="font-mono text-3xl font-semibold" id="stat-agreement">87.3%</div>
<div class="text-[var(--accent)] text-xs mt-2 flex items-center gap-1">
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"/>
</svg>
+2.1% this week
</div>
</div>
<div class="card p-5 animate-fade-up stagger-3">
<div class="flex items-center justify-between mb-3">
<span class="text-[var(--fg-muted)] text-sm">Active Reviewers</span>
<svg class="w-5 h-5 text-[var(--info)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
</svg>
</div>
<div class="font-mono text-3xl font-semibold" id="stat-reviewers">24</div>
<div class="text-[var(--fg-muted)] text-xs mt-2">8 online now</div>
</div>
<div class="card p-5 animate-fade-up stagger-4">
<div class="flex items-center justify-between mb-3">
<span class="text-[var(--fg-muted)] text-sm">Labels Today</span>
<svg class="w-5 h-5 text-[var(--medium)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
</svg>
</div>
<div class="font-mono text-3xl font-semibold" id="stat-labels">14,529</div>
<div class="progress-bar h-1.5 mt-3">
<div class="progress-fill bg-[var(--medium)]" style="width: 72%"></div>
</div>
<div class="text-[var(--fg-muted)] text-xs mt-2">72% of daily target</div>
</div>
</div>
<!-- Main Content Grid -->
<div class="grid lg:grid-cols-3 gap-6">
<!-- Triage Queue -->
<div class="lg:col-span-1 card animate-fade-up stagger-3">
<div class="p-5 border-b border-[var(--border)]">
<div class="flex items-center justify-between mb-4">
<h2 class="font-semibold text-lg">Triage Queue</h2>
<span class="badge bg-[var(--high)]/20 text-[var(--high)]">
<span class="w-1.5 h-1.5 rounded-full bg-[var(--high)] animate-pulse-slow"></span>
Live
</span>
</div>
<!-- Queue Filters -->
<div class="flex gap-2 mb-4">
<button class="queue-filter btn px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--accent)] text-[var(--bg)]" data-filter="all">All</button>
<button class="queue-filter btn px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--bg-elevated)] text-[var(--fg-muted)] hover:text-[var(--fg)]" data-filter="high">High</button>
<button class="queue-filter btn px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--bg-elevated)] text-[var(--fg-muted)] hover:text-[var(--fg)]" data-filter="medium">Medium</button>
<button class="queue-filter btn px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--bg-elevated)] text-[var(--fg-muted)] hover:text-[var(--fg)]" data-filter="low">Low</button>
</div>
<!-- Search -->
<div class="relative">
<svg class="w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-[var(--fg-muted)]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
<input type="text" id="queue-search" placeholder="Search items..." class="w-full bg-[var(--bg-elevated)] border border-[var(--border)] rounded-md pl-10 pr-4 py-2 text-sm focus:border-[var(--accent)] focus:outline-none" aria-label="Search queue items">
</div>
</div>
<!-- Queue List -->
<div class="max-h-[400px] overflow-y-auto" id="queue-list" role="list" aria-label="Queue items">
<!-- Items populated by JS -->
</div>
<!-- Queue Actions -->
<div class="p-4 border-t border-[var(--border)] flex gap-2">
<button id="btn-approve" class="btn flex-1 px-4 py-2 bg-[var(--accent)] text-[var(--bg)] rounded-md font-medium text-sm hover:bg-[var(--accent)]/90" disabled>
Approve Selected
</button>
<button id="btn-reject" class="btn flex-1 px-4 py-2 bg-[var(--high)] text-white rounded-md font-medium text-sm hover:bg-[var(--high)]/90" disabled>
Reject Selected
</button>
</div>
</div>
<!-- Disagreement Heatmap -->
<div class="lg:col-span-2 card animate-fade-up stagger-4">
<div class="p-5 border-b border-[var(--border)]">
<div class="flex items-center justify-between mb-2">
<h2 class="font-semibold text-lg">Disagreement Heatmap</h2>
<div class="flex items-center gap-4 text-xs">
<span class="flex items-center gap-2"><span class="w-3 h-3 rounded bg-[var(--accent)]"></span> Low</span>
<span class="flex items-center gap-2"><span class="w-3 h-3 rounded bg-[var(--medium)]"></span> Medium</span>
<span class="flex items-center gap-2"><span class="w-3 h-3 rounded bg-[var(--high)]"></span> High</span>
</div>
</div>
<p class="text-[var(--fg-muted)] text-sm">Annotator disagreement intensity by label category</p>
</div>
<div class="p-5">
<!-- Heatmap -->
<div class="overflow-x-auto">
<div class="min-w-[500px]">
<!-- Y-axis labels (Annotators) -->
<div class="flex">
<div class="w-20"></div>
<div class="flex-1 grid grid-cols-8 gap-1 text-center text-xs text-[var(--fg-muted)] mb-2" id="heatmap-x-labels">
<!-- Populated by JS -->
</div>
</div>
<div id="heatmap-grid" class="space-y-1">
<!-- Populated by JS -->
</div>
</div>
</div>
<!-- Selected Cell Info -->
<div id="heatmap-detail" class="mt-6 p-4 bg-[var(--bg-elevated)] rounded-lg hidden">
<div class="flex items-center justify-between mb-3">
<span class="font-medium" id="detail-title">-</span>
<span class="badge" id="detail-badge">-</span>
</div>
<div class="grid grid-cols-3 gap-4 text-sm">
<div>
<div class="text-[var(--fg-muted)] mb-1">Disagreement</div>
<div class="font-mono font-semibold" id="detail-disagreement">-</div>
</div>
<div>
<div class="text-[var(--fg-muted)] mb-1">Samples</div>
<div class="font-mono font-semibold" id="detail-samples">-</div>
</div>
<div>
<div class="text-[var(--fg-muted)] mb-1">Trend</div>
<div class="font-mono font-semibold" id="detail-trend">-</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Reviewer Analytics -->
<div class="mt-6 card animate-fade-up stagger-5">
<div class="p-5 border-b border-[var(--border)]">
<div class="flex items-center justify-between">
<div>
<h2 class="font-semibold text-lg">Reviewer Analytics</h2>
<p class="text-[var(--fg-muted)] text-sm mt-1">Performance metrics and agreement statistics</p>
</div>
<select id="analytics-period" class="bg-[var(--bg-elevated)] border border-[var(--border)] rounded-md px-3 py-2 text-sm focus:border-[var(--accent)] focus:outline-none" aria-label="Select time period">
<option value="7d">Last 7 days</option>
<option value="30d" selected>Last 30 days</option>
<option value="90d">Last 90 days</option>
</select>
</div>
</div>
<div class="p-5">
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Top Reviewers -->
<div class="md:col-span-2 lg:col-span-2">
<h3 class="text-sm font-medium text-[var(--fg-muted)] mb-4">Top Reviewers by Throughput</h3>
<div class="space-y-3" id="reviewer-list">
<!-- Populated by JS -->
</div>
</div>
<!-- Activity Chart -->
<div>
<h3 class="text-sm font-medium text-[var(--fg-muted)] mb-4">Daily Activity</h3>
<div class="h-[200px] flex items-end gap-1" id="activity-chart">
<!-- Populated by JS -->
</div>
<div class="flex justify-between text-xs text-[var(--fg-muted)] mt-2">
<span>Mon</span>
<span>Tue</span>
<span>Wed</span>
<span>Thu</span>
<span>Fri</span>
<span>Sat</span>
<span>Sun</span>
</div>
</div>
</div>
<!-- Agreement Matrix Summary -->
<div class="mt-8 pt-6 border-t border-[var(--border)]">
<h3 class="text-sm font-medium text-[var(--fg-muted)] mb-4">Inter-Annotator Agreement (Cohen's Kappa)</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4" id="kappa-metrics">
<!-- Populated by JS -->
</div>
</div>
</div>
</div>
</main>
<!-- Tooltip container -->
<div id="tooltip" class="tooltip"></div>
<script>
// === DATA ===
const queueItems = [
{ id: 1, prompt: "Explain quantum entanglement", label: "helpful", priority: "high", disagreement: 0.72, annotators: ["A1", "A2", "A3"] },
{ id: 2, prompt: "Write a Python function to sort a list", label: "code", priority: "medium", disagreement: 0.45, annotators: ["A2", "A4"] },
{ id: 3, prompt: "What is the capital of France?", label: "factual", priority: "low", disagreement: 0.12, annotators: ["A1", "A3", "A5"] },
{ id: 4, prompt: "Generate a creative story about space", label: "creative", priority: "high", disagreement: 0.81, annotators: ["A1", "A2"] },
{ id: 5, prompt: "How do I bake a chocolate cake?", label: "instruction", priority: "medium", disagreement: 0.38, annotators: ["A3", "A4", "A5"] },
{ id: 6, prompt: "Translate 'hello' to Japanese", label: "translation", priority: "low", disagreement: 0.08, annotators: ["A2", "A3"] },
{ id: 7, prompt: "Solve this math problem: 2x + 5 = 15", label: "math", priority: "high", disagreement: 0.65, annotators: ["A1", "A4", "A5"] },
{ id: 8, prompt: "Summarize the French Revolution", label: "summary", priority: "medium", disagreement: 0.52, annotators: ["A2", "A4"] },
{ id: 9, prompt: "Debug this code snippet", label: "code", priority: "high", disagreement: 0.73, annotators: ["A1", "A2", "A3"] },
{ id: 10, prompt: "Write a haiku about nature", label: "creative", priority: "low", disagreement: 0.22, annotators: ["A4", "A5"] },
{ id: 11, prompt: "Compare REST vs GraphQL", label: "technical", priority: "medium", disagreement: 0.41, annotators: ["A1", "A3"] },
{ id: 12, prompt: "Recommend a good sci-fi book", label: "recommendation", priority: "low", disagreement: 0.55, annotators: ["A2", "A3", "A4"] },
];
const labelCategories = ["Helpful", "Code", "Factual", "Creative", "Math", "Summary", "Safety", "Instruction"];
const annotators = ["Alice", "Bob", "Carol", "David", "Eve", "Frank"];
const heatmapData = annotators.map(annotator => ({
name: annotator,
values: labelCategories.map(() => Math.random())
}));
const reviewers = [
{ name: "Alice Chen", throughput: 2847, accuracy: 94.2, agreement: 89.1, avatar: "A" },
{ name: "Bob Martinez", throughput: 2634, accuracy: 92.8, agreement: 87.5, avatar: "B" },
{ name: "Carol Wang", throughput: 2456, accuracy: 96.1, agreement: 91.3, avatar: "C" },
{ name: "David Kim", throughput: 2298, accuracy: 91.4, agreement: 85.7, avatar: "D" },
{ name: "Eve Johnson", throughput: 2156, accuracy: 93.7, agreement: 88.9, avatar: "E" },
];
const activityData = [65, 82, 78, 91, 88, 42, 38];
const kappaMetrics = [
{ label: "Overall Kappa", value: 0.847, trend: "+0.023" },
{ label: "Helpful Labels", value: 0.912, trend: "+0.015" },
{ label: "Safety Labels", value: 0.876, trend: "-0.008" },
{ label: "Code Labels", value: 0.823, trend: "+0.041" },
];
// === STATE ===
let selectedQueueItems = new Set();
let currentFilter = "all";
let searchQuery = "";
// === UTILITY FUNCTIONS ===
function getPriorityColor(priority) {
const colors = {
high: "var(--high)",
medium: "var(--medium)",
low: "var(--low)"
};
return colors[priority] || "var(--fg-muted)";
}
function getHeatmapColor(value) {
const clampedValue = Math.max(0, Math.min(1, value));
if (clampedValue < 0.33) {
return `rgba(0, 217, 165, ${0.3 + clampedValue * 0.7})`;
} else if (clampedValue < 0.66) {
return `rgba(255, 176, 32, ${0.3 + clampedValue * 0.7})`;
} else {
return `rgba(255, 77, 106, ${0.3 + clampedValue * 0.7})`;
}
}
function getDisagreementLevel(value) {
if (value < 0.33) return { text: "Low", class: "bg-[var(--low)]/20 text-[var(--low)]" };
if (value < 0.66) return { text: "Medium", class: "bg-[var(--medium)]/20 text-[var(--medium)]" };
return { text: "High", class: "bg-[var(--high)]/20 text-[var(--high)]" };
}
// === RENDER FUNCTIONS ===
function renderQueueList() {
const container = document.getElementById("queue-list");
const filteredItems = queueItems.filter(item => {
const matchesFilter = currentFilter === "all" || item.priority === currentFilter;
const matchesSearch = item.prompt.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.label.toLowerCase().includes(searchQuery.toLowerCase());
return matchesFilter && matchesSearch;
});
container.innerHTML = filteredItems.map(item => `
<div class="queue-item p-4 cursor-pointer ${selectedQueueItems.has(item.id) ? 'selected' : ''}"
data-id="${item.id}" role="listitem" tabindex="0" aria-selected="${selectedQueueItems.has(item.id)}">
<div class="flex items-start justify-between mb-2">
<span class="text-sm font-medium line-clamp-1">${item.prompt}</span>
<span class="badge ${getDisagreementLevel(item.disagreement).class} ml-2 shrink-0">
${getDisagreementLevel(item.disagreement).text}
</span>
</div>
<div class="flex items-center gap-3 text-xs text-[var(--fg-muted)]">
<span class="px-2 py-0.5 bg-[var(--bg-elevated)] rounded">${item.label}</span>
<span>${item.annotators.length} annotators</span>
<span class="ml-auto font-mono">${(item.disagreement * 100).toFixed(0)}% conflict</span>
</div>
</div>
`).join("");
// Add click handlers
container.querySelectorAll(".queue-item").forEach(el => {
el.addEventListener("click", () => toggleQueueItem(parseInt(el.dataset.id)));
el.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
toggleQueueItem(parseInt(el.dataset.id));
}
});
});
updateActionButtons();
}
function toggleQueueItem(id) {
if (selectedQueueItems.has(id)) {
selectedQueueItems.delete(id);
} else {
selectedQueueItems.add(id);
}
renderQueueList();
}
function updateActionButtons() {
const approveBtn = document.getElementById("btn-approve");
const rejectBtn = document.getElementById("btn-reject");
const hasSelection = selectedQueueItems.size > 0;
approveBtn.disabled = !hasSelection;
rejectBtn.disabled = !hasSelection;
if (hasSelection) {
approveBtn.textContent = `Approve (${selectedQueueItems.size})`;
rejectBtn.textContent = `Reject (${selectedQueueItems.size})`;
} else {
approveBtn.textContent = "Approve Selected";
rejectBtn.textContent = "Reject Selected";
}
}
function renderHeatmap() {
const xLabelsContainer = document.getElementById("heatmap-x-labels");
const gridContainer = document.getElementById("heatmap-grid");
// X-axis labels
xLabelsContainer.innerHTML = labelCategories.map(cat =>
`<div class="truncate text-[10px]" title="${cat}">${cat.slice(0, 3)}</div>`
).join("");
// Grid rows
gridContainer.innerHTML = heatmapData.map((row, rowIndex) => `
<div class="flex items-center">
<div class="w-20 text-xs text-[var(--fg-muted)] pr-2 truncate">${row.name}</div>
<div class="flex-1 grid grid-cols-8 gap-1">
${row.values.map((value, colIndex) => `
<div class="heatmap-cell aspect-square rounded"
style="background: ${getHeatmapColor(value)}"
data-row="${rowIndex}"
data-col="${colIndex}"
data-value="${value}"
data-annotator="${row.name}"
data-category="${labelCategories[colIndex]}"
tabindex="0"
role="gridcell"
aria-label="${row.name}, ${labelCategories[colIndex]}: ${(value * 100).toFixed(0)}% disagreement">
</div>
`).join("")}
</div>
</div>
`).join("");
// Add hover handlers
const tooltip = document.getElementById("tooltip");
gridContainer.querySelectorAll(".heatmap-cell").forEach(cell => {
cell.addEventListener("mouseenter", (e) => {
const rect = e.target.getBoundingClientRect();
tooltip.innerHTML = `
<div class="font-medium">${e.target.dataset.annotator}</div>
<div class="text-[var(--fg-muted)]">${e.target.dataset.category}</div>
<div class="mt-1 font-mono">${(parseFloat(e.target.dataset.value) * 100).toFixed(1)}% disagreement</div>
`;
tooltip.style.left = `${rect.left + window.scrollX}px`;
tooltip.style.top = `${rect.bottom + window.scrollY + 8}px`;
tooltip.classList.add("visible");
});
cell.addEventListener("mouseleave", () => {
tooltip.classList.remove("visible");
});
cell.addEventListener("click", (e) => {
showHeatmapDetail(e.target);
});
cell.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
showHeatmapDetail(e.target);
}
});
});
}
function showHeatmapDetail(cell) {
const detail = document.getElementById("heatmap-detail");
const title = document.getElementById("detail-title");
const badge = document.getElementById("badge");
const disagreement = document.getElementById("detail-disagreement");
const samples = document.getElementById("detail-samples");
const trend = document.getElementById("detail-trend");
const value = parseFloat(cell.dataset.value);
const level = getDisagreementLevel(value);
title.textContent = `${cell.dataset.annotator} - ${cell.dataset.category}`;
badge.className = `badge ${level.class}`;
badge.textContent = `${level.text} Disagreement`;
disagreement.textContent = `${(value * 100).toFixed(1)}%`;
samples.textContent = Math.floor(Math.random() * 500 + 100).toLocaleString();
const isPositive = Math.random() > 0.5;
trend.innerHTML = `<span class="${isPositive ? 'text-[var(--high)]' : 'text-[var(--accent)]'}">${isPositive ? '+' : ''}${(Math.random() * 10 - 5).toFixed(1)}%</span>`;
detail.classList.remove("hidden");
detail.scrollIntoView({ behavior: "smooth", block: "nearest" });
}
function renderReviewers() {
const container = document.getElementById("reviewer-list");
const maxThroughput = Math.max(...reviewers.map(r => r.throughput));
container.innerHTML = reviewers.map((reviewer, index) => `
<div class="flex items-center gap-4 p-3 rounded-lg hover:bg-[var(--bg-elevated)] transition-colors">
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-[var(--accent)] to-[var(--info)] flex items-center justify-center text-sm font-semibold text-[var(--bg)]">
${reviewer.avatar}
</div>
<div class="flex-1 min-w-0">
<div class="flex items-center justify-between mb-1">
<span class="font-medium text-sm">${reviewer.name}</span>
<span class="font-mono text-sm">${reviewer.throughput.toLocaleString()}</span>
</div>
<div class="progress-bar h-1.5">
<div class="progress-fill bg-[var(--accent)]" style="width: ${(reviewer.throughput / maxThroughput * 100)}%"></div>
</div>
</div>
<div class="text-right hidden sm:block">
<div class="text-xs text-[var(--fg-muted)]">Accuracy</div>
<div class="font-mono text-sm font-semibold text-[var(--accent)]">${reviewer.accuracy}%</div>
</div>
<div class="text-right hidden md:block">
<div class="text-xs text-[var(--fg-muted)]">Agreement</div>
<div class="font-mono text-sm font-semibold">${reviewer.agreement}%</div>
</div>
</div>
`).join("");
}
function renderActivityChart() {
const container = document.getElementById("activity-chart");
const maxValue = Math.max(...activityData);
container.innerHTML = activityData.map((value, index) => {
const height = (value / maxValue * 100);
return `
<div class="flex-1 flex flex-col items-center justify-end h-full group">
<div class="w-full bg-[var(--accent)]/20 rounded-t relative overflow-hidden transition-all group-hover:bg-[var(--accent)]/30"
style="height: ${height}%"
tabindex="0"
role="img"
aria-label="Day ${index + 1}: ${value} labels">
<div class="absolute inset-0 bg-[var(--accent)] opacity-0 group-hover:opacity-30 transition-opacity"></div>
</div>
</div>
`;
}).join("");
}
function renderKappaMetrics() {
const container = document.getElementById("kappa-metrics");
container.innerHTML = kappaMetrics.map(metric => {
const isPositive = metric.trend.startsWith("+");
return `
<div class="p-4 bg-[var(--bg-elevated)] rounded-lg">
<div class="text-xs text-[var(--fg-muted)] mb-1">${metric.label}</div>
<div class="font-mono text-2xl font-semibold">${metric.value.toFixed(3)}</div>
<div class="text-xs mt-1 ${isPositive ? 'text-[var(--accent)]' : 'text-[var(--high)]'}">${metric.trend}</div>
</div>
`;
}).join("");
}
// === EVENT HANDLERS ===
function initEventHandlers() {
// Queue filters
document.querySelectorAll(".queue-filter").forEach(btn => {
btn.addEventListener("click", () => {
document.querySelectorAll(".queue-filter").forEach(b => {
b.classList.remove("bg-[var(--accent)]", "text-[var(--bg)]");
b.classList.add("bg-[var(--bg-elevated)]", "text-[var(--fg-muted)]");
});
btn.classList.remove("bg-[var(--bg-elevated)]", "text-[var(--fg-muted)]");
btn.classList.add("bg-[var(--accent)]", "text-[var(--bg)]");
currentFilter = btn.dataset.filter;
selectedQueueItems.clear();
renderQueueList();
});
});
// Search
document.getElementById("queue-search").addEventListener("input", (e) => {
searchQuery = e.target.value;
renderQueueList();
});
// Action buttons
document.getElementById("btn-approve").addEventListener("click", () => {
if (selectedQueueItems.size > 0) {
alert(`Approved ${selectedQueueItems.size} items`);
selectedQueueItems.clear();
renderQueueList();
}
});
document.getElementById("btn-reject").addEventListener("click", () => {
if (selectedQueueItems.size > 0) {
alert(`Rejected ${selectedQueueItems.size} items`);
selectedQueueItems.clear();
renderQueueList();
}
});
// Tabs
document.querySelectorAll(".tab").forEach(tab => {
tab.addEventListener("click", () => {
document.querySelectorAll(".tab").forEach(t => t.classList.remove("active"));
tab.classList.add("active");
});
});
// Analytics period
document.getElementById("analytics-period").addEventListener("change", () => {
// In a real app, this would fetch new data
renderReviewers();
renderActivityChart();
});
}
// === ANIMATIONS ===
function animateStats() {
const stats = [
{ id: "stat-queue", target: 2847, prefix: "", suffix: "" },
{ id: "stat-agreement", target: 87.3, prefix: "", suffix: "%" },
{ id: "stat-reviewers", target: 24, prefix: "", suffix: "" },
{ id: "stat-labels", target: 14529, prefix: "", suffix: "" }
];
stats.forEach(stat => {
const el = document.getElementById(stat.id);
const duration = 1500;
const startTime = performance.now();
function update(currentTime) {
const elapsed = currentTime - startTime;
const progress = Math.min(elapsed / duration, 1);
const easeOut = 1 - Math.pow(1 - progress, 3);
const current = stat.target * easeOut;
if (stat.target % 1 !== 0) {
el.textContent = stat.prefix + current.toFixed(1) + stat.suffix;
} else {
el.textContent = stat.prefix + Math.floor(current).toLocaleString() + stat.suffix;
}
if (progress < 1) {
requestAnimationFrame(update);
}
}
requestAnimationFrame(update);
});
}
// === INTERSECTION OBSERVER ===
function initScrollAnimations() {
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = "1";
entry.target.style.transform = "translateY(0)";
}
});
}, { threshold: 0.1 });
document.querySelectorAll(".animate-fade-up").forEach(el => {
observer.observe(el);
});
}
// === INIT ===
function init() {
renderQueueList();
renderHeatmap();
renderReviewers();
renderActivityChart();
renderKappaMetrics();
initEventHandlers();
initScrollAnimations();
// Delay stat animation for effect
setTimeout(animateStats, 300);
}
// Run on DOM ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
</script>
</body>
</html>
Key Features
Triage Queue
- Priority filtering (High/Medium/Low) with visual indicators
- Search functionality for finding specific items
- Multi-select with batch approve/reject actions
- Real-time status badge with pulse animation
- Keyboard accessible (Tab, Enter, Space)
Disagreement Heatmap
- Interactive matrix showing annotator vs label category disagreements
- Color intensity mapped to disagreement levels (green→yellow→red)
- Hover tooltips with detailed metrics
- Click to expand detailed view with samples and trends
Reviewer Analytics
- Performance rankings with throughput bars
- Accuracy and agreement metrics per reviewer
- Activity chart showing daily throughput patterns
- Cohen's Kappa scores for inter-annotator agreement
Design Choices
- Dark theme optimized for long data-review sessions
- JetBrains Mono for numeric data (legible monospace)
- Space Grotesk for UI text (modern, technical feel)
- Teal accent (#00d9a5) with semantic colors for priorities
- Reduced motion respected via media query