Skip to content

feat: support isolation mode tag#5600

Draft
cuzz-venus wants to merge 7 commits into
mainfrom
feat/isolation-optimization
Draft

feat: support isolation mode tag#5600
cuzz-venus wants to merge 7 commits into
mainfrom
feat/isolation-optimization

Conversation

@cuzz-venus
Copy link
Copy Markdown
Contributor

@cuzz-venus cuzz-venus commented May 21, 2026

Jira ticket(s)

VPD-1201

Changes

  • support isolated mode tag
  • update asset warnings

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: bb8f6a2

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview May 22, 2026 8:47am
dapp-testnet Ready Ready Preview May 22, 2026 8:47am
venus.io Ready Ready Preview May 22, 2026 8:47am

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR adds an "Isolated" badge to assets in isolation-mode groups within the market table and refactors the AssetWarning supply notification into a dedicated SupplyNotification component that renders mode-specific copy.

  • IsolatedAssetIndicator is a new component shown in the asset column when collateralFactor === 0 && !isBorrowable and the asset belongs to an isolated EModeGroup; eModeGroups is threaded from the pool down through MarketTableuseColumns.
  • SupplyNotification replaces the old inline translation switch in AssetWarning; it classifies each asset as core/E-mode/isolation-only and renders the appropriate i18n message, including a new modeInfoHint for assets that are also in a mode group.

Confidence Score: 4/5

Safe to merge after fixing the hardcoded pool name in the supply description.

The supplyDescription translation now hardcodes Core Pool and SupplyNotification no longer passes pool.name, but AssetWarning is rendered on every market page. Any borrowable or non-zero-collateral-factor asset in a non-Core pool will display the wrong pool name.

SupplyNotification/index.tsx and en.json (plus all other locale files) need the poolName interpolation restored.

Important Files Changed

Filename Overview
apps/evm/src/pages/Market/AssetWarning/SupplyNotification/index.tsx New component for supply-side warnings; hardcodes "Core Pool" in the supply description instead of using the dynamic pool name, causing incorrect copy on non-Core Pool market pages
apps/evm/src/pages/Market/AssetWarning/index.tsx Refactored to delegate supply messaging to SupplyNotification; pool guard is correct, but eModeGroups is not forwarded to the internal modal MarketTable
apps/evm/src/containers/MarketTable/useColumns/index.tsx Adds isolated indicator logic gated on collateralFactor === 0 && !isBorrowable; renders custom layout with TokenIcon + IsolatedAssetIndicator for qualifying assets
apps/evm/src/components/IsolatedAssetIndicator/index.tsx New reusable component for the Isolated label with InfoIcon tooltip; straightforward and well-structured
apps/evm/src/pages/Markets/Tabs/Markets/index.tsx Forwards pool.eModeGroups to MarketTable so the isolated indicator can appear in the main markets table
apps/evm/src/libs/translations/translations/en.json Adds modeOnly messages and modeInfoHint; supplyDescription now hardcodes Core Pool instead of using poolName interpolation
apps/evm/src/pages/Market/AssetWarning/tests/index.spec.tsx Tests updated to pass the now-required asset prop; coverage remains minimal but not regressed
apps/evm/src/containers/MarketTable/index.tsx Adds eModeGroups prop and threads it through to useColumns; no logic change otherwise

Reviews (2): Last reviewed commit: "feat: support transalation" | Re-trigger Greptile

