Sync hub shell to visualViewport when the keyboard opens to prevent white screen above chat input. Make instance tabs horizontally scrollable with active tab centered on phone.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move hub AI mobile CSS after desktop grid rules so chat fills the screen. Hide exchange and total-trade stat cards on phone across all instances and compact export bar.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use exchange TP/SL for display and DB sync on price_snapshot polls, refresh instance UI cells on each tick, and merge live values into hub monitor board.
Co-authored-by: Cursor <cursoragent@cursor.com>
Shrink summary context and prompts to today's trades and positions only, and tighten anti-fabrication rules.
Co-authored-by: Cursor <cursoragent@cursor.com>
Force refresh wipes the series in hub_kline.db before pulling from the exchange; add a Linux clear script and rename the UI button to 清库重拉.
Co-authored-by: Cursor <cursoragent@cursor.com>
Trim gaps before deciding fetch need, always backfill short contiguous tails, and relax gap detection so tail polls do not block full history loads.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep only the latest contiguous K-line segment, purge isolated stale rows, and backfill when the tail is still shorter than the initial limit.
Co-authored-by: Cursor <cursoragent@cursor.com>
When auto-follow is off, refresh only updates the latest bars via series.update instead of setData so zoom and pan stay fixed during background polls.
Co-authored-by: Cursor <cursoragent@cursor.com>
On tail refresh, auto-on always snaps to latest candles while auto-off preserves the saved viewport with clamped range restore.
Co-authored-by: Cursor <cursoragent@cursor.com>
Tie the market auto toggle to both price scale and viewport: tail refresh updates data silently while preserving zoom/pan when auto is disabled.
Co-authored-by: Cursor <cursoragent@cursor.com>
Load 2000 bars for 1m/5m/15m, 1000 for 1h/2h/4h, and 500 for 1d/1w on first screen instead of 300-bar chunked defaults.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Use pendingViewportEpoch so tail refresh applies default range on new timeframe instead of reusing the previous period's saved range.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the user viewport when SSE updates candles so zooming out to see the full series is not reset to the recent 200-bar view.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop 12h from market chart options and storage, and avoid left-pan reload and tail refresh from resetting the viewport while zooming.
Co-authored-by: Cursor <cursoragent@cursor.com>
Reset visible range and block stale left-pan/tail refresh from applying the previous period logical range to new candles.
Co-authored-by: Cursor <cursoragent@cursor.com>
Store 1m/5m/1h/12h/1d/1w with per-timeframe policies, aggregate 15m and 2h/4h on read, and support left-pan history fetches via before_ms.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add 自动 toggle on archive chart; when on, load history span for all trades and plot numbered open/close arrows for each.
Co-authored-by: Cursor <cursoragent@cursor.com>
range=history serves archive seed through close (not now). Default view focuses hold period; user can scroll/zoom left to see global morphology before entry.
Co-authored-by: Cursor <cursoragent@cursor.com>
Span chart window across hold period, fill 5m gaps for smooth aggregation, and mark entry/exit with lightweight-charts arrows.
Co-authored-by: Cursor <cursoragent@cursor.com>
Include strategy_trade_snapshots when trade_records is empty, harden SQL for older schemas, and show per-exchange sync errors in the archive UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
Unify gate_bot with shared enrich_trend_plan for strategy pages and hub monitor, reconcile DCA avg with live entry price, and fix missing fill price display.
Co-authored-by: Cursor <cursoragent@cursor.com>
Align running-plan header and DCA table with risk-budget RR, record actual fill prices after each leg, and save pre-close snapshots on stop/TP/handoff across hub and exchanges.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Query trade_records with trading-day window and reviewed fields instead of missing session_date column
- Style summary headings and account names as red text with white stroke
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add 15-day fund snapshot store and /api/hub/account on all instances
- Summary includes yesterday/today trades, fund columns, and section 5 操作建议
- Chat context distinguishes empty positions from local monitors
- Support image/document attachments in AI chat
Co-authored-by: Cursor <cursoragent@cursor.com>