Skip to content

fix(ux): fit problem and contest tables to narrow screens - #136

Merged
cameroncuster merged 2 commits into
mainfrom
fix/responsive-tables
Aug 21, 2026
Merged

cameroncuster merged 2 commits into
mainfrom
fix/responsive-tables

Conversation

@cameroncuster

Copy link
Copy Markdown
Owner

Problem

Both the problems and contests tables were pinned to min-w-[900px], so they overflowed horizontally on ordinary laptop widths — not just phones. Every column was always rendered, so there was nothing to give up as the viewport narrowed.

Change

CSS classes only; no markup restructuring, no logic changes, no new dependencies.

  • Base minimum width lowered from 900px to 340px, restored at xl (problems) and lg (contests).
  • Progressive column hiding — Topic below xl, Recommender below md, Duration (contests) below lg.
  • Column widths re-proportioned per breakpoint so the remaining columns absorb the freed space.
  • Tighter mobile spacingp-2 cells and gap-1 feedback buttons below md; the "Difficulty" text label appears at lg+ and the header stays icon-only below that (the sort control keeps its accessible name).
  • Scroll affordance breakpoint moved from 899px to 767px, matching where overflow now actually begins.

Measurements

Wrapper overflow (scrollWidth - clientWidth), measured in Chromium:

Viewport Problems Contests
1440 – 768 0 0
700 – 390 0 0
360 16px (in-table) 16px (in-table)
320 56px (in-table) 56px (in-table)

No page-level horizontal scroll at any width. Below roughly 375px the table scrolls inside its own wrapper, with the existing gradient affordance signalling it.

Validation

  • pnpm run check — 0 errors, 0 warnings
  • pnpm run test — 455/455 pass
  • pnpm run lint — clean for the touched files; the remaining Prettier warnings are all under scripts/venv and predate this branch
  • Visual verification at 1440 / 1280 / 1180 / 1024 / 900 / 768 / 700 / 600 / 480 / 390 / 360 / 320 on both pages

pnpm run test:e2e could not run locally: global setup cannot write 127.0.0.1 gitgud-e2e.localhost to /etc/hosts (EACCES), so SSR fetches to the mock fail. This reproduces on clean main with these changes stashed, so it is environmental rather than a regression. CI should exercise it normally.

Follow-up

Worth adding a Playwright regression asserting scrollWidth === clientWidth on .table-wrapper across a few viewports, to keep this from drifting back. Happy to add it here if preferred.

Both tables forced a 900px minimum width, so they overflowed horizontally on
laptop and phone viewports. Lower the base minimum to 340px and restore the
full width at xl (problems) and lg (contests), drop lower-priority columns
progressively (Topic below xl, Recommender below md, Duration below lg),
widen the remaining columns to reclaim the freed space, and tighten cell
padding and feedback button spacing below md. Move the scroll affordance
breakpoint to 767px so it appears exactly where overflow now begins.
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gitgud Ready Ready Preview Aug 21, 2026 10:50pm

The first pass hid the Topic, Recommender, and Duration columns below their
breakpoints, which removed the author filter and author links entirely on
mobile and broke content parity between viewports. Restore every column and
achieve the narrowing through width and padding alone: base minimum width
600px, full 900px at xl, and p-2 cells below md.
@cameroncuster
cameroncuster merged commit fee76f2 into main Aug 21, 2026
14 checks passed
@cameroncuster
cameroncuster deleted the fix/responsive-tables branch August 21, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant