Skip to content

feat: support isolation mode tag#5600

Merged
cuzz-venus merged 9 commits into
mainfrom
feat/isolation-optimization
May 26, 2026
Merged

feat: support isolation mode tag#5600
cuzz-venus merged 9 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: 3280b2d

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 25, 2026 10:46am
dapp-testnet Ready Ready Preview May 25, 2026 10:46am
venus.io Ready Ready Preview May 25, 2026 10:46am

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR adds an "Isolated" mode tag to the market table asset column and updates the supply asset-warning copy to surface E-mode and isolation-mode context to users.

  • A new IsolatedAssetIndicator component (yellow "Isolated" label + tooltip) is rendered in the asset column when an asset has collateralFactor === 0, is not borrowable, and belongs to an isolated e-mode group; the full eModeGroups array is threaded down from MarketsMarketTableuseColumns to power this check.
  • A new SupplyNotification component replaces the inline supply-description string, branching on whether the asset is available in core, e-mode, isolation mode, or some combination; the AssetWarning component's asset prop has been made required to support this.
  • Translation keys for the new copy are added across all seven supported locales.

Confidence Score: 5/5

Safe to merge; all changed paths are UI-only and the logic for detecting isolated assets is well-guarded.

The core detection logic in showIsolatedIndicator and SupplyNotification correctly gates on collateralFactor === 0 && !isBorrowable before checking group membership, and the null-guard on pool in AssetWarning means the borrow path cannot dereference an undefined pool. No data mutations or API changes are introduced.

No files require special attention beyond the minor design-token nit in useColumns/index.tsx.

Important Files Changed

Filename Overview
apps/evm/src/containers/MarketTable/useColumns/index.tsx Adds showIsolatedIndicator logic and alternate asset-column layout for isolated assets; uses font-semibold in new code, which is blocklisted by the design system token rules.
apps/evm/src/pages/Market/AssetWarning/SupplyNotification/index.tsx New component encapsulating all supply-warning copy variants (core, e-mode only, isolation only, both); logic is correct after the addressed fixes.
apps/evm/src/components/IsolatedAssetIndicator/index.tsx New component rendering the "Isolated" label + tooltip for isolated-mode assets; straightforward and well-structured.
apps/evm/src/pages/Market/AssetWarning/index.tsx Refactored to delegate supply-path copy to SupplyNotification; asset prop made required; null-guard on pool retained, so borrow path accessing pool.name is safe.
apps/evm/src/pages/Markets/Tabs/Markets/index.tsx Passes pool.eModeGroups down to MarketTable so the isolated indicator logic has the full group list.
apps/evm/src/components/Tooltip/index.tsx Adds optional contentClassName prop forwarded to TooltipContent, enabling max-w-fit override needed for the isolated indicator.
apps/evm/src/containers/MarketTable/index.tsx Threads the new optional eModeGroups prop through to useColumns; no other behavioral changes.

Reviews (3): Last reviewed commit: "feat: fix tooltip content & market show ..." | Re-trigger Greptile

Comment thread apps/evm/src/pages/Market/AssetWarning/SupplyNotification/index.tsx Outdated
Comment thread apps/evm/src/pages/Market/AssetWarning/index.tsx
@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.26% 45672 / 56200
🔵 Statements 81.26% 45672 / 56200
🔵 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.59% 83.33% 66.66% 98.59% 36
apps/evm/src/pages/Market/AssetWarning/SupplyNotification/index.tsx 92.95% 44.44% 0% 92.95% 41, 49, 63-64, 84
apps/evm/src/pages/Markets/Tabs/Markets/index.tsx 100% 0% 100% 100%
Generated in workflow #13514 for commit 3280b2d by the Vitest Coverage Report Action

Comment on lines +55 to +70
if (!isAvailableInCore) {
let i18nKey: string | undefined;

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';
}

