feat: mount score explainer dialog in admin and observer surfaces
Adds the 'How scores are calculated' affordance to: - the admin ranking dashboard side panel (next to the Avg Score card) - the observer full project detail page (in the score card) - the observer reports preview dialog (next to Evaluation Summary) so all three audiences can open the same explainer dialog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import { Label } from '@/components/ui/label'
|
|||||||
import { Textarea } from '@/components/ui/textarea'
|
import { Textarea } from '@/components/ui/textarea'
|
||||||
import { Slider } from '@/components/ui/slider'
|
import { Slider } from '@/components/ui/slider'
|
||||||
import { Switch } from '@/components/ui/switch'
|
import { Switch } from '@/components/ui/switch'
|
||||||
|
import { ScoreExplainerDialog } from '@/components/shared/score-explainer-dialog'
|
||||||
import {
|
import {
|
||||||
Collapsible,
|
Collapsible,
|
||||||
CollapsibleContent,
|
CollapsibleContent,
|
||||||
@@ -1075,6 +1076,9 @@ export function RankingDashboard({ competitionId: _competitionId, roundId }: Ran
|
|||||||
{useBalanced && <span className="ml-1 text-[10px] text-muted-foreground">← used for ranking</span>}
|
{useBalanced && <span className="ml-1 text-[10px] text-muted-foreground">← used for ranking</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="mt-2 flex justify-end">
|
||||||
|
<ScoreExplainerDialog />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
<div className="rounded-lg border p-3 text-center">
|
<div className="rounded-lg border p-3 text-center">
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import {
|
|||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { cn, formatDate, formatDateOnly } from '@/lib/utils'
|
import { cn, formatDate, formatDateOnly } from '@/lib/utils'
|
||||||
|
import { ScoreExplainerDialog } from '@/components/shared/score-explainer-dialog'
|
||||||
|
|
||||||
export function ObserverProjectDetail({
|
export function ObserverProjectDetail({
|
||||||
projectId,
|
projectId,
|
||||||
@@ -263,6 +264,9 @@ export function ObserverProjectDetail({
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<div className="mt-2 w-full">
|
||||||
|
<ScoreExplainerDialog />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { ExternalLink, MapPin, Waves, Users } from 'lucide-react'
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import type { Route } from 'next'
|
import type { Route } from 'next'
|
||||||
import { scoreGradient } from '@/components/charts/chart-theme'
|
import { scoreGradient } from '@/components/charts/chart-theme'
|
||||||
|
import { ScoreExplainerDialog } from '@/components/shared/score-explainer-dialog'
|
||||||
|
|
||||||
interface ProjectPreviewDialogProps {
|
interface ProjectPreviewDialogProps {
|
||||||
projectId: string | null
|
projectId: string | null
|
||||||
@@ -108,7 +109,10 @@ export function ProjectPreviewDialog({ projectId, roundId, open, onOpenChange }:
|
|||||||
{/* Evaluation summary */}
|
{/* Evaluation summary */}
|
||||||
{data.stats && (
|
{data.stats && (
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-sm font-semibold mb-2">Evaluation Summary</h3>
|
<div className="mb-2 flex items-center justify-between">
|
||||||
|
<h3 className="text-sm font-semibold">Evaluation Summary</h3>
|
||||||
|
<ScoreExplainerDialog />
|
||||||
|
</div>
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
||||||
<div className="rounded-md border p-3 text-center">
|
<div className="rounded-md border p-3 text-center">
|
||||||
<p className="text-lg font-bold tabular-nums">
|
<p className="text-lg font-bold tabular-nums">
|
||||||
|
|||||||
Reference in New Issue
Block a user