Skip to content

Conversation

@DanielSchiavini
Copy link
Collaborator

@DanielSchiavini DanielSchiavini commented Dec 3, 2025

This change is to merge the loan creation and manage pages for all lend markets

  • until now we had different URLs for creating and managing a loan
  • that meant if you landed in the wrong page you might see a totally wrong image of your loan
  • there were redirects in place from one to the other, but these were complex and buggy
  • instead, we now just look at your wallet, if you have an open loan the page reacts to it, no redirects necessary
  • less complexity, less bugs, less urls, less redirects, less code 🙏 but no change in functionality for the users
  • similar refactor: merge mint create and manage loan pages #1749
  • depends on refactor: form tabs #1747

@vercel
Copy link

vercel bot commented Dec 3, 2025

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

Project Deployment Review Updated (UTC)
curve-dapp Ready Ready Preview, Comment Dec 17, 2025 1:59pm
curve-dapp-storybook Ready Ready Preview, Comment Dec 17, 2025 1:59pm

@DanielSchiavini DanielSchiavini mentioned this pull request Dec 3, 2025
18 tasks
0xtutti
0xtutti previously approved these changes Dec 3, 2025
Copy link
Collaborator

@0xPearce 0xPearce left a comment

Choose a reason for hiding this comment

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

There are two "Borrow" tabs in Legacy mode. Example WBTC <> crvUSD lend market

Preview curve.finance
Image Image

@0xPearce
Copy link
Collaborator

0xPearce commented Dec 4, 2025

Great refactor! 🙏

Base automatically changed from refactor/routes to main December 4, 2025 16:16
@DanielSchiavini DanielSchiavini dismissed 0xtutti’s stale review December 4, 2025 16:16

The base branch was changed.

0xAlunara
0xAlunara previously approved these changes Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates the loan creation and management pages into a single unified market page, reducing complexity and eliminating bug-prone redirects. The page now dynamically displays create or manage forms based on whether the user has an existing loan.

Key changes:

  • Merged PageLoanCreate and PageLoanManage into a single LendMarketPage component
  • Simplified routing from /create and /manage to a single /markets/$market route with redirects for backwards compatibility
  • Consolidated form types, utilities, and styles from separate page directories into shared PageLendMarket directory
  • Removed complex redirect logic in favor of simple conditional rendering based on loanExists state

Reviewed changes

Copilot reviewed 67 out of 69 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lend.routes.tsx Consolidated routes, added redirects from old /create and /manage URLs to unified market route
constants.ts Updated MARKET_ROUTES to use empty string for PAGE_LOAN instead of separate create/manage routes
utilsRouter.ts Replaced getLoanCreatePathname and getLoanManagePathname with single getLoanPathname
helpers.ts Removed _showNoLoanFound helper (logic now handled in component)
lend.types.ts Added FormStatus type definition for shared use across components
PageLendMarket/LendMarketPage.tsx New unified page component that conditionally renders create or manage tabs based on loan existence
PageLendMarket/utils.ts Consolidated form utilities and constants from both old pages
PageLendMarket/types.ts Merged type definitions from create and manage pages
PageLendMarket/ManageLoanTabs.tsx Updated to receive position details as props instead of computing soft liquidation state
PageLendMarket/LoanCreateTabs.tsx Moved from old PageLoanCreate with updated imports
PageLendMarket/LoanFormCreate/LoanCreateForm.tsx Refactored to remove loan existence checks and redirect logic
PageLendMarket/Loan* components Updated imports from old PageLoanManage paths to new PageLendMarket paths
components/styles.ts Extracted shared styled components from PageLoanManage for reuse
PageVault/* Updated imports to use new shared types and styles locations
store/* slices Updated imports to reference new PageLendMarket paths
hooks/useMarketDetails.tsx Renamed params from llamma/llammaId to market/marketId for consistency
hooks/useLendPageTitle.ts Made prefix parameter optional for unified page title
BandsComp.tsx Changed to use loanExists boolean instead of separate page prop
MarketInformationComp.tsx Removed page prop, now uses loanExists to determine behavior
Test files Updated URL patterns to match new simplified routes
Comments suppressed due to low confidence (1)

apps/main/src/lend/components/PageLendMarket/LendMarketPage.tsx:168

  • The UserPositionHistory component is being rendered twice when !loanExists:
  1. Inside the NoPosition stack (lines 146-152)
  2. Below the conditional rendering (lines 155-168)

This will cause duplicate position history sections to appear on the page when there's no active loan. The second instance (lines 155-168) should likely only render when loanExists is true.

OnlyJousting
OnlyJousting previously approved these changes Dec 15, 2025
Base automatically changed from revert-1745-revert/refactor/routes to main December 17, 2025 09:09
@DanielSchiavini DanielSchiavini dismissed stale reviews from OnlyJousting and 0xAlunara December 17, 2025 09:09

The base branch was changed.

OnlyJousting
OnlyJousting previously approved these changes Dec 17, 2025
0xPearce
0xPearce previously approved these changes Dec 17, 2025
@DanielSchiavini DanielSchiavini changed the title refactor: merge lend create and manage loan pages refactor: merge lend create and manage loan + vault pages Dec 17, 2025
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.

6 participants