Michael Rabinovich Cursor commited on
Commit
00f76c2
·
1 Parent(s): 2ec97dd

leaderboard: fix mobile gallery (GT row wrap + double scroll)

Browse files

- The GT row wrapped on mobile because a base rule (.grow.gt-row .rank)
re-showed the rank cell only on that row (7 items in a 6-col grid);
force-hide rank on mobile so the row lays out correctly.
- On phones, drop the vertical cap so the page scrolls once vertically
and fixtures are reached by horizontal swipe (frozen Submission
column), instead of a tiny capped box plus a confusing outer scroll.

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

Files changed (1) hide show
  1. gallery.py +15 -2
gallery.py CHANGED
@@ -411,8 +411,10 @@ a.sub-name:hover { color: var(--accent); text-decoration: underline; }
411
  .grid-head, .grow {
412
  grid-template-columns: 128px 78px repeat(var(--ncol, 4), 118px);
413
  }
414
- /* Drop the rank column (cells + header) to save width. */
415
- .rank, .grid-head .h-rank { display: none; }
 
 
416
  /* Freeze the identity / Submission column while swiping horizontally. */
417
  .ident, .grid-head .h-sub {
418
  position: sticky; left: 0; z-index: 8;
@@ -668,6 +670,17 @@ function updateScrollCue() {
668
  var CHROME_RESERVE = 450;
669
  function sizeGalleryBox() {
670
  try {
 
 
 
 
 
 
 
 
 
 
 
671
  const avail = (window.screen && window.screen.availHeight) || 900;
672
  const h = Math.max(320, Math.min(1200, Math.round(avail - CHROME_RESERVE)));
673
  document.documentElement.style.setProperty('--gallery-max', h + 'px');
 
411
  .grid-head, .grow {
412
  grid-template-columns: 128px 78px repeat(var(--ncol, 4), 118px);
413
  }
414
+ /* Drop the rank column (cells + header) to save width. !important beats the
415
+ base `.grow.gt-row .rank` rule, which would otherwise re-show it on the GT
416
+ row only and wrap that row (7 items into a 6-column grid). */
417
+ .rank, .grid-head .h-rank { display: none !important; }
418
  /* Freeze the identity / Submission column while swiping horizontally. */
419
  .ident, .grid-head .h-sub {
420
  position: sticky; left: 0; z-index: 8;
 
670
  var CHROME_RESERVE = 450;
671
  function sizeGalleryBox() {
672
  try {
673
+ // Phones: drop the vertical cap entirely. Mobile browser + HF chrome eat
674
+ // most of the short viewport, so a capped box would be tiny AND still
675
+ // double-scroll. Instead let the gallery take its natural height and the
676
+ // page scroll once vertically; fixtures are reached by horizontal swipe
677
+ // (overflow-x). Width (unlike height) is not inflated by the nesting, so
678
+ // innerWidth is a reliable mobile check.
679
+ if ((window.innerWidth || 1000) < 760) {
680
+ document.documentElement.style.setProperty('--gallery-max', 'none');
681
+ updateScrollCue();
682
+ return;
683
+ }
684
  const avail = (window.screen && window.screen.availHeight) || 900;
685
  const h = Math.max(320, Math.min(1200, Math.round(avail - CHROME_RESERVE)));
686
  document.documentElement.style.setProperty('--gallery-max', h + 'px');