Spaces:
Running
Running
Render score-distribution metric picker as chips, not a dropdown
Browse filesThe slice picker is already a dropdown ('Slice: Overall / Arabic /
...'), so making the score-distribution metric picker also a dropdown
makes the two controls easy to confuse — especially on a benchmark
like Fibble where the metrics ('Score', 'Win Rate', 'Mean Response
Time') *and* the splits both deserve a top-level switch. Render the
metric picker as ec-pill chips so the visual contract is: chips for
'pick which metric you're looking at', dropdown for 'pick which
slice/split you're filtering to'.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
components/score-distribution.tsx
CHANGED
|
@@ -208,19 +208,30 @@ export function ScoreDistribution({
|
|
| 208 |
Score distribution
|
| 209 |
</div>
|
| 210 |
{showPicker ? (
|
| 211 |
-
<
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
) : (
|
| 225 |
<span
|
| 226 |
className="font-mono uppercase truncate"
|
|
|
|
| 208 |
Score distribution
|
| 209 |
</div>
|
| 210 |
{showPicker ? (
|
| 211 |
+
<div className="flex flex-wrap items-center gap-1.5">
|
| 212 |
+
{seriesList.map((s) => {
|
| 213 |
+
const on = s.key === active.key
|
| 214 |
+
return (
|
| 215 |
+
<button
|
| 216 |
+
key={s.key}
|
| 217 |
+
type="button"
|
| 218 |
+
className={`ec-pill${on ? " on" : ""}`}
|
| 219 |
+
onClick={() => setActiveKey(s.key)}
|
| 220 |
+
title={s.caption ? `${s.label} · ${s.caption}` : s.label}
|
| 221 |
+
>
|
| 222 |
+
{s.label}
|
| 223 |
+
{s.caption ? (
|
| 224 |
+
<span
|
| 225 |
+
className="ml-1.5"
|
| 226 |
+
style={{ color: on ? undefined : "var(--fg-subtle)" }}
|
| 227 |
+
>
|
| 228 |
+
· {s.caption}
|
| 229 |
+
</span>
|
| 230 |
+
) : null}
|
| 231 |
+
</button>
|
| 232 |
+
)
|
| 233 |
+
})}
|
| 234 |
+
</div>
|
| 235 |
) : (
|
| 236 |
<span
|
| 237 |
className="font-mono uppercase truncate"
|