fix(receipt): shorten crypto destination address so it can't overflow the card - #2527
Conversation
… the card A 44-char Solana address (and 42-char EVM / 34-char Tron) rendered verbatim in the receipt's Address row is one unbreakable token — it blows the drawer card out of the viewport on mobile (Crisp session_779df6b2, TASK-20889). Verbatim display dates from the Tron formatIban-corruption fix, which correctly stopped IBAN-chunking but left no shortening at all. Shorten by wire type in maskAccountIdentifier (start...end, same shape as the drawer header and TX ID rows) instead of printableAddress, whose viem isAddress re-validation would silently fall back to the full overflowing string for wrong-checksum mixed-case addresses. Copy is untouched: getAccountCopyValue still yields the verbatim address.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughLong recognized crypto addresses are shortened for display, transaction receipt destinations use printable address formatting, and payment row values wrap within constrained layouts. Tests cover Tron, Solana, and EVM masking output. ChangesCrypto display handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Comment |
Code-analysis diffPainscore total: 6274.15 → 6274.93 (+0.78) 🆕 New findings (10)
✅ Resolved (10)
📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
…ounterparty in To row Belt-and-braces for the same overflow class: PaymentInfoRow's value wrapper gets min-w-0 + break-words so any future unbreakable token wraps inside the card instead of stretching the row (flex min-width: auto resolves to the token's full width). The To row dropped its viem isAddress pre-guard — it's EVM-only, so Solana/Tron counterparties rendered full-length; printableAddress already passes usernames through untouched.
Summary
A withdrawal to a Solana address renders the full 44-char base58 address in the receipt drawer's Address row. It's one unbreakable token, so the whole card blows out of the viewport on mobile (user report: Crisp session_779df6b2 / Notion TASK-20889). EVM (42-char) and Tron (34-char) destinations overflow the same way.
Root cause: the 2026-07-23 Tron fix made
maskAccountIdentifierreturn crypto addresses verbatim (correctly bypassing theformatIbanbase58 corruption) — but nothing shortens them for display, unlike every other long value in the drawer (header, TX ID, Transfer ID all shorten). Structurally,PaymentInfoRowalso had no flex containment:min-width: autoresolves to the token's full width, so any unbreakable value escapes the card.Fix (3 pieces):
maskAccountIdentifiercrypto branch shortens for display (BfbXuD...NKNb19— same shape the drawer header shows). Copy untouched:getAccountCopyValuestill yields the verbatim address.PaymentInfoRowvalue wrapper getsmin-w-0 break-words— any future unbreakable token wraps inside the card instead of stretching the row.break-wordonly activates when a word can't fit, so normal values render unchanged.isAddresspre-guard (EVM-only — Solana/Tron counterparties rendered full-length);printableAddressalready passes usernames through untouched.Why not
printableAddressin (1): it re-validates shape via viemisAddress, which rejects wrong-checksum mixed-case strings and would silently fall back to the full overflowing address. The wiretype(address/evm-address/peanut-wallet) already tells us it's a crypto address — shorten unconditionally, with a length guard for degenerate short strings.Base =
main:account-mask.utils.ts/isCryptoAddressTypeonly exist onmain(the Tron hotfix hasn't back-merged todev). Merging adds to the existing main→dev back-merge debt.Design notes / accepted trade-offs
isGuestBankClaimbranch renders identifiers verbatim — a full IBAN now wraps instead of overflowing. Follow-up candidate, not bundled.CRYPTO_ADDRESS_TYPESis a closed 3-value set; if the BE ever emits a new crypto wire type it falls to theplainbranch (pre-existing property, unchanged here).Risks / breaking changes
break-wordsaffects all 22PaymentInfoRowconsumers but only when a single word exceeds the line — no layout change for fitting values.QA
npm test: 2154 passed (updated the 2 verbatim-display assertions to shortened; added EVM case).Screenshots
Captured on the local sandbox (mobile 375×667, seeded user, mocked Solana
CRYPTO_WITHDRAWvia route interception — same entry shape the BE serializes). Before =origin/main, After = this branch.The before shot reproduces the user's report exactly: the 44-char address escapes the card's right edge and the copy icon is pushed out of view. After: shortened display, copy icon inline, copy still yields the full address. (Assets live on the
pr-assets-2527branch — delete after merge.)Summary by CodeRabbit
New Features
Bug Fixes