Skip to content

Fix/perps breakdown tips zero balance - #4143

Merged
cs1707 merged 3 commits into
developfrom
fix/perps-breakdown-tips-zero-balance
Sep 30, 2026
Merged

cs1707 merged 3 commits into
developfrom
fix/perps-breakdown-tips-zero-balance

Conversation

@jinming0618

@jinming0618 jinming0618 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request primarily removes the hasNonPerpsPortfolioAssets selector and its usages, simplifying the logic for showing the portfolio breakdown in the Perps account UI. Additionally, it improves the TradingView chart integration by ensuring the price precision (pxDecimals) is accurate before rendering, preventing axis reticking and enhancing user experience.

UI Logic Simplification:

  • Removed the hasNonPerpsPortfolioAssets selector and all related code and tests, so the portfolio breakdown is now shown based only on whether the headline value is greater than zero and user data is ready. (src/ui/views/Perps/utils/accountPricing.ts [1] src/ui/views/Perps/components/PerpsAccountCard.tsx [2] [3] __tests__/ui/perpsAccountPricing.test.ts [4] [5]

TradingView Chart Improvements:

  • Added a pxDecimalsReady prop to the TradingView chart components to ensure the chart waits for price-derived precision before rendering, preventing visible axis reticking. (src/ui/views/DesktopPerps/components/ChartArea/components/ChartWrapper.tsx [1] src/ui/views/Perps/components/TradingViewIframeChart.tsx [2] [3] [4] [5] [6] [7]
  • Implemented a mechanism to delay the TradingView chart's symbol resolution until pxDecimals is ready, with a 3-second upper bound to avoid indefinite waiting. (src/ui/views/Perps/components/TradingViewIframeChart.tsx [1] [2] [3] [4]

These changes streamline the UI logic and provide a smoother charting experience for users.

@ddddhm1234

Copy link
Copy Markdown
Contributor

PR扫描结果

依赖变更

无依赖变更

@rabby-code-reviewer rabby-code-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated inline review.

Comment thread src/ui/views/Perps/components/TradingViewIframeChart.tsx Outdated
@ddddhm1234

Copy link
Copy Markdown
Contributor

PR扫描结果

依赖变更

无依赖变更

@cs1707
cs1707 merged commit dabd176 into develop Sep 30, 2026
4 checks passed
@cs1707
cs1707 deleted the fix/perps-breakdown-tips-zero-balance branch September 30, 2026 04:01
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.

3 participants