Michael Rabinovich Cursor commited on
Commit
0eccd77
·
1 Parent(s): 5fb80c6

leaderboard: bigger gallery box + scroll affordance

Browse files

- Raise the box height cap (760->900) so larger screens use their
vertical space and show more rows, keeping the chrome reserve so it
still fits in one viewport (single scroll).
- Add a clear scroll affordance: a persistent (styled) scrollbar plus a
'scroll for more models' fade cue at the bottom that hides once the
list is scrolled to the end, and a caption note that the GT row stays
pinned.

Co-authored-by: Cursor <cursoragent@cursor.com>

Files changed (1) hide show
  1. gallery.py +48 -4
gallery.py CHANGED
@@ -261,6 +261,31 @@ body {
261
  background: var(--panel); border: 1px solid var(--line);
262
  border-radius: var(--radius); box-shadow: var(--shadow); position: relative;
263
  max-height: var(--gallery-max, 560px); overflow-y: auto; overflow-x: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  }
265
  .grid-head, .grow {
266
  display: grid;
@@ -388,9 +413,13 @@ _BODY = """
388
  A fixed comparison sheet: <b>two generation</b> and <b>two editing</b> samples,
389
  one <b>Medium</b> and one <b>Hard</b> per task. Difficulty is fixed (picked from the
390
  Claude Opus 4.8 baseline's per-sample scores), so every visit shows the same columns.
 
391
  </p>
392
- <div class="gallery" id="gallery">
393
- <div class="grid-head" id="gridHead"></div>
 
 
 
394
  </div>
395
  </div>
396
  <div class="modal-back" id="modalBack">
@@ -585,6 +614,15 @@ function syncHeadHeight() {
585
  if (head) document.documentElement.style.setProperty('--head-h', head.offsetHeight + 'px');
586
  }
587
 
 
 
 
 
 
 
 
 
 
588
  // Height of the gallery scroll box. HF auto-resizes the Space iframe to its
589
  // full content height, so `window.innerHeight` / `vh` inside these nested
590
  // iframes report the inflated content height, not the real viewport -- they
@@ -604,8 +642,9 @@ var CHROME_RESERVE = 620;
604
  function sizeGalleryBox() {
605
  try {
606
  const avail = (window.screen && window.screen.availHeight) || 900;
607
- const h = Math.max(280, Math.min(760, Math.round(avail - CHROME_RESERVE)));
608
  document.documentElement.style.setProperty('--gallery-max', h + 'px');
 
609
  } catch (e) { /* keep CSS fallback */ }
610
  }
611
 
@@ -623,7 +662,12 @@ function fitIframe() {
623
  buildGallery();
624
  sizeGalleryBox();
625
  fitIframe();
626
- function relayout() { syncHeadHeight(); sizeGalleryBox(); fitIframe(); }
 
 
 
 
 
627
  window.addEventListener('resize', relayout);
628
  if (window.ResizeObserver) new ResizeObserver(fitIframe).observe(document.body);
629
  if (document.fonts && document.fonts.ready) document.fonts.ready.then(relayout);
 
261
  background: var(--panel); border: 1px solid var(--line);
262
  border-radius: var(--radius); box-shadow: var(--shadow); position: relative;
263
  max-height: var(--gallery-max, 560px); overflow-y: auto; overflow-x: hidden;
264
+ scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
265
+ }
266
+ /* Keep the scrollbar visible (macOS overlay scrollbars otherwise hide it, so
267
+ it isn't obvious the rows scroll). */
268
+ .gallery::-webkit-scrollbar { width: 11px; }
269
+ .gallery::-webkit-scrollbar-track { background: transparent; }
270
+ .gallery::-webkit-scrollbar-thumb {
271
+ background: var(--line-strong); border-radius: 8px; border: 2px solid var(--panel);
272
+ }
273
+ .gallery::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
274
+
275
+ /* Affordance that there are more rows below: a fade + label pinned to the
276
+ bottom of the box, hidden by JS once scrolled to the end. */
277
+ .gallery-shell { position: relative; }
278
+ .scroll-cue {
279
+ position: absolute; left: 1px; right: 12px; bottom: 1px; height: 56px;
280
+ pointer-events: none; display: flex; align-items: flex-end; justify-content: center;
281
+ padding-bottom: 9px; border-radius: 0 0 var(--radius) var(--radius);
282
+ background: linear-gradient(to bottom, rgba(255,255,255,0), var(--panel) 82%);
283
+ }
284
+ .scroll-cue[hidden] { display: none; }
285
+ .scroll-cue span {
286
+ font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
287
+ color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px;
288
+ box-shadow: 0 1px 3px rgba(20,22,28,.12);
289
  }
290
  .grid-head, .grow {
291
  display: grid;
 
413
  A fixed comparison sheet: <b>two generation</b> and <b>two editing</b> samples,
414
  one <b>Medium</b> and one <b>Hard</b> per task. Difficulty is fixed (picked from the
415
  Claude Opus 4.8 baseline's per-sample scores), so every visit shows the same columns.
416
+ <b>Scroll the table</b> to see all models &mdash; the ground-truth row stays pinned for comparison.
417
  </p>
418
+ <div class="gallery-shell">
419
+ <div class="gallery" id="gallery">
420
+ <div class="grid-head" id="gridHead"></div>
421
+ </div>
422
+ <div class="scroll-cue" id="scrollCue" hidden><span>&#9662; scroll for more models</span></div>
423
  </div>
424
  </div>
425
  <div class="modal-back" id="modalBack">
 
614
  if (head) document.documentElement.style.setProperty('--head-h', head.offsetHeight + 'px');
615
  }
616
 
617
+ // Show the "scroll for more" cue only while there are rows below the fold.
618
+ function updateScrollCue() {
619
+ const g = document.getElementById('gallery');
620
+ const cue = document.getElementById('scrollCue');
621
+ if (!g || !cue) return;
622
+ const more = (g.scrollHeight - g.clientHeight - g.scrollTop) > 8;
623
+ cue.hidden = !more;
624
+ }
625
+
626
  // Height of the gallery scroll box. HF auto-resizes the Space iframe to its
627
  // full content height, so `window.innerHeight` / `vh` inside these nested
628
  // iframes report the inflated content height, not the real viewport -- they
 
642
  function sizeGalleryBox() {
643
  try {
644
  const avail = (window.screen && window.screen.availHeight) || 900;
645
+ const h = Math.max(300, Math.min(900, Math.round(avail - CHROME_RESERVE)));
646
  document.documentElement.style.setProperty('--gallery-max', h + 'px');
647
+ updateScrollCue();
648
  } catch (e) { /* keep CSS fallback */ }
649
  }
650
 
 
662
  buildGallery();
663
  sizeGalleryBox();
664
  fitIframe();
665
+ (function () {
666
+ const g = document.getElementById('gallery');
667
+ if (g) g.addEventListener('scroll', updateScrollCue, { passive: true });
668
+ })();
669
+ updateScrollCue();
670
+ function relayout() { syncHeadHeight(); sizeGalleryBox(); fitIframe(); updateScrollCue(); }
671
  window.addEventListener('resize', relayout);
672
  if (window.ResizeObserver) new ResizeObserver(fitIframe).observe(document.body);
673
  if (document.fonts && document.fonts.ready) document.fonts.ready.then(relayout);