Skip to content

feat: add E-mode and Isolation mode tabs to Markets page#5353

Closed
therealemjy wants to merge 2 commits intofeat/v4-phase-3from
feat/markets-e-mode
Closed

feat: add E-mode and Isolation mode tabs to Markets page#5353
therealemjy wants to merge 2 commits intofeat/v4-phase-3from
feat/markets-e-mode

Conversation

@therealemjy
Copy link
Copy Markdown
Member

Jira ticket(s)

VEN-576

Changes

  • add E-mode and Isolation mode tabs to Markets page

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Feb 23, 2026 7:42pm
dapp-testnet Ready Ready Preview Feb 23, 2026 7:42pm
venus.io Ready Ready Preview Feb 23, 2026 7:42pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 6, 2026

🦋 Changeset detected

Latest commit: 646f873

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 6, 2026

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 77.62% 35203 / 45349
🔵 Statements 77.62% 35203 / 45349
🔵 Functions 60.59% 575 / 949
🔵 Branches 72.54% 4305 / 5934
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/components/ButtonGroup/index.tsx 100% 85.71% 100% 100%
apps/evm/src/containers/ConnectWallet/index.tsx 100% 75% 100% 100%
apps/evm/src/containers/SwitchChain/index.tsx 100% 83.33% 100% 100%
apps/evm/src/pages/Market/EModeInfo/AssetSettings/index.tsx 100% 66.66% 100% 100%
apps/evm/src/pages/Markets/index.tsx 93.93% 50% 100% 93.93% 30-32
apps/evm/src/pages/Markets/Tabs/index.tsx 100% 90.9% 50% 100%
apps/evm/src/pages/Markets/Tabs/Controls/index.tsx 100% 66.66% 20% 100%
apps/evm/src/pages/Markets/Tabs/EMode/index.tsx 87.95% 75% 0% 87.95% 49-58, 91
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/index.tsx 100% 87.5% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/EModeGroupCard/index.tsx 100% 80% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/EModeGroupCard/Asset/index.tsx 100% 25% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/index.tsx 98.61% 93.47% 66.66% 98.61% 52-53
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/BlockingPositionModal/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/BlockingPositionModal/BlockingPosition/index.tsx 100% 100% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/HealthFactorUpdate/index.tsx 100% 0% 100% 100%
apps/evm/src/pages/Markets/Tabs/EMode/filterEModeGroups/index.ts 96.96% 92.85% 100% 96.96% 2
apps/evm/src/pages/Markets/Tabs/EMode/useColumns/index.tsx 80.24% 78.57% 63.63% 80.24% 33-34, 47-48, 66-71, 80-85
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts 97.08% 69.56% 100% 97.08% 3, 22, 124
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/getHypotheticalAssetValues/index.ts 100% 85.71% 100% 100%
Generated in workflow #12661 for commit 646f873 by the Vitest Coverage Report Action

@therealemjy
Copy link
Copy Markdown
Member Author

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 23, 2026

Greptile Summary

This PR adds E-mode and Isolation mode tabs to the Markets page, enabling users to view and enable/disable E-mode groups with enhanced borrowing capabilities.

Key Changes:

  • New tab navigation system separating Markets, E-mode, and Isolation mode views
  • E-mode group management with enable/disable functionality and health factor calculations
  • Blocking borrow position detection and user collateral validation
  • Comprehensive filtering by search, paused assets, and user assets
  • Mobile-responsive design with card and table views
  • Complete translation support across 7 languages

Critical Issue:

  • Logic bug in formatEModeGroups/index.ts:127 where bCanBeEnabled incorrectly references variable a instead of b, causing incorrect sorting of E-mode groups

Confidence Score: 3/5

  • This PR contains a critical sorting bug that must be fixed before merging
  • The implementation is well-structured with good test coverage, but the copy-paste error in the sorting logic at formatEModeGroups/index.ts:127 will cause E-mode groups to be sorted incorrectly. This bug could lead to confusing UX where groups that can't be enabled appear in the wrong order. Additionally, there's unused duplicate code in EMode/formatEModeGroups/ that should be cleaned up.
  • apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts requires immediate attention due to sorting bug

Important Files Changed

Filename Overview
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts Formats E-mode groups with user-specific calculations - contains critical sorting bug on line 127
apps/evm/src/pages/Markets/Tabs/index.tsx Main tabs component that separates E-mode and Isolation mode groups - clean implementation
apps/evm/src/pages/Markets/Tabs/EMode/index.tsx E-mode tab component with filtering and controls - well structured
apps/evm/src/pages/Markets/Tabs/EMode/filterEModeGroups/index.ts Filters E-mode groups by search, paused assets, and user assets - properly implemented
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/index.tsx E-mode group header with enable/disable functionality and blocking position handling - solid implementation

Last reviewed commit: 914eccd

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

34 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts Outdated
@therealemjy
Copy link
Copy Markdown
Member Author

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 23, 2026

Greptile Summary

Added E-mode and Isolation mode tabs to the Markets page, allowing users to view and manage efficiency mode groups. The implementation separates isolated pools from standard E-mode groups and provides comprehensive UI for enabling/disabling groups with health factor calculations and blocking position validation.

Key changes:

  • New tabbed interface on Markets page with conditional E-mode and Isolation mode tabs
  • formatEModeGroups utility sorts groups by enabled status, then by eligibility, then by health factor
  • Search and filter controls for assets (search, user assets only, paused assets toggles)
  • Enable/disable/switch functionality with validation for blocking positions and collateral requirements
  • ButtonGroup component enhanced with secondary variant for tab navigation
  • Empty ISOLATION_MODE_DOC_URL constant needs to be populated with documentation link

