Skip to content

feat: new landing page#170

Merged
antoncoding merged 11 commits intomasterfrom
feat/launch-prep
Nov 2, 2025
Merged

feat: new landing page#170
antoncoding merged 11 commits intomasterfrom
feat/launch-prep

Conversation

@antoncoding
Copy link
Owner

@antoncoding antoncoding commented Nov 2, 2025

Summary by CodeRabbit

  • New Features

    • New landing page with multi-section hero, CTAs, theming, and dynamic typing animation
    • New rebalance token-slot animation component
  • Bug Fixes

    • Improved loading state handling across data-fetching hooks
    • Several UI banners now wait for data to finish loading before appearing
  • Refactor

    • Removed legacy info content and consolidated home/info/risk navigation
    • Centralized USD-based market filtering and added USD liquidity threshold support
  • Chores

    • Added runtime animation libraries for client-side effects

@vercel
Copy link
Contributor

vercel bot commented Nov 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
monarch Ready Ready Preview Comment Nov 2, 2025 7:13am

@coderabbitai
Copy link

coderabbitai bot commented Nov 2, 2025

📝 Walkthrough

Walkthrough

Replaces prior home/info pages with a new client-side HomePage and typing animation, adds a RebalanceAnimation, removes several info modules, centralizes USD threshold parsing and market filters, updates routing/risk links, adds animation deps, and aligns loading flags across multiple data-fetching hooks. (50 words)

Changes

