Skip to content

Tablets and other screen sizes: one layout rule, upright-tablet layout, rotate notice - #31

Merged
MsMarion merged 1 commit into
mainfrom
feature/tablet-and-other-screens
Oct 18, 2026
Merged

MsMarion merged 1 commit into
mainfrom
feature/tablet-and-other-screens

Conversation

@MsMarion

Copy link
Copy Markdown
Owner

Follow-up to the phone layout (#30): the other screen sizes. Same look, no new UI.

I looked at the live site at each size first. Findings:

Screen Before Now
Laptop 1366x768, tablet on its side 1180x820, ultrawide 3440x1440 fine unchanged (desktop stage)
Tablet held upright 820x1180 a 1920 px stage shrunk to 43 percent, content in the top half, bottom half empty the phone layout on a 640 px stage: lobby, game (camera + the sign to show), sign in, results all fill the width
Phone on its side 844x390 a 36 percent stage, sign-in a thin sliver a "rotate your phone upright to play" notice with a "continue anyway" link

How it works

  • One rule, computeLayout(width, height) in src/lib/layout.ts (unit tested for 30+ sizes), used by the stage, the game component and the CSS. A new compact: Tailwind variant follows the stage, so the styles and the code cannot disagree.
  • Bug fixed on the way: the stage was overflow: hidden, which code can still scroll (focus, scrollIntoView). In testing, a click on START scrolled the whole stage up and to the left and cropped the page; on a tablet an input getting focus could do the same. It is now overflow: clip, which cannot be scrolled. There is a test that tries to scroll it.
  • Not changed: songs/community still use the desktop stage on phones and tablets (they have no songs yet); the three-tab arch is hidden in the compact layout.

Tested

Unit 47/47 (computeLayout across phones, tablets, laptops, monitors, sideways phones, wide-and-short windows); tsc; 6 new browser tests (F-08 to F-13) plus the 7 phone tests pass locally with real hand tracking; matrix is 106 rows. Looked at the screenshots at each size.

…pright tablets, rotate notice

computeLayout(width, height) decides the layout for every screen: phones upright get the compact
layout on a 480 px stage, tablets held upright get it on a 640 px stage (they were a 1920 px stage
shrunk to 43 percent, with the bottom half empty), a phone on its side gets a rotate-your-phone
notice with a continue-anyway link, and everything else (laptops, tablets on their side, big and
ultrawide monitors) keeps the desktop stage, which already looked right.

The stage is now overflow: clip instead of hidden, because a hidden box can still be scrolled by
code (focus, scrollIntoView), which shifted the whole stage out of place. The compact Tailwind
variant follows the stage instead of the raw window width.
@MsMarion
MsMarion merged commit aed325f into main Oct 18, 2026
9 checks passed
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