Skip to content

Conversation

@Artem1211
Copy link
Collaborator

@Artem1211 Artem1211 commented Nov 12, 2025

Summary by CodeRabbit

  • New Features

    • Added app-wide toast notifications and a reusable toast container component.
    • Toasts now appear in the app layout to surface feedback consistently.
  • Bug Fixes

    • Enhanced error handling in lend flows with clearer, token-aware error messages.
    • Fixed error propagation in liquidity operations.
    • Improved decimal precision displayed for market supply and borrow amounts.
  • Documentation

    • Removed an outdated FAQ section from the landing page.

@coderabbitai
Copy link

coderabbitai bot commented Nov 12, 2025

Walkthrough

Adds react-toastify and a ToasterContainer component integrated into the root layout, enhances error handling in the lend-increase flow to parse and display balance-related toast errors, changes a liquidity hook to rethrow errors, removes Math.floor from market-card displays, and deletes an FAQ entry on the landing page.

Changes

Cohort / File(s) Summary
Toast infrastructure
packages/app/package.json, packages/app/src/app/layout.tsx, packages/app/src/global/providers/toaster-container.tsx
Added react-toastify v11.0.5, created ToasterContainer client component with configured ToastContainer, and rendered it inside the root layout's <body>.
Lend flow error handling
packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx
Wrapped send operation in try/catch, parse error messages to extract required balance, lookup token decimals (USDC, XLM, XRP) to format amounts, and display precise toast error messages on failure.
Liquidity hook behavior
packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts
Changed catch block to throw a new Error instead of returning false, propagating errors upward.
Display precision
packages/app/src/widgets/market-section/components/market-card/market-card.tsx
Removed Math.floor on totalSupplied and availableToBorrow to preserve decimal values in tooltips and summaries.
Landing FAQ removal
packages/landing/src/widgets/landing/components/question-section/question-section.tsx
Removed the "Where can I get more info?" FAQ (and its Discord reference), reducing FAQ items; NOTION_LINK import remains.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as Component
    participant Hook as use-lend-increase
    participant Send as Send Operation
    participant Toast as ToasterContainer

    User->>UI: Initiate lend
    UI->>Hook: call lendIncrease()
    Hook->>Hook: get token decimals (USDC/XLM/XRP)
    Hook->>Send: send transaction

    alt success
        Send-->>Hook: success
        Hook-->>UI: return success
    else failure
        Send-->>Hook: error with message
        Hook->>Hook: parse message for required balance
        Hook->>Hook: format amount using token decimals
        Hook->>Toast: show error toast (formatted)
        Hook-->>UI: throw/propagate error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay extra attention to:
    • use-lend-increase.tsx: error parsing regex/logic and token-decimal mapping correctness.
    • use-liquidity.ts: verify callers expect propagated errors.
    • ToasterContainer placement and server/client boundaries in layout.tsx.

Suggested reviewers

  • artur-abliazimov
  • mikolajsobolewski

Poem

🐰 A little hop for cleaner logs and cheer,
I bring a toast that users soon will hear.
Numbers now truthful, errors neatly shown,
A baker’s bite of clarity has grown.
Hooray — small fixes, big smiles, from this rabbit’s burrow near!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fix wallet' is too vague and does not accurately reflect the primary changes in this PR, which involve adding toast notifications and improving error handling across multiple features. Use a more descriptive title that captures the main objective, such as 'Add toast error notifications and improve error handling in liquidity flows' or 'Integrate react-toastify for better error messaging'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-wallet

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1b2e02 and b1f7438.

📒 Files selected for processing (1)
  • packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fb29f2 and c1b2e02.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • packages/app/package.json (1 hunks)
  • packages/app/src/app/layout.tsx (2 hunks)
  • packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx (4 hunks)
  • packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts (1 hunks)
  • packages/app/src/global/providers/toaster-container.tsx (1 hunks)
  • packages/app/src/widgets/market-section/components/market-card/market-card.tsx (1 hunks)
  • packages/landing/src/widgets/landing/components/question-section/question-section.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/app/src/app/layout.tsx (1)
packages/app/src/global/providers/toaster-container.tsx (1)
  • ToasterContainer (6-21)
packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx (2)
packages/app/src/features/liquidity-flow/hooks/use-token-info.ts (1)
  • useTokenInfo (8-42)
packages/app/src/features/liquidity-flow/soroban/get-cell-by-position-update.tsx (1)
  • getCellByPositionUpdate (5-9)
🪛 GitHub Actions: TESTS
packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts

[error] 55-55: Type error: No overload matches this call. Overload 1/2 expect a string or undefined for Error constructor, but argument has type 'unknown'. Ensure the caught error is properly typed or convert to string before throwing.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-build-image (app)
  • GitHub Check: test-build-image (landing)

@Artem1211 Artem1211 merged commit 711df11 into main Nov 12, 2025
7 checks passed
@Artem1211 Artem1211 deleted the fix-wallet branch November 12, 2025 07:40
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.

3 participants