Cohort / File(s) Change Summary
New landing + typing
app/HomePage.tsx
Added a client-side HomePage with hero, CustomTypingAnimation (typing/rewriting, per-word color, caret), theme-aware assets, CTAs and multi-section content; default export added.
New animation component
src/components/animations/RebalanceAnimation.tsx
Added RebalanceAnimation: three-slot token spin/slide UI driven by a 3s interval that randomly spins slots and commits a next index; default export added.
Removed home/info UI
app/home/HomePage.tsx, app/info/page.tsx, app/info/components/info.tsx, app/info/components/sectionData.tsx
Deleted previous home and info modules (stateful/interval-driven banners, swipe/keyboard info viewer, Card and sections exports).
Routing & risk link updates
app/page.tsx, app/risks/page.tsx, app/risks/RiskContent.tsx, src/components/RiskNotificationModal.tsx
Updated HomePage import path; renamed RiskPageRiskContent and updated imports; changed route/link targets from /info and /info/risks to / and /risks.
Market threshold & filters
src/utils/markets.ts, src/utils/marketFilters.ts, src/constants/markets.ts, src/utils/storageKeys.ts
Added parseNumericThreshold, new composable market filters/sorting (marketFilters.ts), DEFAULT_MIN_LIQUIDITY_USD, and new storage keys for USD filter enables/liquidity.
Markets UI & modal wiring
app/markets/components/markets.tsx, app/markets/components/MarketSettingsModal.tsx, src/components/common/MarketsTableWithSameLoanAsset.tsx
Centralized USD filters (minSupply/minBorrow/minLiquidity), added minLiquidity state and enabled flags; updated sorting to use shared sort utilities; extended MarketSettingsModal props to toggle each USD filter.
Loading-state fixes across hooks
src/hooks/useVaultV2Data.ts, src/hooks/useMorphoMarketV1Adapters.ts, src/hooks/useAllocations.ts
Initialize loading=true, set loading true at fetch start, explicitly set false on early exits; useAllocations adds capsKey memo to trigger reloads.
Vault UI guards
app/autovault/[chainId]/[vaultAddress]/content.tsx
Added vaultDataLoading guards so three banners render only after vault data finishes loading.
Risk content rename
app/risks/RiskContent.tsx, app/risks/page.tsx
Renamed component/file and adjusted import paths; link text updated to point to home.
Removed info content & metadata
app/info/*
Removed Info page and related components/section data and metadata export.
Dependencies
package.json
Added animejs (^4.2.2) and react-type-animation (^3.2.0) for animations.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant HomePage
  participant TypingAnim as CustomTypingAnimation
  participant Rebalance as RebalanceAnimation
  participant Theme

  Browser->>HomePage: mount
  HomePage->>Theme: resolve theme & assets
  HomePage->>TypingAnim: mount (phrases)
  Note over TypingAnim: interval-driven typing/rewriting\n(per-phrase timers, caret)
  TypingAnim-->>HomePage: render updates
  HomePage->>Rebalance: mount
  Note over Rebalance: 3s interval randomly selects\n1–3 slots to spin, animate nextIndex, then commit
  Rebalance-->>HomePage: animated slots render
  Browser->>HomePage: user scroll / CTA click
  HomePage->>Browser: scroll-to-section / navigation
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Focus review on animation interval lifecycle and cleanup in app/HomePage.tsx and src/components/animations/RebalanceAnimation.tsx.
  • Verify new market filter/sort implementations in src/utils/marketFilters.ts and their usage in app/markets/components/markets.tsx and MarketsTableWithSameLoanAsset.tsx.
  • Check loading-state transitions and early-exit paths in useVaultV2Data, useMorphoMarketV1Adapters, and useAllocations.
  • Confirm routing updates and that removed info modules have no remaining callers.

Possibly related PRs

Poem

✨ A typing hero greets the page,

Token slots spin on a tiny stage.
Old info gone, new filters bloom,
Routes redirected, loaders tuned.
🎉

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 title "feat: new landing page" accurately describes the primary objective of this pull request. The changeset centers on introducing a new app/HomePage.tsx component that implements a comprehensive landing page with a hero section, animated typing effects, CTAs, and multiple content sections. Supporting changes include removing the old app/home/HomePage.tsx and associated info pages, updating imports in app/page.tsx, and adding animation dependencies. While the PR includes significant refactoring of market filters and other utilities, these are secondary to the main feature of delivering a new landing page. The title is specific, concise, and clearly communicates the primary change without vague language.
✨ 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 feat/launch-prep

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: 1

Caution

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

⚠️ Outside diff range comments (1)
app/autovault/[chainId]/[vaultAddress]/content.tsx (1)

191-191: Change line 191 to use vault.vaultDataLoading for consistency.

The "Start setup" button uses vault.isLoading while the Refresh button (line 154), the banner conditions (lines 178, 198, 218), and all other components (lines 273, 284, 296, 324) use vault.vaultDataLoading. Since the button only opens a modal and the banner is already gated by vault data loading state, it should align with the rest of the component:

isDisabled={vault.vaultDataLoading}
🧹 Nitpick comments (1)
src/components/common/MarketsTableWithSameLoanAsset.tsx (1)

498-498: Memoize effectiveMinSupply.

Since effectiveMinSupply is used in the processedMarkets dependency array (line 665), wrap it in useMemo to prevent unnecessary recomputation of processedMarkets when unrelated state changes.

Based on coding guidelines.

-  const effectiveMinSupply = parseNumericThreshold(usdFilters.minSupply);
+  const effectiveMinSupply = useMemo(
+    () => parseNumericThreshold(usdFilters.minSupply),
+    [usdFilters.minSupply]
+  );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8221ba1 and d6be423.

⛔ Files ignored due to path filters (4)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/imgs/intro/morpho-logo-darkmode.svg is excluded by !**/*.svg
  • src/imgs/intro/morpho-logo-lightmode.svg is excluded by !**/*.svg
  • src/imgs/intro/vaults.png is excluded by !**/*.png
📒 Files selected for processing (18)
  • app/HomePage.tsx (1 hunks)
  • app/autovault/[chainId]/[vaultAddress]/content.tsx (3 hunks)
  • app/home/HomePage.tsx (0 hunks)
  • app/info/components/info.tsx (0 hunks)
  • app/info/components/sectionData.tsx (0 hunks)
  • app/info/page.tsx (0 hunks)
  • app/markets/components/markets.tsx (2 hunks)
  • app/page.tsx (1 hunks)
  • app/risks/RiskContent.tsx (3 hunks)
  • app/risks/page.tsx (1 hunks)
  • package.json (2 hunks)
  • src/components/RiskNotificationModal.tsx (4 hunks)
  • src/components/animations/RebalanceAnimation.tsx (1 hunks)
  • src/components/common/MarketsTableWithSameLoanAsset.tsx (3 hunks)
  • src/hooks/useAllocations.ts (2 hunks)
  • src/hooks/useMorphoMarketV1Adapters.ts (2 hunks)
  • src/hooks/useVaultV2Data.ts (1 hunks)
  • src/utils/markets.ts (1 hunks)