Confidence Score: 4/5

  • This PR is safe to merge with minor observations
  • The implementation is well-structured with comprehensive tests and proper validation logic. The main concern is the empty documentation URL constant which should be addressed before release, but doesn't affect functionality
  • No files require special attention

Important Files Changed

Filename Overview
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts Formats and sorts E-mode groups with user-specific calculations for health factors and blocking positions
apps/evm/src/pages/Markets/Tabs/index.tsx Main tab component that separates isolated and E-mode groups, includes empty isolation mode doc URL
apps/evm/src/pages/Markets/Tabs/EMode/index.tsx E-mode tab content with search, filters, and sortable E-mode groups
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/index.tsx Header with enable/disable/switch functionality and comprehensive validation logic
apps/evm/src/components/ButtonGroup/index.tsx Added secondary variant to ButtonGroup for tab navigation styling

Last reviewed commit: fd11568

@therealemjy
Copy link
Copy Markdown
Member Author

@greptile I made updates

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 23, 2026

Greptile Summary

Adds E-mode and Isolation mode tabs to the Markets page, enabling users to view and manage efficiency mode groups. The implementation includes comprehensive filtering, sorting, and search functionality, along with proper state management for enabling/disabling E-mode groups.

Key changes:

  • Introduced tabbed navigation on Markets page (Markets/E-mode/Isolation mode)
  • Implemented E-mode group display with asset settings tables for desktop and card views for mobile
  • Added logic to calculate hypothetical health factors and determine E-mode eligibility
  • Refactored ConnectWallet and SwitchChain components to use buttonSize prop instead of small
  • Enhanced ButtonGroup component with variant prop for styling flexibility
  • Included comprehensive test coverage for filtering and sorting logic

The previously reported sorting bug in formatEModeGroups has been fixed (line 127 now correctly references b instead of a).

Confidence Score: 4/5

  • Safe to merge with one minor style improvement suggested
  • Well-structured implementation with comprehensive test coverage. The previously reported sorting bug has been fixed. Only one minor style issue found (unnecessary forEach argument). The complex logic for E-mode group calculations appears sound and follows proper patterns.
  • No files require special attention - the one style suggestion in apps/evm/src/pages/Markets/Tabs/index.tsx is optional

Important Files Changed

Filename Overview
apps/evm/src/pages/Markets/Tabs/index.tsx Adds tab navigation for Markets/E-mode/Isolation mode. Unnecessary second argument in forEach on line 37-40.
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts Formats and sorts E-mode groups with hypothetical calculations. Previously reported sorting bug has been fixed.
apps/evm/src/pages/Markets/Tabs/EMode/index.tsx E-mode tab component with search, filtering, and sorting. Clean implementation.
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/index.tsx E-mode group header with enable/disable/switch functionality. Proper error handling and user feedback.
apps/evm/src/components/ButtonGroup/index.tsx Added variant prop for primary/secondary styles. Backwards compatible with proper default.

Last reviewed commit: 7cd1b35

@therealemjy
Copy link
Copy Markdown
Member Author

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 23, 2026

Greptile Summary

This PR adds E-mode and Isolation mode tabs to the Markets page, allowing users to view and manage E-mode groups with enhanced borrowing parameters.

Key changes:

  • Adds tabbed navigation (Markets/E-mode/Isolation mode) to Markets page
  • Implements E-mode group cards with enable/disable functionality and health factor calculations
  • Adds filtering by search, paused assets, and user assets
  • Refactors ConnectWallet and SwitchChain components to use buttonSize prop instead of small
  • Adds variant prop to ButtonGroup component for secondary style
  • Includes comprehensive translation updates across 7 languages

Issues found:

  • Liquidation penalty column has inverted sort order due to swapped parameters in compareNumbers call

Confidence Score: 4/5

  • Safe to merge after fixing the sorting bug
  • The PR implements a substantial feature with good test coverage and clean architecture. One sorting bug needs fixing, but the core logic for health factor calculations, filtering, and E-mode management is solid.
  • apps/evm/src/pages/Markets/Tabs/EMode/useColumns/index.tsx needs the sorting bug fixed

Important Files Changed

Filename Overview
apps/evm/src/pages/Markets/Tabs/EMode/useColumns/index.tsx Defines table columns for E-mode assets. Has sorting bug in liquidationPenalty column (parameters swapped).
apps/evm/src/pages/Markets/Tabs/formatEModeGroups/index.ts Formats E-mode groups with user context, calculates health factors, and sorts groups. Logic appears correct.
apps/evm/src/pages/Markets/Tabs/index.tsx Creates tab navigation for Markets, E-mode, and Isolation mode. Clean implementation with proper conditionals.
apps/evm/src/pages/Markets/Tabs/EMode/index.tsx E-mode tab component with filtering, search, and controls. Well-structured with proper state management.
apps/evm/src/pages/Markets/Tabs/EMode/EModeGroup/Header/index.tsx E-mode group header with enable/disable functionality. Complex but well-implemented UI logic.
apps/evm/src/pages/Markets/Tabs/EMode/filterEModeGroups/index.ts Filters E-mode groups by search, paused assets, and user assets. Logic is correct and well-tested.

Last reviewed commit: 68df0a4

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

35 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread apps/evm/src/pages/Markets/Tabs/EMode/useColumns/index.tsx
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