Skip to content

fix(scan): keep outline clear of paste button on mobile browser#1078

Open
orveth wants to merge 2 commits into
masterfrom
fix/scanner-spacing
Open

fix(scan): keep outline clear of paste button on mobile browser#1078
orveth wants to merge 2 commits into
masterfrom
fix/scanner-spacing

Conversation

@orveth
Copy link
Copy Markdown
Contributor

@orveth orveth commented May 15, 2026

Summary

  • /scan (universal QR scanner) had the scan-region outline overlap the paste button on non-PWA mobile browsers. The QRScanner <section> was fixed inset-0 h-screen w-screen, so the library's outline (centered at 50% of the section, sized at 3/4 * min(container.w, container.h)) was centered on full vh while the paste button sat at the bottom of the visible dvh — the outline's bottom edge slid behind it.

Changes

  • app/components/qr-scanner/qr-scanner.tsx — add optional className prop so consumers can override the section sizing. cn() is twMerge(clsx(...)), so position / inset / h / w from the caller cleanly override; sm: variants survive (desktop 400×400 stays).
  • app/routes/_protected.scan.tsx — pass relative inset-auto aspect-square h-auto w-full to QRScanner so it becomes an in-flow square block on mobile. With the scanner now constrained to its own square, PageContent + PageFooter className="pb-14" (the canonical pattern used by send-confirmation and other "primary action at the bottom" pages) gives the outline a centered viewport above the paste button — no useIsPwa conditional needed.
  • send.scan / receive.scan / transfer.scan stay fullscreen — they have no paste button and the immersive camera is the desired UX there.

Test plan

  • Visit /scan on mobile browser (Safari/Chrome, URL bar visible) — outline sits inside the in-flow square, paste button has clear margin below it
  • Same on installed PWA — paste button sits in PageFooter pb-14 like every other bottom-action screen
  • Desktop unchanged — 400×400 scanner area
  • send.scan / receive.scan / transfer.scan still show the fullscreen camera

🤖 Generated with Claude Code

The universal /scan page rendered QRScanner as `fixed inset-0 h-screen
w-screen` on mobile, so the library's scan-region outline (centered at
50% of the section, sized at 3/4 * min(container.w, container.h))
centered on full vh rather than the visible dvh — on non-PWA mobile the
outline's bottom edge slid behind the paste button. Paste button was
also pinned via pb-14 rather than mirroring the home-page button
placement.

- Add an optional className prop to QRScanner so consumers can override
  the section sizing (twMerge handles position/inset/h/w conflicts).
- On _protected.scan.tsx, drop PageFooter and adopt the home-page
  PageContent pattern from PR #1032: justify-between + pt-20 on mobile,
  useIsPwa-conditional pb-20 on the bottom wrapper. Scanner becomes an
  in-flow aspect-square w-full block, outline centers inside it, paste
  button sits in the same w-72 wrapper as Send/Receive/Buy on /.

send.scan / receive.scan / transfer.scan stay fullscreen — they have no
paste button.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
agicash Ready Ready Preview, Comment May 15, 2026 11:51pm

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 15, 2026

This pull request has been ignored for the connected project hrebgkfhjpkbxpztqqke because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Drop the home-page-style isPwa-conditional pb-20 in favor of the same
PageFooter pb-14 used on send-confirmation and other "primary action at
bottom, content at top" screens. With the QRScanner section already
in-flow (relative aspect-square w-full), PageContent + PageFooter give
the outline a centered, square viewport above the paste button — no
conditional needed.
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