Skip to content

harden qr center logo positioning against transform css mismatches#265

Open
deex01 wants to merge 1 commit intomasterfrom
deex/qr-logo-centering-fix
Open

harden qr center logo positioning against transform css mismatches#265
deex01 wants to merge 1 commit intomasterfrom
deex/qr-logo-centering-fix

Conversation

@deex01
Copy link
Copy Markdown
Collaborator

@deex01 deex01 commented Apr 16, 2026

Summary

This changes the QR center logo from transform-based centering to layout-based centering.

Previously, the logo wrapper in the SDK used left: 50%, top: 50%, and translate(-50%, -50%) to center the token/chain logo inside the QR. During investigation of a merchant report, we found that if that translate transform is missing or overridden, the logo shifts down and right in exactly the way shown in the client screenshot.

This PR removes that dependency.

What changed

  • Updated QRCode.tsx to center the loaded QR logo with a full-overlay flex container plus an inner 28% logo box.
  • Updated base.css to use the same layout-centering approach for the QR placeholder logo.

Why

The previous centering approach had a brittle failure mode:

  • left: 50%
  • top: 50%
  • transform: translate(-50%, -50%)

If the transform rule disappears, is overridden, or comes from a mismatched CSS bundle, the logo becomes visibly misaligned.

Layout centering avoids depending on that transform rule for correct placement and should be more robust across merchant environments.

Verification

  • pnpm --filter @daimo/sdk build
  • pnpm --filter @daimo/pay-web typecheck

Also verified locally that:

  • the QR logo remains centered in the normal state
  • the placeholder logo remains centered
  • a hostile transform override that breaks the old pattern does not affect the new layout-centered version

Risk

Low. This is a UI-only hardening change with no API or behavior changes outside QR logo placement.

@deex01 deex01 self-assigned this Apr 16, 2026
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.

1 participant