From d0e7bfd60ae5efd7ac06bda5b0ab0a7a85dc6846 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 27 Apr 2026 13:54:13 +0200 Subject: [PATCH] feat: show active ranking score on each list row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each ranking row now displays a small chip with the score that's currently driving the rank — the juror-balanced average when the round's useBalancedRanking toggle is on, the raw juror average when it's off. The chip is labeled 'Bal' or 'Raw' so the source is unambiguous. Per-juror score pills stay alongside; full Raw + Balanced detail still lives in the side panel. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../admin/round/ranking-dashboard.tsx | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/admin/round/ranking-dashboard.tsx b/src/components/admin/round/ranking-dashboard.tsx index a462fd5..fb9ec2b 100644 --- a/src/components/admin/round/ranking-dashboard.tsx +++ b/src/components/admin/round/ranking-dashboard.tsx @@ -84,6 +84,9 @@ type SortableProjectRowProps = { entry: (RankedProjectEntry & { originalIndex?: number }) | undefined projectInfo: ProjectInfo | undefined jurorScores: JurorScore[] | undefined + rawAverage: number | null + balancedAverage: number | null + useBalanced: boolean onSelect: () => void isSelected: boolean originalRank: number | undefined // from snapshotOrder — always in sync with localOrder @@ -97,6 +100,9 @@ function SortableProjectRow({ entry, projectInfo, jurorScores, + rawAverage, + balancedAverage, + useBalanced, onSelect, isSelected, originalRank, @@ -195,12 +201,24 @@ function SortableProjectRow({ ))} - ) : entry?.avgGlobalScore !== null && entry?.avgGlobalScore !== undefined ? ( - - Avg {entry.avgGlobalScore.toFixed(2)} - ) : null} + {/* Active score chip (balanced if toggle on, otherwise raw) */} + {(() => { + const active = useBalanced && balancedAverage != null ? balancedAverage : rawAverage + if (active == null) return null + const label = useBalanced && balancedAverage != null ? 'Bal' : 'Raw' + return ( + + {label} + {active.toFixed(2)} + + ) + })()} + {/* Advance decision indicator */}
setSelectedProjectId(projectId)} isSelected={selectedProjectId === projectId} originalRank={hasReorders ? snapshotOrder[projectId] : undefined}