Skip to content

Keep the lightbox close button clear of the polaroid on mobile - #64

Merged
amyrlam merged 2 commits into
mainfrom
claude/github-issue-61-lightbox-close
Aug 17, 2026
Merged

Keep the lightbox close button clear of the polaroid on mobile#64
amyrlam merged 2 commits into
mainfrom
claude/github-issue-61-lightbox-close

Conversation

@amyrlam

@amyrlam amyrlam commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Fixes #61. (Originally planned as a stack on #63, but that merged first — this is based on main and contains only the one commit.)

What was wrong

On touch phones the ✕ button is viewport-pinned to the top-right corner, but the lightbox dialog centered the polaroid across the whole screen. A tall portrait photo or video pushed the frame's top edge up underneath the button — and since the button's fill is 12% white and its glyph near-white, both vanish against the ivory frame, so it looks clipped/broken (both screenshots on the issue).

The fix

The mobile dialog now takes exactly the screen region below the close button's strip (safe-area inset + 0.75rem offset + 2.25rem button + 0.5rem breathing room) and centers the polaroid inside that region with grid — the frame geometrically cannot reach the button. The mobile media height cap mirrors the same carve-out so tall media shrinks to fit the region instead of reflating the dialog. As a side benefit, the dialog now spans full width, which enlarges the tap-anywhere-outside-the-photo-to-close area (lightbox.ts closes when the click target is the dialog itself).

Verified

Browser-tested at 375×812 and 375×667 (SE) with touch emulation: all 9 carousel items clear the button (minimum 39px on the tall 9:16 video at 812px, 8px at 667px) and fit above the viewport bottom with the dot row visible. All 19 Playwright tests pass (including the touch-phone lightbox tests); Prettier and stylelint clean.

🤖 Generated with Claude Code

Fixes #61. On touch phones the close button is pinned to the top-right
of the viewport, but the dialog centered its polaroid across the full
screen — so a tall portrait photo or video rode up underneath the
button, where its translucent circle and near-white glyph both vanish
against the ivory frame and it reads as broken.

The dialog now takes exactly the screen region below the close button's
strip (safe-area inset + offset + button + breathing room) and centers
the polaroid inside it with grid, so the frame can never reach the
button. The mobile media height cap mirrors the same carve-out, and the
now full-width dialog also widens the tap-anywhere-to-close area.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
youthphase Ready Ready Preview Aug 17, 2026 10:24pm

…dden

The mobile rule set display: grid on .lightbox-dialog unconditionally,
and an author display beats the UA's dialog:not([open]) { display: none }
— so the closed lightbox rendered as a ghost box (empty polaroid, dot
row, close button) at the bottom of every page on phone-sized touch
viewports. Lighthouse caught it: the ghost's dot row fails the
tap-targets audit, dropping /about's SEO score to 0.96.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@amyrlam
amyrlam merged commit 7332392 into main Aug 17, 2026
8 checks passed
@amyrlam
amyrlam deleted the claude/github-issue-61-lightbox-close branch August 17, 2026 22:29
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.

Icon button in photo carousel

1 participant