Skip to content

feat: 增加原生自选与持仓热力图 - #365

Merged
helsome merged 5 commits into
helsome:mainfrom
wenyuxuan19-stack:feat/333-portfolio-heatmap
Oct 27, 2026
Merged

helsome merged 5 commits into
helsome:mainfrom
wenyuxuan19-stack:feat/333-portfolio-heatmap

Conversation

@wenyuxuan19-stack

@wenyuxuan19-stack wenyuxuan19-stack commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Add the native versioned-snapshot heatmap to Today watchlists and Portfolio holdings, with canonical instrument identity, industry groups, equal/value-proportional areas, an accessible fixed change legend, provenance and freshness states, a synchronized table, and mouse/keyboard navigation into company research.
  • Reuse the existing provider router and market-data cache/scheduler with bounded concurrency and cancellation. Portfolio quantities and valuations remain local; only canonical instrument lookups use the existing gateway. Long-only area sizing excludes shorts and zero exposure with explicit explanations.
  • Add fixture-backed boundary, router/cache, IPC ownership, UI, and browser tests; document reproducible measurements and include screenshots of the real components.

Closes #333

Verification

Environment: Windows 11 Pro 10.0.26300, Intel i5-12600KF, Bun 1.4.2, Node 24.13.0, Edge 156.0.4314.42.

  • bun install --frozen-lockfile --ignore-scripts: passed.
  • bun test --isolate packages/core/src/heatmap.test.ts packages/shared/src/heatmap/service.test.ts packages/shared/src/agent/market-data-service.test.ts packages/shared/src/agent/agent.test.ts packages/shared/src/providers/massive/massive.test.ts packages/shared/src/providers/yahoo/yahoo.test.ts packages/ui/src/components/heatmap/HeatmapPanel.test.tsx apps/electron/src/main/kernelHost.test.ts: 146 passed, 0 failed, 494 assertions.
  • bun run typecheck: core, i18n, shared, ui, electron passed.
  • bun run i18n:check: 1541 keys per locale, 0 issues.
  • (cd apps/electron && bun x vite build && bun run build:main): passed; Vite reports its existing >500 kB chunk advisory.
  • node apps/electron/e2e/heatmap-smoke.mjs: 10 passed, 0 failed; real component and ResearchPanel, six real catalog identities with fixture data, mouse/keyboard navigation, percentage formatting, equal/weighted areas, mobile viewport, and 100 rendered tiles.
  • bun test --isolate packages/core packages/i18n packages/shared packages/ui apps/electron: 1959 passed, 1 timed out. packages/shared/src/agent/pi-rpc-restart.test.ts times out at 5000ms in the real child-process JSONL test; independently reproduced unchanged on clean upstream ec0b8d2791f343495533a7425e6d3ecab97977b2 (9 pass, same 1 timeout); that test file is unchanged in current main 9afa4604e71a008391622b13a5415c87a9721e90.
  • Secret-pattern scan on changed non-test code and git diff --check: passed.

The integration path was tested with fixture HTTP responses through the real Massive adapter, router, and shared cache. Live provider credentials and live model calls were not used.

Screenshots

Equal areas
Equal-area heatmap

Portfolio market-value areas and weights
Market-value heatmap

Table view
Heatmap table

Keyboard navigation into company research
Company research destination

390px viewport
Mobile heatmap

Reproducible details

See docs/heatmap.md for complete behavior and commands. The browser harness uses real catalog identities but synthetic quotes, positions, and some industries; it explicitly does not claim live provider/model verification. The 100-instrument measurements are fixture timings, not provider latency guarantees.

@helsome

helsome commented Oct 27, 2026

Copy link
Copy Markdown
Owner

考虑看一下 tradingview 的热力图构造,目前的略丑😂

helsome commented Oct 27, 2026

Copy link
Copy Markdown
Owner

感谢实现!功能先合入。后续请参考 TradingView 的热力图设计(配色、方块布局、行业分组标题、字体层级等)打磨一下视觉效果,目前的样式还不够好看,欢迎另开 PR 优化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2][产品] 增加原生自选/持仓热力图,支持行业分组与点击进入公司研究

2 participants