Skip to content

Stop iOS double-tap zoom on the board - #78

Merged
IlianP merged 1 commit into
mainfrom
claude/iphone-double-tap-zoom-sedkm9
Oct 16, 2026
Merged

IlianP merged 1 commit into
mainfrom
claude/iphone-double-tap-zoom-sedkm9

Conversation

@IlianP

@IlianP IlianP commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Problem

On iPhone (Safari and the LinkedIn in-app browser, iOS 27), a quick second tap on a cell — the normal empty → dot → queen move — zoomed the page mid-game. iOS has ignored user-scalable=no in the viewport meta since iOS 10, and the board's touch-action: none alone did not stop WebKit's double-tap recognizer.

Fix

  • css/styles.css: touch-action: manipulation on html, body. Effective touch-action is the intersection over ancestors, so this disables double-tap zoom page-wide (buttons, text) while keeping pinch-zoom for accessibility.
  • js/main.js: a non-passive touchend listener on the board that cancels the event — what WebKit's double-tap recognizer respects. Input runs entirely on pointer events (already fired by then); only the synthetic click is lost, and nothing on the board listens for one.

Tests

  • New tests/browser/double-tap-zoom.mjs (touch-emulated Chromium): <html> touch-action is manipulation, both touchends of a quick double tap are cancelled, the taps still land (cell ends as queen), page not zoomed, toolbar buttons still click. Fails with the JS change reverted. Chromium never zooms here, so it asserts the guards rather than the zoom itself.
  • Still passing: touch-accuracy (swipes/axis lock), reset-timer, board-size-hint, all tests/logic/.
  • Not verifiable here on a real iPhone — to be confirmed after deployment.

CLAUDE.md lists the new test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K79iKR3yQNwPX7Q3fc7Vzd


Generated by Claude Code

iOS Safari ignores user-scalable=no, so a quick second tap on a cell
(empty -> dot -> queen) zoomed the page mid-game. Set touch-action:
manipulation on <html> and cancel touchend on the board (non-passive);
input runs on pointer events, so taps and swipes are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K79iKR3yQNwPX7Q3fc7Vzd
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T06:18:20.108947Z e6c3739 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@IlianP
IlianP merged commit 6b73428 into main Oct 16, 2026
1 check passed
@IlianP
IlianP deleted the claude/iphone-double-tap-zoom-sedkm9 branch October 16, 2026 10:42
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.

2 participants