Skip to content

feat: support hidden balance#5492

Merged
cuzz-venus merged 11 commits intomainfrom
feat/hide-balance
Apr 15, 2026
Merged

feat: support hidden balance#5492
cuzz-venus merged 11 commits intomainfrom
feat/hide-balance

Conversation

@cuzz-venus
Copy link
Copy Markdown
Contributor

@cuzz-venus cuzz-venus commented Apr 8, 2026

Jira ticket(s)

VPD-956

Changes

  • Hide market & staking balance when user clicks "Hide"

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 8, 2026

🦋 Changeset detected

Latest commit: bbdcae9

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 Patch

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 Apr 8, 2026

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

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Apr 15, 2026 7:22am
dapp-testnet Ready Ready Preview Apr 15, 2026 7:22am
venus.io Ready Ready Preview Apr 15, 2026 7:22am

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 8, 2026

Greptile Summary

This PR adds "hide balance" support across the Dashboard summary cells and the market table's user balance columns using the existing HidableUserBalance container and a new hiddenValues prop on AccountHealthBar.

  • The AccountHealthBar tooltip still leaks the real borrow balance, limit-used percentage, and moderate borrow limit when hiddenValues is set — hovering the progress bar bypasses the privacy mask. Pass hiddenValues ? undefined : tooltip instead to suppress the tooltip when balances are hidden.

Confidence Score: 4/5

Safe to merge after fixing the tooltip privacy leak in AccountHealthBar; all other changes are correct.

One P1 defect: the AccountHealthBar tooltip reveals actual financial values (borrow balance, limit %) when balances are supposed to be hidden, directly undermining the feature's purpose. The fix is a one-liner. All other changes — HidableUserBalance usage in MarketTable columns and Summary cells — are correct and consistent with the existing pattern.

apps/evm/src/components/AccountHealthBar/index.tsx — tooltip prop must also be masked when hiddenValues is set.

Vulnerabilities

  • Privacy bypass: AccountHealthBar tooltip reveals actual borrow balance and limit values even when the user has enabled "hide balances" — the hiddenValues prop only masks label text, not the tooltip rendered by ProgressBar.

Important Files Changed

Filename Overview
apps/evm/src/components/AccountHealthBar/index.tsx Adds hiddenValues prop to mask label text in the progress bar, but the tooltip still renders actual balance data when balances are hidden — a P1 defect.
apps/evm/src/containers/MarketTable/useColumns/index.tsx Wraps userSupplyBalance, userBorrowBalance, and userBorrowLimitSharePercentage columns in HidableUserBalance — straightforward and consistent with the container's pattern.
apps/evm/src/pages/Dashboard/Markets/Positions/Summary/index.tsx Wraps all user-facing balance cells in HidableUserBalance and passes HIDDEN_BALANCE_KEY to AccountHealthBar for label masking; the tooltip leak is the issue located in AccountHealthBar itself.

Comments Outside Diff (1)

  1. apps/evm/src/components/AccountHealthBar/index.tsx, line 138 (link)

    P1 Tooltip exposes hidden balance values

    When hiddenValues is set, whiteLeftText and whiteRightText are masked correctly, but tooltip is still computed from the real readableBorrowBalance, readableBorrowLimitUsedPercentage, and readableModerateBorrowLimit values and passed unchanged to LabeledProgressBar → ProgressBar. A user who has enabled "hide balances" can hover over the progress bar and see their actual borrow balance and limit in the tooltip — defeating the privacy feature.

Reviews (1): Last reviewed commit: "chore: support hidden" | Re-trigger Greptile

Copy link
Copy Markdown
Member

@therealemjy therealemjy left a comment

Choose a reason for hiding this comment

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

I think the values inside the account health bar tooltip should also be hidden when hiding balances:
Image

Comment thread apps/evm/src/components/AccountHealthBar/index.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 76.73% 38739 / 50486
🔵 Statements 76.73% 38739 / 50486
🔵 Functions 58.62% 605 / 1032
🔵 Branches 71.32% 4434 / 6217
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/components/AccountHealthBar/index.tsx 99.22% 40% 100% 99.22% 117
apps/evm/src/containers/HidableUserBalance/index.tsx 88.88% 50% 100% 88.88% 1
apps/evm/src/containers/MarketTable/useColumns/index.tsx 91% 80.45% 66.66% 91% 147-148, 194, 360, 364, 368-372, 391-409
apps/evm/src/containers/Vault/VaultCard/Simplified/index.tsx 91.66% 0% 0% 91.66% 34, 41, 88-93
apps/evm/src/pages/Dashboard/Markets/Positions/Summary/index.tsx 93.22% 0% 100% 93.22% 111-119
apps/evm/src/pages/Dashboard/Vaults/index.tsx 98.79% 44.44% 50% 98.79% 55
Generated in workflow #13236 for commit bbdcae9 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.

2 participants