Comment on lines +58 to +67
if (isAvailableInEMode && isAvailableInIsolation) {
// t('assetWarning.modeOnly.eModeAndIsolation')
i18nKey = 'assetWarning.modeOnly.eModeAndIsolation';
} else if (isAvailableInEMode) {
// t('assetWarning.modeOnly.eMode')
i18nKey = 'assetWarning.modeOnly.eMode';
} else {
// t('assetWarning.modeOnly.isolation')
i18nKey = 'assetWarning.modeOnly.isolation';
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 The else branch fires even when both isAvailableInEMode and isAvailableInIsolation are false, so an asset with collateralFactor === 0 that is not in any mode group will incorrectly display the isolation-mode-only message. Adding an explicit isAvailableInIsolation guard prevents this.

Suggested change
if (isAvailableInEMode && isAvailableInIsolation) {
// t('assetWarning.modeOnly.eModeAndIsolation')
i18nKey = 'assetWarning.modeOnly.eModeAndIsolation';
} else if (isAvailableInEMode) {
// t('assetWarning.modeOnly.eMode')
i18nKey = 'assetWarning.modeOnly.eMode';
} else {
// t('assetWarning.modeOnly.isolation')
i18nKey = 'assetWarning.modeOnly.isolation';
}
if (isAvailableInEMode && isAvailableInIsolation) {
// t('assetWarning.modeOnly.eModeAndIsolation')
i18nKey = 'assetWarning.modeOnly.eModeAndIsolation';
} else if (isAvailableInEMode) {
// t('assetWarning.modeOnly.eMode')
i18nKey = 'assetWarning.modeOnly.eMode';
} else if (isAvailableInIsolation) {
// t('assetWarning.modeOnly.isolation')
i18nKey = 'assetWarning.modeOnly.isolation';
} else {
// Asset is not in core and not in any mode group — fall back to standard supply description
return (
<Trans
i18nKey="assetWarning.supplyDescription"
values={{ tokenSymbol }}
components={{ Button: showAllMarketsButton }}
/>
);
}

Comment on lines +40 to +57
const description =
type === 'supply' && asset ? (
<SupplyNotification asset={asset} pool={pool} onShowAllMarkets={handleShowAssets} />
) : (
<Trans
// t('assetWarning.borrowDescription')
i18nKey="assetWarning.borrowDescription"
values={{ poolName: pool.name, tokenSymbol: token.symbol }}
components={{
Button: (
<TextButton
className="p-0 h-auto font-medium text-xs md:text-sm"
onClick={handleShowAssets}
/>
),
}}
/>
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 When type === 'supply' but asset is not provided (e.g., the existing "renders without crashing" test), the else-branch now renders assetWarning.borrowDescription instead of the supply description. Before this PR, the supply path always rendered assetWarning.supplyDescription. Any caller that passes type="supply" without asset will silently display borrow-facing copy.

Suggested change
const description =
type === 'supply' && asset ? (
<SupplyNotification asset={asset} pool={pool} onShowAllMarkets={handleShowAssets} />
) : (
<Trans
// t('assetWarning.borrowDescription')
i18nKey="assetWarning.borrowDescription"
values={{ poolName: pool.name, tokenSymbol: token.symbol }}
components={{
Button: (
<TextButton
className="p-0 h-auto font-medium text-xs md:text-sm"
onClick={handleShowAssets}
/>
),
}}
/>
);
const description =
type === 'supply' ? (
asset ? (
<SupplyNotification asset={asset} pool={pool} onShowAllMarkets={handleShowAssets} />
) : (
<Trans
// t('assetWarning.supplyDescription')
i18nKey="assetWarning.supplyDescription"
values={{ poolName: pool.name, tokenSymbol: token.symbol }}
components={{
Button: (
<TextButton
className="p-0 h-auto font-medium text-xs md:text-sm"
onClick={handleShowAssets}
/>
),
}}
/>
)
) : (
<Trans
// t('assetWarning.borrowDescription')
i18nKey="assetWarning.borrowDescription"
values={{ poolName: pool.name, tokenSymbol: token.symbol }}
components={{
Button: (
<TextButton
className="p-0 h-auto font-medium text-xs md:text-sm"
onClick={handleShowAssets}
/>
),
}}
/>
);

@cuzz-venus
Copy link
Copy Markdown
Contributor Author

@greptile review again

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.23% 45653 / 56196
🔵 Statements 81.23% 45653 / 56196
🔵 Functions 62.3% 648 / 1040
🔵 Branches 72.43% 5163 / 7128
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/components/index.ts 100% 100% 100% 100%
apps/evm/src/components/IsolatedAssetIndicator/index.tsx 100% 100% 100% 100%
apps/evm/src/containers/MarketTable/index.tsx 91.97% 70.58% 66.66% 91.97% 106-114, 210, 241-245
apps/evm/src/containers/MarketTable/useColumns/index.tsx 85.41% 76.92% 66.66% 85.41% 143-149, 153-160, 176-177, 189-199, 235, 401, 405, 409-413, 432-450
apps/evm/src/pages/Market/index.tsx 100% 50% 100% 100%
apps/evm/src/pages/Market/AssetWarning/index.tsx 98.57% 83.33% 66.66% 98.57% 36
apps/evm/src/pages/Market/AssetWarning/SupplyNotification/index.tsx 70.58% 44.44% 0% 70.58% 36, 44, 60-80, 84-85
apps/evm/src/pages/Markets/Tabs/Markets/index.tsx 100% 0% 100% 100%
Generated in workflow #13508 for commit bb8f6a2 by the Vitest Coverage Report Action

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