Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (47)
WalkthroughAdds a prototype swap feature with a dedicated flow, provider state, expanded transaction data, swap-aware transaction and portfolio rendering, reusable success splash UI, and related tests and styling. It also updates dev-mnemonic test environment handling. ChangesPrototype Swap Feature
Estimated code review effort: 4 (Complex) | ~75 minutes Dev Mnemonic Environment Cleanup
Estimated code review effort: 1 (Trivial) | ~3 minutes Sequence Diagram(s)sequenceDiagram
participant BitcoinDetail
participant FlowContext
participant WalletSwap
participant WalletContext
participant TransactionsList
BitcoinDetail->>FlowContext: setSwapFromAssetId('btc')
BitcoinDetail->>WalletSwap: navigate(Pages.WalletSwap)
WalletSwap->>WalletSwap: buildQuote and validate amount
WalletSwap->>WalletContext: addPrototypeSwap(execution)
WalletContext-->>TransactionsList: expose merged prototype transactions
TransactionsList->>TransactionsList: render swap status and amounts
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying wallet-mutinynet with
|
| Latest commit: |
a14093b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://32f15a64.arkade-wallet.pages.dev |
| Branch Preview URL: | https://wt-port-swap-ui-20260707.arkade-wallet.pages.dev |
Deploying tmp-boltz-upstream-mainnet-arkade-wallet with
|
| Latest commit: |
a14093b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b1dbb8b6.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev |
| Branch Preview URL: | https://wt-port-swap-ui-20260707.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev |
Deploying wallet-bitcoin with
|
| Latest commit: |
a14093b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6374db76.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://wt-port-swap-ui-20260707.wallet-bitcoin.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
src/screens/Wallet/Receive/Success.tsx (1)
72-79: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExtract shared asset-label formatting to avoid duplication.
The
displayTextcomputation duplicates the same per-asset label formatting logic already in the notificationuseEffectat lines 56-61 (prettyAssetAmount+ ticker/name fallback). Extracting a small helper would keep both in sync.♻️ Proposed refactor
+function formatAssetLabel( + a: { assetId: string; amount: bigint }, + meta: AssetDetails | undefined, +): string { + return `${prettyAssetAmount(a.amount, meta?.metadata?.decimals ?? 0)} ${meta?.metadata?.ticker ?? meta?.metadata?.name ?? 'assets'}` +} + // Inside the notification useEffect: const labels = receivedAssets.map((a) => { - const meta = assetDetails.get(a.assetId)?.metadata - const amount = prettyAssetAmount(a.amount, meta?.decimals ?? 0) - const ticker = meta?.ticker ?? meta?.name ?? 'assets' - return `${amount} ${ticker}` + return formatAssetLabel(a, assetDetails.get(a.assetId)) }) // displayText: const displayText = isAssetReceive ? receivedAssets - .map((a) => { - const meta = assetDetails.get(a.assetId)?.metadata - return `${prettyAssetAmount(a.amount, meta?.decimals ?? 0)} ${meta?.ticker ?? meta?.name ?? 'assets'}` - }) + .map((a) => formatAssetLabel(a, assetDetails.get(a.assetId))) .join(', ') : `${displayAmount} received successfully`🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/Wallet/Receive/Success.tsx` around lines 72 - 79, The per-asset label formatting in `displayText` duplicates the same `prettyAssetAmount` plus ticker/name fallback logic used in the notification `useEffect` inside `Success`. Extract that shared formatting into a small helper near `Success` and reuse it in both places so the asset label string is built consistently from `receivedAssets` and `assetDetails`.src/components/WalletSuccessSplash.tsx (1)
38-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer individual framer-motion transform properties over
transformstrings.Using
y: '100%'/y: 0instead oftransform: 'translate3d(0, 100%, 0)'is more idiomatic for framer-motion and ensures the spring physics apply reliably to the animated values. The same applies to themotion.spancopy animation at lines 54-55 (y: 10/y: 0).♻️ Proposed refactor
<motion.button type='button' className='wallet-success-splash' onClick={handleDone} - initial={{ transform: 'translate3d(0, 100%, 0)' }} - animate={{ transform: 'translate3d(0, 0%, 0)' }} - exit={{ transform: 'translate3d(0, 100%, 0)' }} + initial={{ y: '100%' }} + animate={{ y: '0%' }} + exit={{ y: '100%' }} transition={{ type: 'spring', stiffness: 260, damping: 30, mass: 0.95 }} aria-label={ariaLabel} > <motion.span className='wallet-success-splash__mark' initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} transition={{ delay: 0.16, type: 'spring', duration: 0.42, bounce: 0.18 }} > <SuccessIcon small /> </motion.span> <motion.span className='wallet-success-splash__copy' - initial={{ opacity: 0, transform: 'translate3d(0, 10px, 0)' }} - animate={{ opacity: 1, transform: 'translate3d(0, 0, 0)' }} + initial={{ opacity: 0, y: 10 }} + animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.2, duration: 0.24, ease: EASE_OUT_QUINT_TUPLE }} >Also applies to: 54-55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/WalletSuccessSplash.tsx` around lines 38 - 40, Replace the string-based transform animations in WalletSuccessSplash with framer-motion’s individual motion props so the spring behavior applies correctly. Update the motion container setup in the component to use y values instead of transform strings, and make the same change in the motion.span copy animation by switching to y-based initial/animate values. Keep the existing animation flow and timing the same while updating the relevant motion elements in WalletSuccessSplash.src/test/hooks/usePortfolioFiat.test.tsx (1)
48-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd test coverage for USD aggregation and prototype delta paths.
The current test only covers the CHF aggregation path. The USD bucket (USDT/USDC →
account:usd) andprototypeAssetBalanceDeltasintegration are critical aggregation paths that lack coverage. Adding test cases following the existing patterns would be straightforward and would verify the clamping logic andsourceAssetIdstracking for these paths.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/hooks/usePortfolioFiat.test.tsx` around lines 48 - 53, The current hook test only validates the CHF aggregation path, so add coverage in usePortfolioFiat.test.tsx for the USD bucket and prototypeAssetBalanceDeltas path as well. Extend the existing usePortfolioFiat assertions to verify the account:usd row produced from USDT/USDC aggregation, including fiatAmount clamping, satsEquivalent, hasFiatPrice, and sourceAssetIds, and add a case that exercises prototypeAssetBalanceDeltas through usePortfolioFiat to confirm the same aggregation behavior is preserved there.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/ui/drawer.tsx`:
- Line 44: The base DrawerContent styles in drawer.tsx are leaking border styles
into SheetModal because it also reuses DrawerContent; scope the border-related
classes to the swap variant only. Update the DrawerContent class set so the
generic drawer keeps border-0, and apply border-t/b and related directional
border classes only when the .swap-drawer-content variant is used.
In `@src/index.css`:
- Line 1802: Update the affected CSS declarations in the stylesheet to satisfy
stylelint: replace the deprecated clip usage with clip-path: inset(50%) in the
rule that currently contains clip: rect(0 0 0 0), and change the currentColor
value to lowercase currentcolor in the declaration at the other reported
location. Keep the surrounding selectors and spacing unchanged while fixing
those two declarations.
- Around line 2749-2762: The reduced-motion override in the stylesheet currently
stops splash path animations and active transforms, but it still leaves the
infinite swap skeleton shimmer running. Update the existing
prefers-reduced-motion block in index.css to also disable the swap skeleton
shimmer animation by targeting the same skeleton/shimmer selector used for the
swap loading state, so all motion is suppressed consistently when reduced motion
is requested.
In `@src/providers/wallet.tsx`:
- Around line 151-152: Clear the prototype swap state when the wallet is locked
or reset. In WalletProvider, make sure both prototypeTxs and
prototypeAssetBalanceDeltas are emptied inside the lockWallet and resetWallet
flows so a new session does not inherit stale swap history or balance deltas.
Use the existing state setters for prototypeTxs and prototypeAssetBalanceDeltas,
and verify any helper paths that trigger wallet reset also clear both buckets
consistently.
---
Nitpick comments:
In `@src/components/WalletSuccessSplash.tsx`:
- Around line 38-40: Replace the string-based transform animations in
WalletSuccessSplash with framer-motion’s individual motion props so the spring
behavior applies correctly. Update the motion container setup in the component
to use y values instead of transform strings, and make the same change in the
motion.span copy animation by switching to y-based initial/animate values. Keep
the existing animation flow and timing the same while updating the relevant
motion elements in WalletSuccessSplash.
In `@src/screens/Wallet/Receive/Success.tsx`:
- Around line 72-79: The per-asset label formatting in `displayText` duplicates
the same `prettyAssetAmount` plus ticker/name fallback logic used in the
notification `useEffect` inside `Success`. Extract that shared formatting into a
small helper near `Success` and reuse it in both places so the asset label
string is built consistently from `receivedAssets` and `assetDetails`.
In `@src/test/hooks/usePortfolioFiat.test.tsx`:
- Around line 48-53: The current hook test only validates the CHF aggregation
path, so add coverage in usePortfolioFiat.test.tsx for the USD bucket and
prototypeAssetBalanceDeltas path as well. Extend the existing usePortfolioFiat
assertions to verify the account:usd row produced from USDT/USDC aggregation,
including fiatAmount clamping, satsEquivalent, hasFiatPrice, and sourceAssetIds,
and add a case that exercises prototypeAssetBalanceDeltas through
usePortfolioFiat to confirm the same aggregation behavior is preserved there.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0632f6ab-35ba-4d30-b11a-8765fa98c089
📒 Files selected for processing (23)
src/components/TransactionsList.tsxsrc/components/WalletSuccessSplash.tsxsrc/components/ui/drawer.tsxsrc/hooks/usePortfolioFiat.tssrc/icons/ArrowUpDown.tsxsrc/index.csssrc/lib/types.tssrc/providers/flow.tsxsrc/providers/navigation.tsxsrc/providers/wallet.tsxsrc/screens/Wallet/AssetsSection.tsxsrc/screens/Wallet/BitcoinDetail.tsxsrc/screens/Wallet/HomeQuickActions.tsxsrc/screens/Wallet/Receive/Success.tsxsrc/screens/Wallet/Send/Success.tsxsrc/screens/Wallet/Swap/Index.tsxsrc/screens/Wallet/Transaction.tsxsrc/test/App.test.tsxsrc/test/hooks/usePortfolioFiat.test.tsxsrc/test/screens/mocks.tssrc/test/screens/wallet/index.test.tsxsrc/test/screens/wallet/swap.test.tsxsrc/vite-env.d.ts
💤 Files with no reviewable changes (1)
- src/vite-env.d.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/screens/wallet/swap.test.tsx (1)
157-179: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for the swap confirmation flow.
The review dialog test stops before clicking "Confirm," so
addPrototypeSwapis never exercised. A confirmation test would verify the core swap flow: thataddPrototypeSwapis called with correct arguments and the success splash renders. TheWalletContextmock inrenderSwapdoesn't explicitly provideaddPrototypeSwap, so it would need to be added (e.g.,addPrototypeSwap: vi.fn()).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/screens/wallet/swap.test.tsx` around lines 157 - 179, Add a confirmation-flow test alongside the existing “shows a human-readable amount and fee breakdown” test: provide an addPrototypeSwap mock in renderSwap’s WalletContext setup, click Confirm in the review dialog, assert it is called with the expected swap arguments, and verify the success splash renders.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test/screens/wallet/swap.test.tsx`:
- Around line 157-179: Add a confirmation-flow test alongside the existing
“shows a human-readable amount and fee breakdown” test: provide an
addPrototypeSwap mock in renderSwap’s WalletContext setup, click Confirm in the
review dialog, assert it is called with the expected swap arguments, and verify
the success splash renders.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5d34bdd3-762b-4376-affe-98f15fb3454a
📒 Files selected for processing (8)
src/components/WalletSuccessSplash.tsxsrc/components/ui/drawer.tsxsrc/index.csssrc/providers/wallet.tsxsrc/screens/Wallet/Receive/Success.tsxsrc/screens/Wallet/Swap/Index.tsxsrc/test/hooks/usePortfolioFiat.test.tsxsrc/test/screens/wallet/swap.test.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
- src/components/WalletSuccessSplash.tsx
- src/index.css
- src/screens/Wallet/Receive/Success.tsx
- src/screens/Wallet/Swap/Index.tsx
Port the redesigned wallet swap experience onto the current wallet home redesign, including the swap route, asset picker, composer, review drawer, success splash, and wallet entry points. Add prototype swap transaction metadata and portfolio balance deltas so local swap confirmations render in home activity and transaction details while remaining fenced from real settlement behavior. Fold in the home activity/rate note follow-up by moving recent activity above upsells, removing the LendaSat upsell, adding the dynamic-rate note, and covering the flow with wallet swap tests.
Replace the ambiguous estimated and total value presentation with explicit Swap, Receive, and Fees rows in the review drawer. Keep the prototype fee at zero until live quote integration supplies the final value, and cover the 50 USD review case with a regression test.
Scope the flexible asset-copy layout to its dedicated wrapper so custom token avatars remain square in the swap composer. Add a regression test covering custom asset icons.
Show a single configured-unit value in recent swap activity and render reusable asset-pair receipt details with privacy-aware From and To values.\n\nKeep honest placeholders for swap fees and transaction IDs until real metadata is persisted, while allowing real values to take precedence.
1942e37 to
5232cc4
Compare
Normalize USDT, USDC, and AUSD wallet surfaces to USD and DPIX/DEPIX to BRL while preserving the underlying asset IDs for transfers. Aggregate equivalent fiat tokens into account balances, use currency flags, and keep issuer branding out of wallet-facing send, receive, swap, activity, and transaction views.\n\nRefs #760
Route wallet accounts to the bitcoin-style detail experience with price, actions, genuine historical cross-rate charts, balances, values, and filtered activity. Show an explicit unavailable state when a real market history cannot be derived, and rename the wallet section from Assets to Accounts. Refs #763 Refs #759
Keep non-fiat tokens on their administration detail screen while fiat accounts retain the wallet account experience. Carry normalized account context through send, allocate amounts across real backing assets with decimal-aware balances, and use the largest backing rail for receive. Add regressions for multi-source USD sends and non-fiat detail routing. Refs #759 Refs #760 Refs #763
Prevent partial fiat subtotals for mixed-asset transactions, retain cross-issuer sub-cent precision until aggregation completes, and provide a stable fallback label when asset ticker metadata is unavailable. Add regression coverage for each corrected path.
Merge the completed fiat-account presentation, market detail, activity valuation, BRL labeling, chart localization, and aggregated account action work into the swap feature branch.
Return directly to the originating asset detail when a swap starts there, while retaining the internal picker back path for swaps started from the wallet. Format and convert primary swap amounts using the currency and bitcoin unit selected in Settings, with regression coverage for navigation and BTC precision.
Sample constant currency pairs uniformly across the selected window so Liveline retains data near both viewport edges after applying its internal buffer. Use the shared series builder for fiat account charts and cover standard and all-time windows plus the USD account integration.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
This draft PR combines the redesigned wallet swap flow with swap-specific activity presentation and the follow-up fixes from #758 and #762.
Tracking
Closes #754.
Closes #758.
Closes #762.
Real swap metadata remains tracked separately:
Affected areas
src/screens/Wallet/Swap/Index.tsx,src/providers/flow.tsx,src/providers/navigation.tsx,src/providers/wallet.tsx,src/lib/types.ts.src/components/TransactionsList.tsx,src/screens/Wallet/Transaction.tsx,src/components/Details.tsx,src/components/SwapRouteIcon.tsx,src/components/SwapTransactionSummary.tsx,src/lib/swapDisplay.ts.src/screens/Wallet/HomeQuickActions.tsx,src/screens/Wallet/BitcoinDetail.tsx,src/screens/Wallet/AssetsSection.tsx,src/components/WalletSuccessSplash.tsx, send/receive success screens, drawer styling, andsrc/index.css.reviews/codex-code-review-2026-07-13-1622.md,reviews/codex-code-review-2026-07-14-1530.md.Verification
bun run test:unit— 52 files passed; 365 tests passed; 3 skipped.bunx tsc -b --pretty false.bun run lint.bun run format:check.bun run build.git diff --check.Visual behavior
0 BTCas the primary input instead of USD.