Skip to content

refactor: remove SubscriptionSection component and related API for cl…#165

Merged
Artem1211 merged 2 commits intomainfrom
fix-wallet
Oct 29, 2025
Merged

refactor: remove SubscriptionSection component and related API for cl…#165
Artem1211 merged 2 commits intomainfrom
fix-wallet

Conversation

@Artem1211
Copy link
Collaborator

@Artem1211 Artem1211 commented Oct 29, 2025

…eaner landing page

Summary by CodeRabbit

  • Removed Features

    • Email subscription section and its subscription endpoint have been removed from the landing page.
  • Behavior Changes

    • Borrow modal: debt input minimums and validation thresholds updated; UI may enforce different minimums for separate debt types.
    • Debt calculation: maximum debt computation adjusted, which may change displayed max-debt values.

@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

Walkthrough

Removed the landing page subscription feature (API and UI) and updated debt-related calculations: split currency rates for core/extra debt and changed getMaxDebt’s price usage from division to multiplication.

Changes

Cohort / File(s) Summary
Subscription Section Removal
packages/landing/src/widgets/landing/components/subscription-section/api.ts, packages/landing/src/widgets/landing/components/subscription-section/subscription-section.tsx, packages/landing/src/widgets/landing/landing.tsx
Deleted subscription API (sendEmail) and entire SubscriptionSection component; removed import and usage from landing.tsx.
Borrow Increase Modal — rate separation
packages/app/src/features/liquidity-flow/components/borrow-increase-modal/borrow-increase-modal.tsx
Replaced single currency rate with coreCurrencyRate and extraCurrencyRate; updated minimum-required calculations and related validations to use the appropriate per-token rate variables.
Debt calc fix/change
packages/app/src/features/liquidity-flow/utils/get-max-debt.ts
Changed internal calculation from defaultBorrowCapacity / priceInUsd to defaultBorrowCapacity * priceInUsd (wrapped with toFixed(3) then Number).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as BorrowIncreaseModal UI
  participant Calc as Debt Calculations (getMaxDebt)
  participant Validator as Input Validator

  Note over UI,Calc: User opens modal (existing flow)
  User ->> UI: enter coreDebt, extraDebt
  UI ->> Calc: request max debt (coreCurrencyRate / extraCurrencyRate used)
  Calc -->> UI: computed max values
  UI ->> Validator: validate against minimums (coreMinimum / extraMinimum)
  alt valid
    Validator -->> UI: success -> enable submit
  else invalid
    Validator -->> UI: error -> show messages
  end
Loading

(Highlight: core/extra rate usage and changed getMaxDebt calculation are the primary modifications in this flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to correctness of the new multiplication in get-max-debt.ts (was division previously).
  • Verify all places consuming getMaxDebt still expect its updated semantics.
  • Check borrow-increase-modal for any UI/validation edge cases introduced by separating rates.
  • Ensure no remaining imports reference the removed sendEmail or SubscriptionSection.

Possibly related PRs

Suggested reviewers

  • artur-abliazimov

Poem

🐰 I nibbled lines, then hopped away,

The form is gone, the code feels gay,
Two rates I found for debt to mind,
And numbers fixed — no crumbs behind. 🥕

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "refactor: remove SubscriptionSection component and related API for cleaner landing page" accurately describes a significant portion of the changeset. The changes to the landing page package—specifically the removal of the SubscriptionSection component, its API exports, and its usage in the main Landing component—directly match the title's description. However, the changeset also includes unrelated refactoring work in the liquidity-flow feature (changes to borrow-increase-modal.tsx and get-max-debt.ts) that are not mentioned in the title. These additional changes appear to be in a different package and serve a separate purpose, suggesting the PR may contain mixed concerns.
✨ 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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/app/src/features/liquidity-flow/components/borrow-increase-modal/borrow-increase-modal.tsx (1)

138-143: Fix copy-paste error: use extraValue instead of value for extra debt.

Line 141 incorrectly uses BigNumber(value) for the extra debt token, but it should use BigNumber(extraValue). This bug causes the user's extra debt input to be ignored, setting both core and extra debt to the same core value.

Apply this diff:

     if (showExtraInput && extraDebtTokenName) {
       return {
         ...core,
-        [extraDebtTokenName]: BigNumber(value),
+        [extraDebtTokenName]: BigNumber(extraValue),
       };
     }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b38592c and e9a3057.

📒 Files selected for processing (2)
  • packages/app/src/features/liquidity-flow/components/borrow-increase-modal/borrow-increase-modal.tsx (1 hunks)
  • packages/app/src/features/liquidity-flow/utils/get-max-debt.ts (1 hunks)
⏰ 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). (4)
  • GitHub Check: test-build-image (landing)
  • GitHub Check: test-build-image (app)
  • GitHub Check: test-build-image (landing)
  • GitHub Check: test-build-image (app)

@Artem1211 Artem1211 merged commit 7fb29f2 into main Oct 29, 2025
7 checks passed
@Artem1211 Artem1211 deleted the fix-wallet branch October 29, 2025 13:56
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.

2 participants