Make the puzzle playable by touch on phones #8
Loading…
Reference in a new issue
No description provided.
Delete branch "mobile-touch-layout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Makes the puzzle playable one-handed on a phone. Pieces are sized so a finger can grab them, the page stops moving while you play, and the tray scrolls instead of shrinking.
planLayoutmeasures the grabbable span on the narrow side of the piece box and floors it atMIN_PIECE_PX = 48with at leastMIN_SLOTS_PER_ROW = 3columns, so a 4×4 on a 402pt-wide phone gives ~63×47pt pieces instead of ~28pt ones. The floor applies to at least half the pieces; flat-edged pieces draw a little smaller (~43×32) rather than forcing every puzzle down to 3 columns at 12×12..game-touchisposition: fixed; touch-action: none; overscroll-behavior: none; the tray panel alone opts back intopan-y.layer: 'shelf' | 'field') with derived shelf positions, so no two tray pieces can overlap by construction, plus a coarse snap threshold and cell alignment.SavedPiece.layeris optional and validated; v1 records without it map unplaced pieces to the shelf. Returning a piece to the shelf scrolls it into view.Verification
npm test122/122 (9 files),npm run typecheckclean,npm run lint3 pre-existing warnings only,npm run buildok,npx playwright test1/1.openspec validate mobile-touch-layout --strictpasses.Notes for review
main(960c946); the tray minimum-size rule and resume-in-progress both survive, and the spec deltas were re-based on main's wording.openspec archive mobile-touch-layoutshould happen after this is merged.