fix: show and wire up "swap again" for Solana / non-EVM swaps cp-8.2.0#32741
Conversation
Non-EVM activity rows (e.g. Solana) never carry token decimals, so toBridgeToken bailed and the "swap again" button was hidden — and would have no-opped even if shown, because the skeleton's chain id and address never matched the user's held tokens. Only require decimals for EVM rows now; for non-EVM keep a 0 placeholder and let useActivityDetailsDoItAgain hydrate the real value from held tokens. Key the non-EVM skeleton by its full CAIP-19 asset id (the same key selectMultichainTokenListForAccountsAnyChain stores as the token address) so hydration matches and fills in the real decimals, the correct Solana address, icon, and balance. EVM behavior is unchanged. Fixes: TMCU-993
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: SmokeSwap: The "Do It Again" button navigates to SmokeConfirmations: Required per SmokeSwap tag description — swap flows involve transaction confirmations. SmokeNetworkExpansion: The change specifically adds Solana (non-EVM) token support. The fix enables Solana SPL tokens and native SOL to be correctly mapped to BridgeToken objects for the swap-again flow. This is directly in scope for SmokeNetworkExpansion which covers Solana Wallet Standard compliance and non-EVM blockchain support. SmokeWalletPlatform: ActivityDetails is part of the transaction history view, which is covered by SmokeWalletPlatform (transaction history: displaying incoming/outgoing transactions, token transfer details). The "Do It Again" button lives in this view. The change is well-scoped with good unit test coverage. Risk is medium because it touches the swap/bridge navigation path for Solana tokens, which is a user-facing flow. Performance Test Selection: |
|



Description
On a Solana (and other non-EVM) swap's activity detail screen, the "Swap again" button was missing. EVM swaps showed it; non-EVM swaps did not.
Root cause: the button is gated on
toBridgeToken(...)returning a token, and that helper bailed ondecimals === undefined. Non-EVM activity rows never carrydecimals(the keyring adapter'sgetTokenonly setsamount/symbol/assetId), so the helper returnedundefined→ the gate hid the button. It would also have no-opped even if shown, because the non-EVM skeleton was keyed by the bare reference or the EVM0x0sentinel, but the user's held non-EVM tokens are keyed by their full CAIP-19 asset id asaddress(selectMultichainTokenListForAccountsAnyChainstoresaddress: assetId), so hydration could never match.Fix (localized to
toBridgeToken):decimalsfor EVM rows. For non-EVM, keep a0placeholder and letuseActivityDetailsDoItAgainhydrate the real value from the user's held tokens (right after a swap the user holds both legs).address, soisSameBridgeTokenmatches the held token and fills in the realdecimals, correct Solana address, icon, and balance.This mirrors the extension's "gate on the asset id, resolve the full token" approach, adapted to mobile's held-token hydration. No changes were needed in
SwapDetails/BridgeDetails— they already consume the gate + hook.Changelog
CHANGELOG entry: Fixed the "Swap again" button not appearing on Solana and other non-EVM swap activity details.
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-993
Manual testing steps
Screenshots/Recordings
Simulator.Screen.Recording.-.iPhone.17.-.2026-07-02.at.16.21.41.mov
Before
Simulator.Screen.Recording.-.iPhone.17.-.2026-07-02.at.16.21.30.mov
After
Simulator.Screen.Recording.-.iPhone.17.-.2026-07-02.at.16.21.41.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist
Note
Low Risk
Scoped change to activity-to-bridge token mapping with EVM behavior preserved and solid unit/hook coverage; no auth or transaction signing changes.
Overview
Swap again on activity details was hidden for Solana and other non-EVM swaps because
toBridgeTokenrequireddecimals, which those activity rows never include.toBridgeTokennow only enforces decimals on EVM chains; for non-EVM it builds a bridge token withdecimals: 0and uses the full CAIP-19assetIdasaddressso held-token hydration inuseActivityDetailsDoItAgaincan match wallet tokens and fill real decimals, icons, and balances. EVM mapping is unchanged (still needs decimals and normalized contract/native addresses).Tests cover EVM rows missing decimals, Solana SPL/native skeleton tokens, hydration from held tokens on repeat swap, and the visibility gate for symbol-only Solana legs.
Reviewed by Cursor Bugbot for commit 779f1a3. Bugbot is set up for automated code reviews on this repo. Configure here.