Repository navigation
feat: host-backed OHLCV pagination for older bars - #47753
Conversation
|
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. |
2383778 to
b37650e
Compare
Builds ready [b37650e]
⚡ Performance Benchmarks (Total: 🟢 4 pass · 🟡 5 warn · 🔴 4 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
b37650e to
34de087
Compare
Builds ready [34de087]
⚡ Performance Benchmarks (Total: 🟢 4 pass · 🟡 7 warn · 🔴 2 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [bf41a7c]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
f79ea21
Builds ready [f79ea21]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
|



Description
Pagination PR (3/3, top of the stack) for the Token Details Page advanced charts work. Stacked on #47751 (chart UI), which is stacked on #47749 (foundation).
Adds host-backed ("RN-backed") pagination of older OHLCV bars so the chart can load more history as the user scrolls back in time, without granting the sandboxed chart iframe any network access:
SET_OHLCV_DATA) now carries anrnBackedPagination: { enabled: true }flag, telling the engine to request older bars from the host rather than fetching them itself.FETCH_OLDER_BARS_REQUEST(withrequestId,seriesGeneration, symbol/resolution/window). The host (advanced-chart-iframe.tsx) fetches the next older page from the Price API by cursor and replies withFETCH_OLDER_BARS_RESPONSE; the engine echo-guards onseriesGeneration, dedupes, and prepends the bars.useOHLCVChartgains cursor-aware paging (fetchOHLCVPage+ a stablefetchOlderBars), surfaced throughuseAdvancedChartDataand wired down viaadvanced-chart-section.All changes are confined to the 8 chart files already introduced in #47751. Still gated behind the
AdvancedChartsremote feature flag.Base branch:
feat/advanced-charts-ui(#47751).Changelog
CHANGELOG entry: Added loading of older historical data when scrolling back on the token details page chart.
Manual testing steps
AdvancedChartsremote feature flag, then build and run the extension.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches OHLCV fetch/pagination and iframe messaging; mistakes could show wrong history or mishandle series switches, but changes stay behind Advanced Charts and include thorough tests.
Overview
Adds host-backed pagination so users can scroll the token-details candlestick chart further into the past without letting the sandboxed chart iframe perform network requests (blocked by CSP).
Data layer:
useOHLCVChartnow pages viafetchOHLCVPage(cursor +hasNextfrom the Price API) and exposes a stablefetchOlderBarsthat advances the cursor, short-circuits when history is exhausted, and drops stale pages if the asset/interval/currency series changes mid-flight.useAdvancedChartDatapasses this through toAdvancedChartSectionandAdvancedChartIframe.Iframe bridge: Full
SET_OHLCV_DATApayloads includernBackedPagination: { enabled: true }. When the engine sendsFETCH_OLDER_BARS_REQUEST, the host invokesfetchOlderBarsand replies withFETCH_OLDER_BARS_RESPONSE(echoingrequestId/seriesGeneration, ornoDataon error/missing callback).Tests cover the new postMessage contract, cursor paging, and wiring mocks across section/data hooks.
Reviewed by Cursor Bugbot for commit f79ea21. Bugbot is set up for automated code reviews on this repo. Configure here.