💤 Files with no reviewable changes (4)
  • app/info/page.tsx
  • app/info/components/sectionData.tsx
  • app/info/components/info.tsx
  • app/home/HomePage.tsx
🧰 Additional context used
📓 Path-based instructions (14)
src/components/**

📄 CodeRabbit inference engine (AGENTS.md)

Place UI components under src/components/

Files:

  • src/components/RiskNotificationModal.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/components/animations/RebalanceAnimation.tsx
**/*.{ts,tsx,js,jsx,css,md,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Prettier via pnpm format with the repository profile (100-char width, 2-space indent, single quotes, trailing commas, Tailwind-aware ordering)

Files:

  • src/components/RiskNotificationModal.tsx
  • src/hooks/useVaultV2Data.ts
  • app/HomePage.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/risks/page.tsx
  • package.json
  • src/utils/markets.ts
  • src/hooks/useAllocations.ts
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
  • src/components/animations/RebalanceAnimation.tsx
  • src/hooks/useMorphoMarketV1Adapters.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Adhere to ESLint (Airbnb + Next.js) rules for hook safety and import hygiene

Files:

  • src/components/RiskNotificationModal.tsx
  • src/hooks/useVaultV2Data.ts
  • app/HomePage.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/risks/page.tsx
  • src/utils/markets.ts
  • src/hooks/useAllocations.ts
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
  • src/components/animations/RebalanceAnimation.tsx
  • src/hooks/useMorphoMarketV1Adapters.ts
src/components/**/[A-Z][A-Za-z0-9]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase filenames for React components (e.g., VaultBanner.tsx)

Files:

  • src/components/RiskNotificationModal.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/components/animations/RebalanceAnimation.tsx
{app,src/components}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Keep Tailwind class lists purposeful and lean; consolidate repeating patterns with tailwind-merge

Files:

  • src/components/RiskNotificationModal.tsx
  • app/HomePage.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/risks/page.tsx
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
  • src/components/animations/RebalanceAnimation.tsx
{app,src}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

When using the shared Spinner component, pass numeric pixel values to size (e.g., size={12}), not semantic strings

Files:

  • src/components/RiskNotificationModal.tsx
  • app/HomePage.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/risks/page.tsx
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
  • src/components/animations/RebalanceAnimation.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not define utility/business logic inside components; extract to src/utils/

Files:

  • src/components/RiskNotificationModal.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/components/animations/RebalanceAnimation.tsx
{src/hooks/**/*.ts,src/hooks/**/*.tsx,src/components/**/*.tsx,app/**/*.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Memoize arrays/objects passed to hooks that trigger network requests (or pass a stable key) to avoid unnecessary re-fetches and effect retriggers

Files:

  • src/components/RiskNotificationModal.tsx
  • src/hooks/useVaultV2Data.ts
  • app/HomePage.tsx
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/risks/page.tsx
  • src/hooks/useAllocations.ts
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
  • src/components/animations/RebalanceAnimation.tsx
  • src/hooks/useMorphoMarketV1Adapters.ts
src/hooks/**

📄 CodeRabbit inference engine (AGENTS.md)

Place React hooks under src/hooks/

Files:

  • src/hooks/useVaultV2Data.ts
  • src/hooks/useAllocations.ts
  • src/hooks/useMorphoMarketV1Adapters.ts
src/hooks/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not define utility/business logic inside hooks; extract to src/utils/

Files:

  • src/hooks/useVaultV2Data.ts
  • src/hooks/useAllocations.ts
  • src/hooks/useMorphoMarketV1Adapters.ts
src/hooks/use*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

For new on-chain hooks, mirror useERC20Approval/useTransactionWithToast patterns: compute context early, reuse useTransactionWithToast, and expose a minimal surface ({ action, isLoading }) with refetch callbacks

Files:

  • src/hooks/useVaultV2Data.ts
  • src/hooks/useAllocations.ts
  • src/hooks/useMorphoMarketV1Adapters.ts
app/**

📄 CodeRabbit inference engine (AGENTS.md)

Place Next.js route files under app/

Files:

  • app/HomePage.tsx
  • app/risks/page.tsx
  • app/autovault/[chainId]/[vaultAddress]/content.tsx
  • app/markets/components/markets.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
src/utils/**

📄 CodeRabbit inference engine (AGENTS.md)

Place reusable utility functions under src/utils/

Files:

  • src/utils/markets.ts
src/utils/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/utils/**/*.{ts,tsx}: Use camelCase for helper function names (e.g., formatApr)
Keep utilities pure and reusable; host business/utility logic in src/utils/

Files:

  • src/utils/markets.ts
🧠 Learnings (6)
📚 Learning: 2024-11-25T09:39:42.148Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 87
File: app/home/HomePage.tsx:17-39
Timestamp: 2024-11-25T09:39:42.148Z
Learning: In `app/home/HomePage.tsx`, the `useEffect` hook depends on `[showCustomized]` because changing `showCustomized` triggers updates to the yield and risk terms.

Applied to files:

  • src/components/RiskNotificationModal.tsx
  • app/HomePage.tsx
  • app/risks/page.tsx
  • app/page.tsx
  • app/risks/RiskContent.tsx
📚 Learning: 2024-10-12T09:23:16.495Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 63
File: app/markets/components/MarketRowDetail.tsx:49-52
Timestamp: 2024-10-12T09:23:16.495Z
Learning: When rendering oracle feeds in `ExpandedMarketDetail` (`app/markets/components/MarketRowDetail.tsx`), prefer explicit rendering over iterating keys when dealing with a small number of feeds.

Applied to files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
📚 Learning: 2025-10-24T16:25:14.182Z
Learnt from: CR
Repo: antoncoding/monarch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-24T16:25:14.182Z
Learning: Applies to {src/hooks/**/*.ts,src/hooks/**/*.tsx,src/components/**/*.tsx,app/**/*.tsx} : Memoize arrays/objects passed to hooks that trigger network requests (or pass a stable key) to avoid unnecessary re-fetches and effect retriggers

Applied to files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/markets/components/markets.tsx
📚 Learning: 2025-10-24T16:25:14.182Z
Learnt from: CR
Repo: antoncoding/monarch PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-24T16:25:14.182Z
Learning: Applies to src/hooks/use*.{ts,tsx} : For new on-chain hooks, mirror `useERC20Approval`/`useTransactionWithToast` patterns: compute context early, reuse `useTransactionWithToast`, and expose a minimal surface (`{ action, isLoading }`) with refetch callbacks

Applied to files:

  • app/markets/components/markets.tsx
📚 Learning: 2024-12-16T02:01:51.219Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 97
File: app/positions/components/onboarding/OnboardingContext.tsx:36-43
Timestamp: 2024-12-16T02:01:51.219Z
Learning: In `app/positions/components/onboarding/OnboardingContext.tsx`, the `defaultStep` variable is no longer needed and can be removed.

Applied to files:

  • app/risks/RiskContent.tsx
📚 Learning: 2024-10-07T14:38:04.384Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 57
File: src/hooks/useRebalance.ts:112-114
Timestamp: 2024-10-07T14:38:04.384Z
Learning: In `src/hooks/useRebalance.ts`, adding a delay is necessary because Rabby wallet cannot handle sequential requests.

Applied to files:

  • src/components/animations/RebalanceAnimation.tsx
🧬 Code graph analysis (4)
app/HomePage.tsx (3)
src/components/common/Button.tsx (1)
  • Button (4-54)
src/components/common/Badge.tsx (1)
  • Badge (31-33)
src/utils/external.ts (1)
  • EXTERNAL_LINKS (45-49)
src/components/common/MarketsTableWithSameLoanAsset.tsx (2)
src/utils/markets.ts (1)
  • parseNumericThreshold (7-18)
src/utils/balance.ts (1)
  • formatReadable (25-46)
app/markets/components/markets.tsx (1)
src/utils/markets.ts (1)
  • parseNumericThreshold (7-18)
app/page.tsx (2)
app/risks/page.tsx (1)
  • metadata (4-9)
app/autovault/[chainId]/[vaultAddress]/page.tsx (1)
  • generateMetadata (5-18)
🔇 Additional comments (10)
app/autovault/[chainId]/[vaultAddress]/content.tsx (1)

177-238: Loading guards correctly prevent premature banner display.

The !vault.vaultDataLoading conditions ensure the setup banners only appear after vault data is fetched, avoiding false positives during initial load.

package.json (1)

45-45: LGTM!

Animation dependencies added to support the new landing page features.

Also applies to: 66-66

src/hooks/useVaultV2Data.ts (1)

55-55: LGTM!

Loading state lifecycle improved: initializes to true, resets to false on early exit, and properly manages loading during fetch operations. Consistent with the pattern applied across other hooks in this PR.

Also applies to: 61-61, 65-66

src/utils/markets.ts (1)

1-18: LGTM!

Clean utility function with clear documentation and defensive handling of edge cases. Centralizes threshold parsing logic that was previously duplicated.

src/components/common/MarketsTableWithSameLoanAsset.tsx (1)

15-15: LGTM!

Successfully replaced local threshold parsing with the centralized parseNumericThreshold utility. Display formatting with formatReadable is cleaner than the previous toLocaleString approach.

Also applies to: 498-498, 753-753

src/components/RiskNotificationModal.tsx (1)

23-23: LGTM!

Route references consistently updated from /info* paths to root (/) and /risks. Modal logic correctly prevents display on the landing page and risk assessment page.

Also applies to: 35-35, 50-51, 68-68

src/hooks/useMorphoMarketV1Adapters.ts (1)

15-15: LGTM!

Loading state lifecycle improved with the same pattern applied across other hooks in this PR. Initializes to true, resets on early exit, and properly manages state during fetch operations.

Also applies to: 33-33, 37-38

src/hooks/useAllocations.ts (2)

34-34: LGTM!

Loading state lifecycle improved consistently with other hooks in this PR.

Also applies to: 45-45, 49-50


38-40: Good optimization with capsKey.

Using a stable capsKey derived from cap IDs prevents unnecessary refetches when the caps array reference changes but content remains the same. Aligns with the coding guideline to avoid effect retriggers from unstable dependencies.

Based on learnings.

Also applies to: 77-77

app/risks/RiskContent.tsx (1)

53-53: LGTM!

Component renamed to RiskContent and navigation updated to point to the root home page. Consistent with the broader routing changes in this PR.

Also applies to: 94-94, 63-64

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

🧹 Nitpick comments (3)
src/components/animations/RebalanceAnimation.tsx (3)

14-17: Replace any with StaticImageData.

Import and use StaticImageData from next/image for proper type safety with imported images.

 import { useState, useEffect } from 'react';
-import Image from 'next/image';
+import Image, { type StaticImageData } from 'next/image';

 // Import token images
 ...
 type Token = {
   name: string;
-  image: any;
+  image: StaticImageData;
 };

43-43: Move SLOT_COUNT outside the interval callback.

Defining SLOT_COUNT inside the interval callback recreates it every 3 seconds. Extract it as a top-level constant for efficiency.

+const SLOT_COUNT = 4;
+
 function RebalanceAnimation() {
   const [slots, setSlots] = useState<SlotState[]>([
   ...
   useEffect(() => {
     const interval = setInterval(() => {
-      const SLOT_COUNT = 4
-
       // Randomly decide how many slots to change (1-3)

102-108: Remove unnecessary type casting.

Next.js Image accepts StaticImageData directly. The as string casts are unnecessary and can hide type errors.

           <Image
-            src={tokens[slot.currentIndex].image as string}
+            src={tokens[slot.currentIndex].image}
             alt={tokens[slot.currentIndex].name}
             width={40}
             height={40}
             className="h-8 w-8 object-contain sm:h-9 sm:w-9"
           />
         </div>
         {/* Next token - slides up from bottom when spinning */}
         <div
           className={`absolute inset-0 flex items-center justify-center ${
             slot.isSpinning ? 'transition-transform duration-500 ease-in-out translate-y-0' : 'translate-y-full'
           }`}
         >
           <Image
-            src={tokens[slot.nextIndex].image as string}
+            src={tokens[slot.nextIndex].image}
             alt={tokens[slot.nextIndex].name}

Also applies to: 116-122

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6be423 and 88b0690.

📒 Files selected for processing (1)
  • src/components/animations/RebalanceAnimation.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
src/components/**

📄 CodeRabbit inference engine (AGENTS.md)

Place UI components under src/components/

Files:

  • src/components/animations/RebalanceAnimation.tsx
**/*.{ts,tsx,js,jsx,css,md,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Prettier via pnpm format with the repository profile (100-char width, 2-space indent, single quotes, trailing commas, Tailwind-aware ordering)

Files:

  • src/components/animations/RebalanceAnimation.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Adhere to ESLint (Airbnb + Next.js) rules for hook safety and import hygiene

Files:

  • src/components/animations/RebalanceAnimation.tsx
src/components/**/[A-Z][A-Za-z0-9]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase filenames for React components (e.g., VaultBanner.tsx)

Files:

  • src/components/animations/RebalanceAnimation.tsx
{app,src/components}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Keep Tailwind class lists purposeful and lean; consolidate repeating patterns with tailwind-merge

Files:

  • src/components/animations/RebalanceAnimation.tsx
{app,src}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

When using the shared Spinner component, pass numeric pixel values to size (e.g., size={12}), not semantic strings

Files:

  • src/components/animations/RebalanceAnimation.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not define utility/business logic inside components; extract to src/utils/

Files:

  • src/components/animations/RebalanceAnimation.tsx
{src/hooks/**/*.ts,src/hooks/**/*.tsx,src/components/**/*.tsx,app/**/*.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Memoize arrays/objects passed to hooks that trigger network requests (or pass a stable key) to avoid unnecessary re-fetches and effect retriggers

Files:

  • src/components/animations/RebalanceAnimation.tsx
🧠 Learnings (1)
📚 Learning: 2024-10-07T14:38:04.384Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 57
File: src/hooks/useRebalance.ts:112-114
Timestamp: 2024-10-07T14:38:04.384Z
Learning: In `src/hooks/useRebalance.ts`, adding a delay is necessary because Rabby wallet cannot handle sequential requests.

Applied to files:

  • src/components/animations/RebalanceAnimation.tsx

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88b0690 and c0f4ab0.

📒 Files selected for processing (7)
  • app/markets/components/MarketSettingsModal.tsx (3 hunks)
  • app/markets/components/markets.tsx (7 hunks)
  • src/components/animations/RebalanceAnimation.tsx (1 hunks)
  • src/components/common/MarketsTableWithSameLoanAsset.tsx (6 hunks)
  • src/constants/markets.ts (1 hunks)
  • src/utils/marketFilters.ts (1 hunks)
  • src/utils/storageKeys.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/animations/RebalanceAnimation.tsx
🧰 Additional context used
📓 Path-based instructions (13)
src/constants/**

📄 CodeRabbit inference engine (AGENTS.md)

Place shared constants under src/constants/

Files:

  • src/constants/markets.ts
**/*.{ts,tsx,js,jsx,css,md,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run Prettier via pnpm format with the repository profile (100-char width, 2-space indent, single quotes, trailing commas, Tailwind-aware ordering)

Files:

  • src/constants/markets.ts
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/utils/storageKeys.ts
  • app/markets/components/MarketSettingsModal.tsx
  • src/utils/marketFilters.ts
  • app/markets/components/markets.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Adhere to ESLint (Airbnb + Next.js) rules for hook safety and import hygiene

Files:

  • src/constants/markets.ts
  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/utils/storageKeys.ts
  • app/markets/components/MarketSettingsModal.tsx
  • src/utils/marketFilters.ts
  • app/markets/components/markets.tsx
src/constants/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use SCREAMING_SNAKE_CASE for shared constants

Files:

  • src/constants/markets.ts
src/components/**

📄 CodeRabbit inference engine (AGENTS.md)

Place UI components under src/components/

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
src/components/**/[A-Z][A-Za-z0-9]*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase filenames for React components (e.g., VaultBanner.tsx)

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
{app,src/components}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Keep Tailwind class lists purposeful and lean; consolidate repeating patterns with tailwind-merge

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/markets/components/MarketSettingsModal.tsx
  • app/markets/components/markets.tsx
{app,src}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

When using the shared Spinner component, pass numeric pixel values to size (e.g., size={12}), not semantic strings

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/markets/components/MarketSettingsModal.tsx
  • app/markets/components/markets.tsx
src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not define utility/business logic inside components; extract to src/utils/

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
{src/hooks/**/*.ts,src/hooks/**/*.tsx,src/components/**/*.tsx,app/**/*.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Memoize arrays/objects passed to hooks that trigger network requests (or pass a stable key) to avoid unnecessary re-fetches and effect retriggers

Files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/markets/components/MarketSettingsModal.tsx
  • app/markets/components/markets.tsx
src/utils/**

📄 CodeRabbit inference engine (AGENTS.md)

Place reusable utility functions under src/utils/

Files:

  • src/utils/storageKeys.ts
  • src/utils/marketFilters.ts
src/utils/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/utils/**/*.{ts,tsx}: Use camelCase for helper function names (e.g., formatApr)
Keep utilities pure and reusable; host business/utility logic in src/utils/

Files:

  • src/utils/storageKeys.ts
  • src/utils/marketFilters.ts
app/**

📄 CodeRabbit inference engine (AGENTS.md)

Place Next.js route files under app/

Files:

  • app/markets/components/MarketSettingsModal.tsx
  • app/markets/components/markets.tsx
🧠 Learnings (2)
📚 Learning: 2024-10-12T09:23:16.495Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 63
File: app/markets/components/MarketRowDetail.tsx:49-52
Timestamp: 2024-10-12T09:23:16.495Z
Learning: When rendering oracle feeds in `ExpandedMarketDetail` (`app/markets/components/MarketRowDetail.tsx`), prefer explicit rendering over iterating keys when dealing with a small number of feeds.

Applied to files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • src/utils/storageKeys.ts
  • app/markets/components/markets.tsx
📚 Learning: 2024-11-25T09:39:42.148Z
Learnt from: antoncoding
Repo: antoncoding/monarch PR: 87
File: app/home/HomePage.tsx:17-39
Timestamp: 2024-11-25T09:39:42.148Z
Learning: In `app/home/HomePage.tsx`, the `useEffect` hook depends on `[showCustomized]` because changing `showCustomized` triggers updates to the yield and risk terms.

Applied to files:

  • src/components/common/MarketsTableWithSameLoanAsset.tsx
  • app/markets/components/markets.tsx
🧬 Code graph analysis (4)
src/components/common/MarketsTableWithSameLoanAsset.tsx (5)
src/hooks/useLocalStorage.ts (1)
  • useLocalStorage (4-78)
src/constants/markets.ts (1)
  • DEFAULT_MIN_LIQUIDITY_USD (2-2)
src/utils/markets.ts (1)
  • parseNumericThreshold (7-18)
src/utils/marketFilters.ts (3)
  • filterMarkets (260-309)
  • sortMarkets (322-328)
  • createPropertySort (343-364)
src/utils/balance.ts (1)
  • formatReadable (25-46)
app/markets/components/MarketSettingsModal.tsx (1)
src/components/Input/Input.tsx (1)
  • Input (17-97)
src/utils/marketFilters.ts (4)
src/utils/types.ts (1)
  • Market (268-315)
src/utils/tokens.ts (2)
  • ERC20Token (19-32)
  • findToken (714-714)
src/utils/oracle.ts (2)
  • parsePriceFeedVendors (255-340)
  • getOracleType (233-253)
src/utils/markets.ts (1)
  • parseNumericThreshold (7-18)
app/markets/components/markets.tsx (5)
src/hooks/useLocalStorage.ts (1)
  • useLocalStorage (4-78)
src/constants/markets.ts (2)
  • DEFAULT_MIN_SUPPLY_USD (1-1)
  • DEFAULT_MIN_LIQUIDITY_USD (2-2)
src/utils/markets.ts (1)
  • parseNumericThreshold (7-18)
src/utils/marketFilters.ts (4)
  • filterMarkets (260-309)
  • sortMarkets (322-328)
  • createStarredSort (369-377)
  • createPropertySort (343-364)
src/utils/types.ts (1)
  • Market (268-315)

Comment on lines +247 to +258
const sortPropertyMap: Record<SortColumn, string> = {
[SortColumn.Starred]: 'uniqueKey',
[SortColumn.LoanAsset]: 'loanAsset.name',
[SortColumn.CollateralAsset]: 'collateralAsset.name',
[SortColumn.LLTV]: 'lltv',
[SortColumn.Supply]: 'state.supplyAssetsUsd',
[SortColumn.Borrow]: 'state.borrowAssetsUsd',
[SortColumn.SupplyAPY]: 'state.supplyApy',
};
const propertyPath = sortPropertyMap[sortColumn];
if (propertyPath) {
sorted = sortMarkets(filtered, createPropertySort(propertyPath), sortDirection as 1 | -1);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix Loan/Collateral sort keys

Sorting by the Loan Asset or Collateral columns never changes the order because both property paths resolve to undefined. Our token objects expose symbol (see how MarketsTableWithSameLoanAsset maps to collateralAsset.symbol), so the comparator always returns 0 and the sort column is broken. Point these entries at .symbol instead.

Apply this diff:

-        [SortColumn.LoanAsset]: 'loanAsset.name',
-        [SortColumn.CollateralAsset]: 'collateralAsset.name',
+        [SortColumn.LoanAsset]: 'loanAsset.symbol',
+        [SortColumn.CollateralAsset]: 'collateralAsset.symbol',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const sortPropertyMap: Record<SortColumn, string> = {
[SortColumn.Starred]: 'uniqueKey',
[SortColumn.LoanAsset]: 'loanAsset.name',
[SortColumn.CollateralAsset]: 'collateralAsset.name',
[SortColumn.LLTV]: 'lltv',
[SortColumn.Supply]: 'state.supplyAssetsUsd',
[SortColumn.Borrow]: 'state.borrowAssetsUsd',
[SortColumn.SupplyAPY]: 'state.supplyApy',
};
const propertyPath = sortPropertyMap[sortColumn];
if (propertyPath) {
sorted = sortMarkets(filtered, createPropertySort(propertyPath), sortDirection as 1 | -1);
const sortPropertyMap: Record<SortColumn, string> = {
[SortColumn.Starred]: 'uniqueKey',
[SortColumn.LoanAsset]: 'loanAsset.symbol',
[SortColumn.CollateralAsset]: 'collateralAsset.symbol',
[SortColumn.LLTV]: 'lltv',
[SortColumn.Supply]: 'state.supplyAssetsUsd',
[SortColumn.Borrow]: 'state.borrowAssetsUsd',
[SortColumn.SupplyAPY]: 'state.supplyApy',
};
const propertyPath = sortPropertyMap[sortColumn];
if (propertyPath) {
sorted = sortMarkets(filtered, createPropertySort(propertyPath), sortDirection as 1 | -1);
🤖 Prompt for AI Agents
In app/markets/components/markets.tsx around lines 247 to 258 the
sortPropertyMap entries for SortColumn.LoanAsset and SortColumn.CollateralAsset
point to 'loanAsset.name' and 'collateralAsset.name' which resolve to undefined
on our token objects; update those two entries to use the token symbol paths
('loanAsset.symbol' and 'collateralAsset.symbol') so the comparator sees a valid
property and sorting works as expected.

@antoncoding antoncoding merged commit e96431e into master Nov 2, 2025
4 checks passed
@antoncoding antoncoding deleted the feat/launch-prep branch November 2, 2025 07:26
This was referenced Nov 4, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 13, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 8, 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.

1 participant