Skip to content

fix: projected amounts#443

Merged
antoncoding merged 1 commit intomasterfrom
fix/project-amout
Mar 9, 2026
Merged

fix: projected amounts#443
antoncoding merged 1 commit intomasterfrom
fix/project-amout

Conversation

@antoncoding
Copy link
Copy Markdown
Owner

@antoncoding antoncoding commented Mar 9, 2026

Summary by CodeRabbit

  • Documentation

    • Added guidelines for ensuring preview component integrity with current and projected values.
  • Refactor

    • Enhanced consistency in projected collateral and borrow balance calculations across risk preview components.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
monarch Ready Ready Preview, Comment Mar 9, 2026 5:12am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9681ccef-2f34-42d7-b594-33b6f3649ee7

📥 Commits

Reviewing files that changed from the base of the PR and between 222c86e and 799166a.

📒 Files selected for processing (4)
  • AGENTS.md
  • src/modals/borrow/components/add-collateral-and-borrow.tsx
  • src/modals/borrow/components/withdraw-collateral-and-repay.tsx
  • src/modals/leverage/components/remove-collateral-and-deleverage.tsx

📝 Walkthrough

Walkthrough

The PR adds projected balance props to BorrowPositionRiskCard across multiple modal components and establishes a guideline for separating current and projected state in preview components. Changes propagate projected collateral and borrow amounts without altering control flow or existing logic.

Changes

Cohort / File(s) Summary
Guidelines
AGENTS.md
Added preview prop integrity guideline specifying that position/risk preview components must separate current and projected props using dedicated projected* props.
Borrow Modal Enhancement
src/modals/borrow/components/add-collateral-and-borrow.tsx
Introduced projectedBorrowAssets variable and updated projectedLTV calculation to use it. Propagated projectedCollateralAssets and projectedBorrowAssets to BorrowPositionRiskCard.
Modal Prop Propagation
src/modals/borrow/components/withdraw-collateral-and-repay.tsx, src/modals/leverage/components/remove-collateral-and-deleverage.tsx
Added projectedCollateral and projectedBorrow props to BorrowPositionRiskCard invocations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

ui

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: propagating projected amounts to risk card components across multiple modal files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/project-amout

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.

@coderabbitai coderabbitai Bot added the ui User interface label Mar 9, 2026
@antoncoding antoncoding merged commit 6164c4e into master Mar 9, 2026
4 checks passed
@antoncoding antoncoding deleted the fix/project-amout branch March 9, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui User interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant