Skip to content

CP-14508: perps chart TV resolution picker + surface-colored toolbar fades - #4011

Open
bogdandobritoiu wants to merge 5 commits into
mainfrom
CP-14508
Open

CP-14508: perps chart TV resolution picker + surface-colored toolbar fades#4011
bogdandobritoiu wants to merge 5 commits into
mainfrom
CP-14508

Conversation

@bogdandobritoiu

@bogdandobritoiu bogdandobritoiu commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Ticket: CP-14508

  • Replaces the perps market details range picker (24H / 1W / 1M / 3M / 1Y, several of which mapped to the same candle resolution) with the actual TradingView resolutions supported by the Hyperliquid datafeed: 1M 5M 15M 1H 4H 12H 1D 1W (default 1H, same underlying resolution as before)
  • The picker is now horizontally scrollable (fixed-width segments inside a horizontal ScrollView); tapping a partially clipped segment scrolls it fully into view
  • Repaints TradingView's drawing-toolbar scroll fades: the charting library hardcodes them to #0f0f0f (dark) / #fff (light), which shows as a black band over our $surfacePrimary background. A small stylesheet generated at runtime and injected via custom_css_url (a data: URL) redraws the fades with the surface color passed in by the RN host. Selectors are attribute-based ([class^="fadeTop-"]) so they survive charting-library rebuilds where the hashed class names change

No new dependencies.

Screenshots/Videos

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-24.at.14.59.11.mov

Testing

Dev Testing

  • Open any perps market details screen
  • The timeframe row shows 1M 5M 15M 1H 4H 12H 1D 1W with 1H selected; the row scrolls horizontally and tapping an edge-clipped segment scrolls it fully into view
  • Tap each resolution and confirm the chart reloads candles at that interval
  • On the chart, scroll the left drawing toolbar vertically: the fade above/below the tools should match the screen background (no black band), in both light and dark mode

Bitrise:

  • iOS - 9409
  • Android - 9410

QA Testing

  • Perps market details: timeframe selector shows the 8 TV resolutions, scrolls horizontally, selection drives the chart's candle interval
  • Chart drawing toolbar (left edge) scroll fade matches the screen surface color in light and dark themes

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have included screenshots / videos of android and ios
  • I have added testing steps
  • I have added/updated necessary unit tests
  • I have updated the documentation

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 24, 2026 11:26

Copilot AI 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.

Pull request overview

Updates the perps market details UI to align the chart timeframe picker with the actual TradingView/Hyperliquid-supported resolutions, and visually integrates the TradingView drawing toolbar fades with the app’s surface background.

Changes:

  • Replace the old “24H/1W/1M/3M/1Y” range picker with a scrollable picker of supported TV resolutions (1M 5M 15M 1H 4H 12H 1D 1W) and keep the default at 1H.
  • Add horizontal scrolling behavior that scrolls a partially clipped segment fully into view when tapped.
  • Inject runtime-generated CSS into TradingView (custom_css_url) to repaint toolbar fade gradients to match the host-provided surface color.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/core-mobile/app/new/features/trade/perpetuals/screens/PerpetualsDetailsScreen.tsx Reworks the timeframe picker to a scrollable list of supported TradingView resolutions and updates default selection behavior.
packages/core-mobile/app/new/features/trade/perpetuals/screens/PerpetualsDetailsScreen.test.tsx Extends the k2-alpine Jest mock to include ScrollView so the updated screen can render in tests.
packages/core-mobile/app/new/features/trade/perpetuals/components/tradingview.html Adds injected CSS via custom_css_url to recolor TradingView toolbar fades and re-enables the left toolbar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Coverage report ✅

2/2 packages passed thresholds
Thresholds are shown inline against each package baseline.

🟢 @avalabs/core-mobile

St. Category Percentage Covered / Total
🟢 Statements 27.87% (+9.87% vs 18% ▲) 12329/44236
🟢 Branches 23.48% (+11.48% vs 12% ▲) 6033/25693
🟢 Functions 22.14% (+9.14% vs 13% ▲) 2263/10220
🟢 Lines 27.94% (+9.94% vs 18% ▲) 11806/42240

🟢 @avalabs/k2-alpine

St. Category Percentage Covered / Total
🟢 Statements 8.49% (+6.49% vs 2% ▲) 304/3578
🟢 Branches 7.90% (+6.90% vs 1% ▲) 172/2177
🟢 Functions 4.99% (+3.99% vs 1% ▲) 41/821
🟢 Lines 7.82% (+5.82% vs 2% ▲) 257/3283
Artifacts and threshold sources
  • @avalabs/core-mobile: summary core-mobile/coverage/coverage-summary.json, thresholds core-mobile/coverage-thresholds.json
  • @avalabs/k2-alpine: summary k2-alpine/coverage/coverage-summary.json, thresholds k2-alpine/coverage-thresholds.json

Source run: Mobile PR

…k, fix lint

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 11:54
bogdandobritoiu and others added 2 commits July 24, 2026 14:57
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 24, 2026 11:58

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

… ScrollView test mock

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 12:21

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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