-
Notifications
You must be signed in to change notification settings - Fork 0
fix: chart symbol mapping #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
03c3454 to
55f5736
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes ENG-1176 by improving TradingView chart symbol resolution so the chart uses the correct provider + symbol pair instead of a hardcoded fallback.
Changes:
- Refactors the Position Details chart into a new
Overview/Chartmodule that resolvesproviderId:symbolvia a generated mapping. - Adds
tradingview-symbols.json+ a generator script to produce/refresh the mapping. - Centralizes and preloads the TradingView widget script URL to reduce load latency.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/constants.ts | Introduces a shared TradingView widget script URL constant. |
| src/app.tsx | Preloads the TradingView script at app start. |
| src/components/modules/PositionDetails/Overview/index.tsx | Switches to the new named Chart export/module. |
| src/components/modules/PositionDetails/Overview/chart.tsx | Removes the old chart implementation. |
| src/components/modules/PositionDetails/Overview/Chart/state.ts | Adds symbol mapping atom + chart interval constants. |
| src/components/modules/PositionDetails/Overview/Chart/index.tsx | New chart implementation that embeds TradingView using provider/symbol mapping and updates interval via postMessage. |
| src/assets/tradingview-symbols.json | Adds the provider/symbol mapping dataset used by the chart. |
| scripts/generate-tradingview-symbols.ts | Adds a script to generate/update the mapping JSON from Perps + TradingView search. |
| src/components/molecules/token-balances-select.tsx | Removes unnecessary useCallback usage. |
| src/components/molecules/provider-select.tsx | Removes unnecessary useCallback usage. |
| package.json | Adds a generate-tradingview-symbols script entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| iframeRef.current.contentWindow.postMessage( | ||
| { name: "set-interval", data: { interval: newInterval } }, | ||
| "*", | ||
| ); |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
postMessage is sent with targetOrigin "*". Since the message is intended only for the TradingView iframe, it would be safer to restrict targetOrigin to the iframe's actual origin (e.g. derive it from iframeRef.current.src) to avoid sending messages if the iframe navigates to a different origin.
Fixes ENG-1176