Fix chart viewport regressions from tail refresh and period switch.

Remove pendingViewportEpoch, fetch only 30 tail bars on poll, restore wasViewingTail logic, and fix left-scroll range shift from actual merge delta.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-08 08:18:06 +08:00
parent 7ea51818f1
commit 35088be097
2 changed files with 25 additions and 15 deletions
+3
View File
@@ -652,6 +652,7 @@ def api_chart_ohlcv(
symbol: str = "",
timeframe: str = "1d",
refresh: str = "",
tail: str = "",
limit: int = 0,
before_ms: str = "",
):
@@ -665,6 +666,7 @@ def api_chart_ohlcv(
raise HTTPException(status_code=400, detail="请输入币种")
ex_key = str(ex.get("key") or "").strip().lower()
force = (refresh or "").strip().lower() in ("1", "true", "yes", "on")
tail_refresh = (tail or "").strip().lower() in ("1", "true", "yes", "on")
lim = int(limit) if int(limit or 0) > 0 else None
bms_raw = (before_ms or "").strip()
bms = None
@@ -690,6 +692,7 @@ def api_chart_ohlcv(
timeframe,
remote_fetch,
force_refresh=force,
tail_refresh=tail_refresh,
limit=lim,
before_ms=bms,
)