Commit Graph

188 Commits

Author SHA1 Message Date
dekun 9602acafb2 feat: restyle fund overview with HUD UI and nav reorder
Move funds before monitor in nav while keeping monitor the default landing page; use card layout with curves in fullscreen and a tech/AI-themed funds dashboard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 17:12:58 +08:00
dekun ec8607932b feat: circular fund account cards with fullscreen detail view
Show per-exchange balances as clickable circles with mini curves; open a fullscreen panel for equity history and drawdown.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 17:04:21 +08:00
dekun ba629ea0ee fix: fund overview history starts from 2026-06-09
Add HUB_FUND_HISTORY_START_DAY so curves and drawdown exclude snapshots before the baseline trading day.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 16:58:57 +08:00
dekun 77c7bbbb13 feat: add hub fund overview tab with 180-day equity curves
Add /funds page for total and per-account balance (funding+trading), drawdown, and daily snapshots from monitor board aggregation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 16:50:47 +08:00
dekun 6eb17b7ddc feat: add trading day split lines on hub market chart
Add toggle before technical indicators to show blue dashed vertical lines at Beijing 8:00 day boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 08:35:35 +08:00
dekun 02d2a6c70b fix: mobile hub AI keyboard layout and instance top nav scroll
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>
2026-06-09 17:16:00 +08:00
dekun e60beeedd3 feat: fix mobile AI full-width layout and simplify instance stats
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>
2026-06-09 16:57:47 +08:00
dekun ea3ef71477 feat: optimize hub mobile layout with chat-first AI coach tabs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 16:47:19 +08:00
dekun 38f4280bb8 fix: UTC+8 market chart times and archive full history K-line load
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:55:48 +08:00
dekun 55a979eee5 fix: show archive chart times in UTC+8 and parse Beijing wall clock
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:47:09 +08:00
dekun 947b58084d ui: add Top20 button to market chart fullscreen toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:37:05 +08:00
dekun 5fb4a10638 ui: show Top20 rank sheet below toolbar instead of over chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:11:11 +08:00
dekun 4c55932906 fix: Top20 dropdown floats above chart with fixed positioning
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:08:05 +08:00
dekun 93b84da72e fix: invalidate stale 12-item volume rank cache and force full top20 refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:01:27 +08:00
dekun 4bf0c2363f feat: daily volume top20 rank per exchange in market page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 15:46:36 +08:00
dekun 09eb9dc475 ui: remove crosshair, channel and text tools from draw toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 13:05:37 +08:00
dekun 94679f10d0 feat: right-click context menu and Delete key for chart drawings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 13:02:28 +08:00
dekun d659cf7a4c fix: TV-style fib colors, range badge, polyline preview, one-shot tools
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:57:23 +08:00
dekun ef57ba13c5 fix: drag-to-draw for range and fibonacci like TradingView
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:50:25 +08:00
dekun ef57872d14 fix: market drawing tools overlay alignment and pointer handling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:45:47 +08:00
dekun 26a4c04b88 feat: add vertical drawing toolbar on market chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:41:52 +08:00
dekun ca6ef59a14 Add clear-and-refetch for hub K-line cache.
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>
2026-06-08 11:31:16 +08:00
dekun 2095839fc3 Fix hub chart skipping remote fetch when DB bars are discontinuous.
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>
2026-06-08 11:27:00 +08:00
dekun 440d1ecbc9 Fix discontinuous hub chart candles from orphaned DB bars.
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>
2026-06-08 11:21:01 +08:00
dekun b34aefbcc4 Patch tail candles without resetting chart viewport.
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>
2026-06-08 08:39:56 +08:00
dekun 5af0cbf286 Fix chart auto toggle to clearly split follow vs manual zoom.
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>
2026-06-08 08:35:56 +08:00
dekun bae78d8368 Respect manual chart zoom when auto-follow is off.
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>
2026-06-08 08:30:44 +08:00
dekun 3ac854d74c Remove 12h timeframe and stabilize chart wheel zoom.
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>
2026-06-08 07:54:37 +08:00
dekun 41bdee2416 fix(hub): green open arrows for long, red for short on archive chart
Explicit open marker colors and broader direction parsing (short/空/sell).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 23:43:21 +08:00
dekun 69f554214c feat(hub): auto-mark all archive trades on chart
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>
2026-06-07 23:26:57 +08:00
dekun 5ceacd8077 fix(hub): load full pre-entry history for archive chart pan/zoom
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>
2026-06-07 23:20:37 +08:00
dekun 54c0b169c7 feat(hub): add open/close arrows on archive chart with continuous klines
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>
2026-06-07 23:14:40 +08:00
dekun 3052607280 fix(hub): merge strategy snapshots into archive for gate_bot
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>
2026-06-07 23:02:46 +08:00
dekun 6a56928d59 feat(hub): add symbol archive with permanent 5m klines
Add /archive page, hub_symbol_archive.db, trade overlay, 4h background sync, and instance /api/hub/trades/archive. Document in hub-symbol-archive-kline.md with cross-links.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 22:51:48 +08:00
dekun f51d1c413a feat(hub): show funding, trading account and unrealized PnL on monitor cards
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 10:14:44 +08:00
dekun bee9539852 fix(hub): use cyan accent in AI chat markdown
Apply accent color to chat headings, bold text, and coach role label instead of purple.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:19:37 +08:00
dekun b98efbd27d fix(hub): use cyan accent for AI summary headings in dark theme
Keep wine-red emphasis in light theme; align dark mode with the hub color system.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:16:36 +08:00
dekun b828026c23 fix(hub): refine AI summary heading style for light and dark themes
Replace red text with white stroke by theme-aware accent bar and soft background tint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 09:12:29 +08:00
dekun f8220762c0 fix(hub): align AI summary trades with records and restyle headings
- 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>
2026-06-07 09:07:16 +08:00
dekun 62e48dab92 feat(hub): enrich AI coach with fund history, closed trades, and chat uploads
- 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>
2026-06-07 08:54:20 +08:00
dekun 51c59b073b fix(hub): simplify AI coach header actions
Hide model name labels and style New Chat as a primary button matching Generate Summary.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:40:58 +08:00
dekun dfcf0f88fb fix(hub): add section icons and color PnL in AI summary table
Show emoji headings for overview, accounts, alerts, and data notes; apply green/red styling to table PnL columns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:33:44 +08:00
dekun a5f5239be9 feat(hub): render AI summary account breakdown as icon table
Replace pipe-separated account lines with a structured table from stats_snapshot, including exchange icons and position remarks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:28:24 +08:00
dekun 8417784dd8 fix(hub): render AI coach summary and chat as Markdown
Reuse shared ai_review_render.js so summaries and coach replies display formatted lists and bold text instead of raw syntax.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:23:44 +08:00
dekun 821e260912 fix(hub): keep AI coach page within one viewport
Lock page height and scroll summary/chat inside equal panels instead of extending the document.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:15:40 +08:00
dekun ebadcb1119 fix(hub): polish AI coach UI with PnL colors and chat roles
Equal-height summary/chat panels, colored closed/float PnL, owner/coach labels, and optimistic thinking state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 00:10:50 +08:00
dekun cee641ba5d feat(hub): add AI coach page with daily summary and chat
Aggregate four-account trades via hub_ai module and /api/hub/trades/today; store sessions in JSON; default OpenAI config matches instances.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 23:51:36 +08:00
dekun 995ee8d2e1 fix: prevent theme flash when navigating instance pages from hub iframe
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 13:23:51 +08:00
dekun 934e48b9a8 fix: show risk amount only in full-margin mode across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 09:08:45 +08:00
dekun 806350231e fix(hub): show contract-based unrealized PnL in monitor and chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:20:36 +08:00