Fix overlapping table UI on small screens #12

Merged
cmoriarty merged 1 commit from mobile-layout-fix into main 2026-11-07 11:20:59 -05:00
Owner

Problem

On short/narrow phones (e.g. iPhone 13 in Safari) the table UI overlapped itself all over the place: the round label and trump card collided with the seat row, the bid banner and bid panel landed on top of my seat, and my seat spilled out of the felt.

Root cause: the table screen is a fixed-height flex column (top bar / felt / bid panel / hand). The felt's content — seat rows, round label, trump, played cards, my seat — is taller than the space left on small screens, and the table center was the only shrinkable element, so it collapsed to ~0 and its centered content overflowed in both directions.

Fix

  • Compact mobile layout (≤480px): slimmer top bar, compact seats (one-line names, smaller avatars/badges/scratches), smaller trump and played cards, tighter bid panel and hand.
  • Scroll fallback: the felt scrolls (overflow-y: auto) when the content still doesn't fit, so elements never overlap on any screen size. The table center keeps a min-content height so it never collapses below its content.
  • Auto-scroll: when play starts on a scrolling felt, the table center (the played cards) is scrolled into view.

Verified

  • 155/155 tests, typecheck clean.
  • Playwright at 390×844 (iPhone 13), 390×560 (Safari chrome), 360×780 and 360×560 (iPhone 13 mini class), 402×874 (iPhone 17 Pro) and 1280×800 (desktop): no overlaps anywhere; the felt only scrolls on the shortest viewports, and desktop sizes are unchanged.
  • iPhone 17e simulator (390×844, real Safari with browser chrome) in a 5-player game: bidding and play phases render cleanly with no overlapping elements.
## Problem On short/narrow phones (e.g. iPhone 13 in Safari) the table UI overlapped itself all over the place: the round label and trump card collided with the seat row, the bid banner and bid panel landed on top of my seat, and my seat spilled out of the felt. Root cause: the table screen is a fixed-height flex column (top bar / felt / bid panel / hand). The felt's content — seat rows, round label, trump, played cards, my seat — is taller than the space left on small screens, and the table center was the only shrinkable element, so it collapsed to ~0 and its centered content overflowed in both directions. ## Fix - **Compact mobile layout** (≤480px): slimmer top bar, compact seats (one-line names, smaller avatars/badges/scratches), smaller trump and played cards, tighter bid panel and hand. - **Scroll fallback**: the felt scrolls (`overflow-y: auto`) when the content still doesn't fit, so elements never overlap on any screen size. The table center keeps a `min-content` height so it never collapses below its content. - **Auto-scroll**: when play starts on a scrolling felt, the table center (the played cards) is scrolled into view. ## Verified - 155/155 tests, typecheck clean. - Playwright at 390×844 (iPhone 13), 390×560 (Safari chrome), 360×780 and 360×560 (iPhone 13 mini class), 402×874 (iPhone 17 Pro) and 1280×800 (desktop): no overlaps anywhere; the felt only scrolls on the shortest viewports, and desktop sizes are unchanged. - iPhone 17e simulator (390×844, real Safari with browser chrome) in a 5-player game: bidding and play phases render cleanly with no overlapping elements.
On short/narrow phones (e.g. iPhone 13 in Safari) the felt's content —
seat rows, round label, trump, played cards, my seat — was taller than
the space left by the top bar, bid panel and hand. The table center was
the only shrinkable element, so it collapsed and its centered content
overflowed in both directions, overlapping the seats, my seat and the
bid panel.

- Compact the mobile layout: slimmer top bar, compact seats (one-line
  names, smaller avatars/badges), smaller trump and played cards,
  tighter bid panel and hand.
- The felt now scrolls (overflow-y: auto) when the content still does
  not fit, so elements never overlap on any screen size.
- The table center keeps a min-content height so it never collapses
  below its content while the felt scrolls.
- When play starts on a scrolling felt, auto-scroll so the table center
  (the played cards) stays in view.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/scratch-vllm-fp8!12
No description provided.