evijit HF Staff Claude Opus 4.7 (1M context) commited on
Commit
1303965
·
1 Parent(s): 4ac3a9b

Render score-distribution metric picker as chips, not a dropdown

Browse files

The 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>

Files changed (1) hide show
  1. components/score-distribution.tsx +24 -13
components/score-distribution.tsx CHANGED
@@ -208,19 +208,30 @@ export function ScoreDistribution({
208
  Score distribution
209
  </div>
210
  {showPicker ? (
211
- <select
212
- className="ec-select"
213
- value={active.key}
214
- onChange={(event) => setActiveKey(event.target.value)}
215
- style={{ minWidth: 200, maxWidth: "100%" }}
216
- >
217
- {seriesList.map((s) => (
218
- <option key={s.key} value={s.key}>
219
- {s.label}
220
- {s.caption ? ` · ${s.caption}` : ""}
221
- </option>
222
- ))}
223
- </select>
 
 
 
 
 
 
 
 
 
 
 
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"