Skip to content

Give text fields 16px text on phones so iOS does not zoom in - #40

Merged
renrenmimi merged 1 commit into
mainfrom
fix/phone-input-zoom
Oct 9, 2026
Merged

renrenmimi merged 1 commit into
mainfrom
fix/phone-input-zoom

Conversation

@renrenmimi

Copy link
Copy Markdown
Owner

Summary

Part of audit item 30 (code and UX), the last one still open. iOS Safari zooms the whole page when it focuses a text field whose text is smaller than 16px. Every text field on the site was 13–15.5px:

  • the lab inputs in the string, hash, BST, heap, trie and advanced chapters;
  • the quiz fill-ins;
  • the command palette.

Below 560px, text fields get 16px. The selectors cover input without a type attribute, because the labs' inputs have none. The rule uses !important because chapter styles size their lab inputs with more specific selectors such as [data-ch="heap"] .hp-input.

Test plan

  • narrow.spec.ts measures every lab input on the six chapter pages at 390px. It also measures a field with the quiz's and the palette's classes, since those fields appear only on their question or when the palette is open. Without the rule the check fails at 15px; with it, it passes.
  • The narrow-layout checks still pass, so the larger text does not push anything off a 360px or 390px screen.
  • npm run typecheck, npm test (104 passed), npm run build, npx playwright test (56 passed).

🤖 Generated with Claude Code

iOS Safari zooms the whole page when it focuses a text field whose text is
smaller than 16px. Every text field on the site was 13-15.5px: the lab
inputs, the quiz fill-ins and the command palette (code and UX item 30).

Below 560px, text fields (including the labs' inputs, which have no type
attribute) get 16px. The rule uses !important because chapter styles size
their lab inputs with more specific selectors.

narrow.spec.ts measures every lab input on six chapter pages at 390px, plus
a field with the quiz's and the palette's classes. It fails at 15px without
the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
data-data Ready Ready Preview Oct 9, 2026 12:19am UTC

Copilot AI balanced review requested due to automatic review settings October 9, 2026 00:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T00:19:36.491598Z 5abd61d 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5abd61d084

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/globals.css
/* iOS Safari zooms the whole page when it focuses a text field whose text
is smaller than 16px. Phones get 16px in every text field; !important
because chapter styles size their lab inputs with more specific selectors. */
@media (max-width: 560px) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cover landscape phone viewports

On iPhones held in landscape, the CSS viewport is commonly wider than 560px (for example, 844px), so this media query does not apply and the lab, quiz, and command-palette fields remain at 13–15.5px. Focusing them can therefore still trigger the iOS Safari zoom that this change is intended to prevent; target mobile/touch devices independently of narrow viewport width, and include a landscape viewport in the test.

Useful? React with 👍 / 👎.

@renrenmimi
renrenmimi merged commit 4ce27e3 into main Oct 9, 2026
3 checks passed
@renrenmimi
renrenmimi deleted the fix/phone-input-zoom branch October 9, 2026 00:20

This branch was successfully deployed

1 active deployment
Preview — 5abd61d0 Deployed Oct 9, 2026 by vercel[bot]
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