Linker1907 commited on
Commit
99cd5bf
Β·
1 Parent(s): 9a5ca50

Replace dropdown with category-based benchmark filter UI

Browse files

- Replace dropdown menu with inline category pills (Option B layout)
- Benchmarks grouped by category: Math, Knowledge, Coding, Agent, Language, Vision, Embedding
- Click pills to toggle on/off with background color change
- Visual feedback: blue active state, gray inactive (60% opacity)
- Select All/Clear All action buttons on the right
- Mobile-friendly: categories wrap, pills flex within category
- Default: 10/12 benchmarks selected (Vision & Embedding hidden)
- Removed ~60 lines of dropdown code, added ~150 lines for new UI

Files changed (1) hide show
  1. index.html +127 -109
index.html CHANGED
@@ -77,18 +77,19 @@ h1{font-size:clamp(20px,3vw,36px);font-weight:800;line-height:1.1;letter-spacing
77
  .fb:hover{background:var(--ac-bg);border-color:rgba(99,102,241,.3);color:var(--ac);}
78
  .fb.on{background:linear-gradient(135deg,#6366f1,#4f46e5);border-color:transparent;color:#fff;box-shadow:0 3px 12px rgba(99,102,241,.25);}
79
 
80
- /* DROPDOWN */
81
- .dropdown-wrapper{position:relative;}
82
- .dropdown-btn{min-width:140px;display:flex;align-items:center;justify-content:space-between;}
83
- .dropdown-menu{position:absolute;top:calc(100% + 4px);left:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);z-index:1000;min-width:220px;max-height:400px;overflow-y:auto;}
84
- .dropdown-header{display:flex;gap:8px;padding:8px 12px;background:var(--surface-alt);}
85
- .dropdown-action{background:transparent;border:1px solid var(--border);color:var(--text-sec);padding:4px 10px;border-radius:6px;font-size:9px;font-weight:600;cursor:pointer;transition:var(--tr);font-family:var(--font);}
86
- .dropdown-action:hover{background:var(--ac-bg);border-color:var(--ac);color:var(--ac);}
87
- .dropdown-divider{height:1px;background:var(--border);margin:4px 0;}
88
- .dropdown-item{display:flex;align-items:center;gap:8px;padding:8px 12px;cursor:pointer;transition:var(--tr);font-size:11px;color:var(--text);}
89
- .dropdown-item:hover{background:var(--surface-alt);}
90
- .dropdown-item input[type="checkbox"]{cursor:pointer;width:14px;height:14px;}
91
- .dropdown-item span:first-of-type{font-size:14px;}
 
92
 
93
  /* TABLE */
94
  .tw{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow-x:auto;box-shadow:var(--shadow);margin-bottom:20px;}
@@ -179,6 +180,11 @@ body.dark tbody tr:hover td.c-model{background:var(--surface-alt)!important;}
179
  h1{font-size:20px!important;}
180
  .toolbar{flex-direction:column;gap:6px;}
181
  .search-wrap{max-width:100%;min-width:100%;}
 
 
 
 
 
182
  table{font-size:9px;}
183
  th,td{padding:6px 3px;}
184
  th.c-model,td.c-model{min-width:130px!important;}
@@ -221,65 +227,71 @@ body.dark tbody tr:hover td.c-model{background:var(--surface-alt)!important;}
221
  <input type="text" id="searchBox" placeholder="Search models..." oninput="filterModels()">
222
  </div>
223
  <span class="flbl">Show Benchmarks:</span>
224
- <div class="dropdown-wrapper">
225
- <button class="fb dropdown-btn" id="benchmarkDropdownBtn" onclick="toggleBenchmarkDropdown()">
226
- <span id="selectedBenchmarksText">10 selected</span>
227
- <span style="margin-left: 8px;">β–Ό</span>
228
- </button>
229
- <div class="dropdown-menu" id="benchmarkDropdown" style="display: none;">
230
- <div class="dropdown-header">
231
- <button class="dropdown-action" onclick="selectAllBenchmarks()">Select All</button>
232
- <button class="dropdown-action" onclick="deselectAllBenchmarks()">Deselect All</button>
233
  </div>
234
- <div class="dropdown-divider"></div>
235
- <label class="dropdown-item">
236
- <input type="checkbox" value="gsm8k" onchange="updateBenchmarkFilter()" checked>
237
- <span class="bm-math">πŸ“</span> GSM8K
238
- </label>
239
- <label class="dropdown-item">
240
- <input type="checkbox" value="mmluPro" onchange="updateBenchmarkFilter()" checked>
241
- <span class="bm-knowledge">🧠</span> MMLU-Pro
242
- </label>
243
- <label class="dropdown-item">
244
- <input type="checkbox" value="gpqa" onchange="updateBenchmarkFilter()" checked>
245
- <span class="bm-knowledge">🧠</span> GPQA Diamond
246
- </label>
247
- <label class="dropdown-item">
248
- <input type="checkbox" value="hle" onchange="updateBenchmarkFilter()" checked>
249
- <span class="bm-knowledge">🧠</span> HLE
250
- </label>
251
- <label class="dropdown-item">
252
- <input type="checkbox" value="olmOcr" onchange="updateBenchmarkFilter()">
253
- <span class="bm-vision">πŸ‘οΈ</span> olmOCR
254
- </label>
255
- <label class="dropdown-item">
256
- <input type="checkbox" value="sweVerified" onchange="updateBenchmarkFilter()" checked>
257
- <span class="bm-coding">πŸ’»</span> SWE-bench Verified
258
- </label>
259
- <label class="dropdown-item">
260
- <input type="checkbox" value="arguana" onchange="updateBenchmarkFilter()">
261
- <span class="bm-embedding">πŸ”</span> ArguAna
262
- </label>
263
- <label class="dropdown-item">
264
- <input type="checkbox" value="swePro" onchange="updateBenchmarkFilter()" checked>
265
- <span class="bm-coding">πŸ’»</span> SWE-bench Pro
266
- </label>
267
- <label class="dropdown-item">
268
- <input type="checkbox" value="aime2026" onchange="updateBenchmarkFilter()" checked>
269
- <span class="bm-math">πŸ“</span> AIME 2026
270
- </label>
271
- <label class="dropdown-item">
272
- <input type="checkbox" value="terminalBench" onchange="updateBenchmarkFilter()" checked>
273
- <span class="bm-agent">πŸ€–</span> Terminal-Bench 2.0
274
- </label>
275
- <label class="dropdown-item">
276
- <input type="checkbox" value="evasionBench" onchange="updateBenchmarkFilter()" checked>
277
- <span class="bm-language">πŸ’¬</span> EvasionBench
278
- </label>
279
- <label class="dropdown-item">
280
- <input type="checkbox" value="hmmt2026" onchange="updateBenchmarkFilter()" checked>
281
- <span class="bm-math">πŸ“</span> HMMT Feb 2026
282
- </label>
 
 
 
 
 
 
 
283
  </div>
284
  </div>
285
  <div style="flex: 1"></div>
@@ -2676,50 +2688,60 @@ const BENCHMARK_CATEGORIES = {
2676
  'evasionBench': 'language'
2677
  };
2678
 
2679
- // Dropdown functions
2680
- function toggleBenchmarkDropdown() {
2681
- const dropdown = document.getElementById('benchmarkDropdown');
2682
- dropdown.style.display = dropdown.style.display === 'none' ? 'block' : 'none';
2683
- }
2684
 
2685
- // Close dropdown when clicking outside
2686
- document.addEventListener('click', function(event) {
2687
- const dropdown = document.getElementById('benchmarkDropdown');
2688
- const btn = document.getElementById('benchmarkDropdownBtn');
2689
- if (dropdown && btn && !dropdown.contains(event.target) && !btn.contains(event.target)) {
2690
- dropdown.style.display = 'none';
 
 
 
 
 
2691
  }
2692
- });
2693
-
2694
- function getSelectedBenchmarks() {
2695
- const checkboxes = document.querySelectorAll('#benchmarkDropdown input[type="checkbox"]:checked');
2696
- return Array.from(checkboxes).map(cb => cb.value);
2697
  }
2698
 
2699
- function updateBenchmarkFilter() {
2700
- const selectedBenchmarks = getSelectedBenchmarks();
2701
- const count = selectedBenchmarks.length;
2702
 
2703
- // Update button text
2704
- document.getElementById('selectedBenchmarksText').textContent =
2705
- count === 0 ? 'None selected' :
2706
- count === 12 ? 'All benchmarks' :
2707
- `${count} selected`;
2708
 
2709
- // Filter table by selected benchmarks
2710
  filterByBenchmarks(selectedBenchmarks);
2711
  }
2712
 
2713
- function selectAllBenchmarks() {
2714
- const checkboxes = document.querySelectorAll('#benchmarkDropdown input[type="checkbox"]');
2715
- checkboxes.forEach(cb => cb.checked = true);
2716
- updateBenchmarkFilter();
 
 
 
 
 
 
2717
  }
2718
 
2719
- function deselectAllBenchmarks() {
2720
- const checkboxes = document.querySelectorAll('#benchmarkDropdown input[type="checkbox"]');
2721
- checkboxes.forEach(cb => cb.checked = false);
2722
- updateBenchmarkFilter();
 
 
 
 
 
2723
  }
2724
 
2725
  function filterByBenchmarks(selectedBenchmarks) {
@@ -2774,18 +2796,14 @@ function filterByBenchmarks(selectedBenchmarks) {
2774
  }
2775
 
2776
  function init() {
2777
- // Start with 'default' category which excludes vision and embedding
2778
- currentCategory = 'default';
2779
- populateTableWithDefaultHidden();
2780
 
2781
  // Load dark mode preference
2782
  if (localStorage.getItem('dark') === 'true') {
2783
  document.body.classList.add('dark');
2784
  document.getElementById('darkBtn').textContent = 'β˜€οΈ Light';
2785
  }
2786
-
2787
- // Initialize dropdown text
2788
- updateBenchmarkFilter();
2789
  }
2790
 
2791
  function populateTableWithDefaultHidden() {
 
77
  .fb:hover{background:var(--ac-bg);border-color:rgba(99,102,241,.3);color:var(--ac);}
78
  .fb.on{background:linear-gradient(135deg,#6366f1,#4f46e5);border-color:transparent;color:#fff;box-shadow:0 3px 12px rgba(99,102,241,.25);}
79
 
80
+ /* BENCHMARK FILTER */
81
+ .benchmark-filter-wrapper{display:flex;flex-wrap:wrap;gap:12px;align-items:center;flex:1;}
82
+ .benchmark-category{display:flex;align-items:center;gap:6px;}
83
+ .category-icon{font-size:14px;line-height:1;}
84
+ .category-label{font-size:9px;font-family:var(--font-mono);color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;font-weight:600;white-space:nowrap;}
85
+ .benchmark-pills{display:flex;gap:4px;flex-wrap:wrap;}
86
+ .benchmark-pill{background:var(--surface-alt);border:1px solid var(--border);color:var(--text-sec);padding:4px 10px;border-radius:16px;font-size:9px;font-weight:600;cursor:pointer;transition:all 0.2s cubic-bezier(0.4,0,0.2,1);font-family:var(--font);white-space:nowrap;box-shadow:var(--shadow-sm);opacity:0.6;}
87
+ .benchmark-pill:hover{border-color:var(--border-hover);transform:translateY(-1px);box-shadow:0 2px 8px rgba(15,23,42,.08);}
88
+ .benchmark-pill.active{background:var(--ac-bg);border-color:rgba(99,102,241,.3);color:var(--ac);opacity:1;box-shadow:0 2px 8px rgba(99,102,241,.12);}
89
+ .benchmark-pill.active:hover{background:rgba(99,102,241,.12);border-color:var(--ac);}
90
+ .filter-actions{display:flex;gap:6px;margin-left:auto;}
91
+ .filter-action-btn{background:var(--surface-alt);border:1px solid var(--border);color:var(--text-sec);padding:4px 10px;border-radius:16px;font-size:9px;font-weight:600;cursor:pointer;transition:var(--tr);font-family:var(--font);white-space:nowrap;box-shadow:var(--shadow-sm);}
92
+ .filter-action-btn:hover{background:var(--ac-bg);border-color:rgba(99,102,241,.3);color:var(--ac);}
93
 
94
  /* TABLE */
95
  .tw{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow-x:auto;box-shadow:var(--shadow);margin-bottom:20px;}
 
180
  h1{font-size:20px!important;}
181
  .toolbar{flex-direction:column;gap:6px;}
182
  .search-wrap{max-width:100%;min-width:100%;}
183
+ .benchmark-filter-wrapper{gap:8px;width:100%;}
184
+ .benchmark-category{flex-wrap:wrap;width:100%;}
185
+ .category-label{min-width:60px;}
186
+ .benchmark-pills{flex:1;}
187
+ .filter-actions{width:100%;justify-content:center;margin-left:0;margin-top:4px;}
188
  table{font-size:9px;}
189
  th,td{padding:6px 3px;}
190
  th.c-model,td.c-model{min-width:130px!important;}
 
227
  <input type="text" id="searchBox" placeholder="Search models..." oninput="filterModels()">
228
  </div>
229
  <span class="flbl">Show Benchmarks:</span>
230
+ <div class="benchmark-filter-wrapper">
231
+ <div class="benchmark-category">
232
+ <span class="category-icon">πŸ“</span>
233
+ <span class="category-label">Math</span>
234
+ <div class="benchmark-pills">
235
+ <button class="benchmark-pill active" data-benchmark="gsm8k" onclick="toggleBenchmark('gsm8k')">GSM8K</button>
236
+ <button class="benchmark-pill active" data-benchmark="aime2026" onclick="toggleBenchmark('aime2026')">AIME 2026</button>
237
+ <button class="benchmark-pill active" data-benchmark="hmmt2026" onclick="toggleBenchmark('hmmt2026')">HMMT</button>
 
238
  </div>
239
+ </div>
240
+
241
+ <div class="benchmark-category">
242
+ <span class="category-icon">🧠</span>
243
+ <span class="category-label">Knowledge</span>
244
+ <div class="benchmark-pills">
245
+ <button class="benchmark-pill active" data-benchmark="mmluPro" onclick="toggleBenchmark('mmluPro')">MMLU-Pro</button>
246
+ <button class="benchmark-pill active" data-benchmark="gpqa" onclick="toggleBenchmark('gpqa')">GPQAβ—†</button>
247
+ <button class="benchmark-pill active" data-benchmark="hle" onclick="toggleBenchmark('hle')">HLE</button>
248
+ </div>
249
+ </div>
250
+
251
+ <div class="benchmark-category">
252
+ <span class="category-icon">πŸ’»</span>
253
+ <span class="category-label">Coding</span>
254
+ <div class="benchmark-pills">
255
+ <button class="benchmark-pill active" data-benchmark="sweVerified" onclick="toggleBenchmark('sweVerified')">SWE-V</button>
256
+ <button class="benchmark-pill active" data-benchmark="swePro" onclick="toggleBenchmark('swePro')">SWE-Pro</button>
257
+ </div>
258
+ </div>
259
+
260
+ <div class="benchmark-category">
261
+ <span class="category-icon">πŸ€–</span>
262
+ <span class="category-label">Agent</span>
263
+ <div class="benchmark-pills">
264
+ <button class="benchmark-pill active" data-benchmark="terminalBench" onclick="toggleBenchmark('terminalBench')">TB 2.0</button>
265
+ </div>
266
+ </div>
267
+
268
+ <div class="benchmark-category">
269
+ <span class="category-icon">πŸ’¬</span>
270
+ <span class="category-label">Language</span>
271
+ <div class="benchmark-pills">
272
+ <button class="benchmark-pill active" data-benchmark="evasionBench" onclick="toggleBenchmark('evasionBench')">EvasionB</button>
273
+ </div>
274
+ </div>
275
+
276
+ <div class="benchmark-category">
277
+ <span class="category-icon">πŸ‘οΈ</span>
278
+ <span class="category-label">Vision</span>
279
+ <div class="benchmark-pills">
280
+ <button class="benchmark-pill" data-benchmark="olmOcr" onclick="toggleBenchmark('olmOcr')">olmOCR</button>
281
+ </div>
282
+ </div>
283
+
284
+ <div class="benchmark-category">
285
+ <span class="category-icon">πŸ”</span>
286
+ <span class="category-label">Embedding</span>
287
+ <div class="benchmark-pills">
288
+ <button class="benchmark-pill" data-benchmark="arguana" onclick="toggleBenchmark('arguana')">ArguAna</button>
289
+ </div>
290
+ </div>
291
+
292
+ <div class="filter-actions">
293
+ <button class="filter-action-btn" onclick="selectAllBenchmarks()">Select All</button>
294
+ <button class="filter-action-btn" onclick="deselectAllBenchmarks()">Clear All</button>
295
  </div>
296
  </div>
297
  <div style="flex: 1"></div>
 
2688
  'evasionBench': 'language'
2689
  };
2690
 
2691
+ // Benchmark filter functions
2692
+ let selectedBenchmarks = ['gsm8k', 'mmluPro', 'gpqa', 'hle', 'sweVerified', 'swePro', 'aime2026', 'terminalBench', 'evasionBench', 'hmmt2026'];
 
 
 
2693
 
2694
+ function toggleBenchmark(benchmarkKey) {
2695
+ const pill = document.querySelector(`.benchmark-pill[data-benchmark="${benchmarkKey}"]`);
2696
+
2697
+ if (selectedBenchmarks.includes(benchmarkKey)) {
2698
+ // Deselect
2699
+ selectedBenchmarks = selectedBenchmarks.filter(b => b !== benchmarkKey);
2700
+ pill.classList.remove('active');
2701
+ } else {
2702
+ // Select
2703
+ selectedBenchmarks.push(benchmarkKey);
2704
+ pill.classList.add('active');
2705
  }
2706
+
2707
+ // Update table
2708
+ filterByBenchmarks(selectedBenchmarks);
 
 
2709
  }
2710
 
2711
+ function selectAllBenchmarks() {
2712
+ // Get all benchmarks from BENCHMARK_CATEGORIES
2713
+ selectedBenchmarks = Object.keys(BENCHMARK_CATEGORIES);
2714
 
2715
+ // Update all pills to active
2716
+ document.querySelectorAll('.benchmark-pill').forEach(pill => {
2717
+ pill.classList.add('active');
2718
+ });
 
2719
 
2720
+ // Update table
2721
  filterByBenchmarks(selectedBenchmarks);
2722
  }
2723
 
2724
+ function deselectAllBenchmarks() {
2725
+ selectedBenchmarks = [];
2726
+
2727
+ // Update all pills to inactive
2728
+ document.querySelectorAll('.benchmark-pill').forEach(pill => {
2729
+ pill.classList.remove('active');
2730
+ });
2731
+
2732
+ // Update table
2733
+ filterByBenchmarks(selectedBenchmarks);
2734
  }
2735
 
2736
+ function initBenchmarkFilter() {
2737
+ // Set initial active states based on selectedBenchmarks array
2738
+ selectedBenchmarks.forEach(benchKey => {
2739
+ const pill = document.querySelector(`.benchmark-pill[data-benchmark="${benchKey}"]`);
2740
+ if (pill) pill.classList.add('active');
2741
+ });
2742
+
2743
+ // Initial table population
2744
+ filterByBenchmarks(selectedBenchmarks);
2745
  }
2746
 
2747
  function filterByBenchmarks(selectedBenchmarks) {
 
2796
  }
2797
 
2798
  function init() {
2799
+ // Initialize benchmark filter (defaults to 10 benchmarks selected, excluding vision and embedding)
2800
+ initBenchmarkFilter();
 
2801
 
2802
  // Load dark mode preference
2803
  if (localStorage.getItem('dark') === 'true') {
2804
  document.body.classList.add('dark');
2805
  document.getElementById('darkBtn').textContent = 'β˜€οΈ Light';
2806
  }
 
 
 
2807
  }
2808
 
2809
  function populateTableWithDefaultHidden() {