if (!i18nKey) {
return null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No nested IF statements

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed, thanks!

return (
<>
<Trans
// t('assetWarning.supplyDescription')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unnecessary (the extract command will find this translation key automatically)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed, thanks!


{hasMode && (
<Trans
// t('assetWarning.modeInfoHint')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unnecessary (the extract command will find this translation key automatically)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed, thanks!

<SupplyNotification asset={asset} pool={pool} onShowAllMarkets={handleShowAssets} />
) : (
<Trans
// t('assetWarning.borrowDescription')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unnecessary (the extract command will find this translation key automatically)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed, thanks!

<Trans
i18nKey={i18nKey}
values={{ tokenSymbol }}
components={{ Button: showAllMarketsButton, ModeInfoButton: modeInfoButton }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since you've given a name to ModeInfoButton, I'd recommend also adding a prefix to Button).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point!

Comment on lines +59 to +66
// 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';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to make sure no dev remove the comments in the future, I'd add a notice like this one before each comment:

// Translation key: do not remove this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed, thanks!

Comment on lines +292 to +298
"modeInfoHint": "<LineBreak/>Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to explore more available groups.",
"modeOnly": {
"eMode": "{{tokenSymbol}} is only available in E-mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable the group, or browse other assets in <Button>Show all markets</Button>.",
"eModeAndIsolation": "{{tokenSymbol}} is only available in E-mode and Isolation mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable one of the groups, or browse other assets in <Button>Show all markets</Button>.",
"isolation": "{{tokenSymbol}} is only available in Isolation mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable the group, or browse other assets in <Button>Show all markets</Button>."
},
"supplyDescription": "Supplying {{tokenSymbol}} to the Core Pool lets you borrow tokens from this pool exclusively. <Button>Show all markets</Button>"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know you grabbed the content from the designs, but I have told them multiple times that we shouldn't randomly capitalize words in sentences (AIs typically do that). Also, the sentences "browse other wassets in Show all markets" is quite odd. I suggest the following changes, let me know your thoughts:

Suggested change
"modeInfoHint": "<LineBreak/>Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to explore more available groups.",
"modeOnly": {
"eMode": "{{tokenSymbol}} is only available in E-mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable the group, or browse other assets in <Button>Show all markets</Button>.",
"eModeAndIsolation": "{{tokenSymbol}} is only available in E-mode and Isolation mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable one of the groups, or browse other assets in <Button>Show all markets</Button>.",
"isolation": "{{tokenSymbol}} is only available in Isolation mode. Visit the <ModeInfoButton>Mode info</ModeInfoButton> section to enable the group, or browse other assets in <Button>Show all markets</Button>."
},
"supplyDescription": "Supplying {{tokenSymbol}} to the Core Pool lets you borrow tokens from this pool exclusively. <Button>Show all markets</Button>"
"modeInfoHint": "<LineBreak/>Visit the <ModeInfoButton>mode info</ModeInfoButton> section to explore more available groups.",
"modeOnly": {
"eMode": "{{tokenSymbol}} is only available in E-mode. Visit the <ModeInfoButton>mode info</ModeInfoButton> section to enable the group, or browse <Button>other assets</Button>.",
"eModeAndIsolation": "{{tokenSymbol}} is only available in E-mode and Isolation mode. Visit the <ModeInfoButton>mode info</ModeInfoButton> section to enable one of the groups, or browse <Button>other assets</Button>.",
"isolation": "{{tokenSymbol}} is only available in Isolation mode. Visit the <ModeInfoButton>mode info</ModeInfoButton> section to enable the group, or browse <Button>other assets</Button>."
},
"supplyDescription": "Supplying {{tokenSymbol}} to the Core Pool lets you borrow tokens from this pool exclusively. <Button>Show all markets</Button>"

@cuzz-venus cuzz-venus merged commit 17beed2 into main May 26, 2026
5 checks passed
@cuzz-venus cuzz-venus deleted the feat/isolation-optimization branch May 26, 2026 07:04
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