Skip to content

fix: update chart container layout cp-7.74.0#29023

Merged
sahar-fehri merged 5 commits into
mainfrom
fix/update-chart-layout
Apr 20, 2026
Merged

fix: update chart container layout cp-7.74.0#29023
sahar-fehri merged 5 commits into
mainfrom
fix/update-chart-layout

Conversation

@sahar-fehri

@sahar-fehri sahar-fehri commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Description

Improves the TradingView Advanced Chart layout on the token details screen so that price scale tick labels are better positioned and less likely to appear clipped on certain tokens.

Changelog

CHANGELOG entry: Improved advanced chart layout to reduce price scale label clipping on the token details screen

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
UI/layout-only chart rendering changes with minimal logic impact; main risk is visual regressions in empty/loading chart states across devices.

Overview
Improves token detail chart layout to reduce clipped/awkward price-scale labels, primarily by letting the TradingView WebView surface fully fill its container and tweaking pane top/bottom margins.

Simplifies the legacy PriceChart empty-state behavior by not rendering placeholder chart/gradient when data is insufficient, and disabling pan handlers unless real chart data is present; also removes unused placeholderData and trims related SVG imports. Separately removes overflow-hidden from the advanced price chart wrapper so chart chrome/labels aren’t clipped.

Reviewed by Cursor Bugbot for commit 7307d7d. Bugbot is set up for automated code reviews on this repo. Configure here.

@sahar-fehri sahar-fehri requested a review from a team as a code owner April 20, 2026 08:49
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026
'paneProperties.bottomMargin': 9,
'paneProperties.topMargin': 12,
'paneProperties.bottomMargin': 8,
});

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.

  • Increased paneProperties.topMargin from 8 to 12 using TradingView's documented auto-scaling margin API. This gives the topmost price grid line label more room within the pane.
  • Set paneProperties.bottomMargin to 8 (previously 9). The margins are now applied consistently in both the widget constructor and theme overrides.

right: 0;
top: 16px;
bottom: 0;
inset: 0;

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.

#chart_surface now fills the full WebView (inset: 0 instead of top: 16px). The previous 16px top inset was reserving space for crosshair pill headroom but reduced the canvas area available to TradingView. Removing it gives the chart the full height passed from React Native.

@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026
}

// this data draws a placeholder chart to show a greyed out chart when there is no data available
export const placeholderData = [

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.

cleanup this is no longer used

@github-actions github-actions Bot added size-M and removed size-S labels Apr 20, 2026
{chartHasData && !isLoading ? <EndDot /> : null}
</AreaChart>
{chartHasData ? (
<AreaChart

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.

AreaChart is only rendered when data exists. The no-data empty state is handled entirely by NoDataOverlay, which renders its own SVG placeholder

@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 20, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes in this PR are purely visual/UI fixes to chart components:

  1. Price.advanced.tsx: Removed overflow-hidden CSS class from a Box wrapper - minor styling fix.

  2. PriceChart.tsx: Refactored to remove the NoDataGradient placeholder chart (greyed-out chart shown when no data available) and placeholderData. Now the chart simply renders nothing when there's no data. Also conditionally applies pan gesture handlers only when chart has data.

  3. PriceChart/utils.ts: Removed the placeholderData export array.

  4. AdvancedChartTemplate.ts: CSS layout fix - changed #chart_surface from top: 16px inset to inset: 0 so TradingView gets full height.

  5. chartLogic.js & chartLogicString.ts: Minor TradingView pane margin adjustments (topMargin: 8→12, bottomMargin: 9→8).

Why no E2E tags are needed:

  • No E2E tests directly reference PriceChart, AdvancedChart, or AssetOverview chart components (confirmed via grep)
  • These are purely visual/layout fixes with no impact on wallet flows, transactions, navigation, or core logic
  • The changes don't affect any shared components (TabBar, modals, confirmations, browser) that could break existing tests
  • No controller, Engine, or state management changes
  • No test infrastructure changes
  • The AssetOverview/Price component is used in TokenDetails view, but no E2E tests cover the chart rendering specifically
  • Risk is limited to visual regression in the token detail price chart view, which is not covered by any existing E2E tag

Performance Test Selection:
The changes are minor UI/layout fixes to chart components (CSS class removal, margin adjustments, removing placeholder data). These do not affect rendering performance in a measurable way - no new components added, no data fetching changes, no list rendering changes, no state management changes. The removal of the NoDataGradient component actually slightly reduces rendering work when no data is available.

View GitHub Actions results

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7307d7d. Configure here.

Comment thread app/components/UI/AssetOverview/PriceChart/PriceChart.tsx
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.20%. Comparing base (88bb30c) to head (7307d7d).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...ponents/UI/AssetOverview/PriceChart/PriceChart.tsx 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29023      +/-   ##
==========================================
- Coverage   82.26%   82.20%   -0.07%     
==========================================
  Files        5055     5055              
  Lines      133121   133233     +112     
  Branches    29795    29830      +35     
==========================================
+ Hits       109518   109521       +3     
- Misses      16173    16281     +108     
- Partials     7430     7431       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@sahar-fehri sahar-fehri changed the title fix: update chart container layout fix: update chart container layout cp-7.74.0 Apr 20, 2026
@sahar-fehri sahar-fehri added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 4345902 Apr 20, 2026
69 checks passed
@sahar-fehri sahar-fehri deleted the fix/update-chart-layout branch April 20, 2026 09:41
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk-low Low testing needed · Low bug introduction risk size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants