chore: fix outline pill on scroll back token details ac#28837
chore: fix outline pill on scroll back token details ac#28837sahar-fehri merged 8 commits intomainfrom
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. |
|
✅ E2E Fixture Validation — Schema is up to date |
9936df9 to
b958011
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Investigation confirmed:
Since no E2E tests cover this component and the changes are isolated to WebView-internal chart rendering logic with no impact on any tested user flows, no E2E test tags need to be run. Performance Test Selection: |
|
juanmigdr
left a comment
There was a problem hiding this comment.
I have tested locally and the PR fixes what is intended to fix. In terms of the math and code changes, I believe it has been developed correctly and trust @sahar-fehri's criteria




Description
Fix advanced chart outline pill when panning / first load.
This updates the TradingView webview script (chartLogic.js) that drives the custom outline price pill (the hollow label on the price axis) so it shows and hides at the right times and doesn’t flicker when you scroll or when the chart first loads.
You’re looking at old bars; the newest bar is off the right. The outline should show.
On main, sometimes the geometry still said “the marker would be in the plot” (or didn’t line up with which bars are actually loaded), so the app thought: “dot is still ‘there’, hide the outline.” (when it shouldn't) => cause regression
So the outline disappeared when it should stay.
What the new code adds (why it fixes that)
isSeriesTailOffScreenByData— Looks at actual OHLCV: “Is the newest bar outside what counts as visible for the bars we have?” If yes, treat the tail as off-screen.shouldHideVisibleEdgeOutlinePill— Show the outline if either geometry says the dot isn’t in the plot or data says the tail is off-screen (so you don’t rely on only coordinateToTime).Changelog
CHANGELOG entry: fix showing outline pill on advanced charts on old history when chart head is visible.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches time/price scale math and visibility heuristics for TradingView overlays; bugs could cause the outline/last-close pills to misrender or flicker during pan/zoom and first load.
Overview
Fixes the advanced chart outline price pill so it shows reliably when users pan away from the latest bar and stops disappearing/flickering due to inconsistent time-scale geometry.
The outline pill visibility logic is reworked to combine a new plot-geometry check (
isCustomLineEndMarkerVisibleInPlot) with a data-based fallback (isSeriesTailOffScreenByData), plus a more resilient “visible edge” bar selection (getVisibleEdgeOutlineBar). Line charts also now compute the outline price by interpolating the close at the plot’s right edge, and Y-coordinate mapping for pills is updated to support inverted and log price scales.Reviewed by Cursor Bugbot for commit 4d31807. Bugbot is set up for automated code reviews on this repo. Configure here.