[Bug] 财务页切换标的时只显示当前标的数据

Open Beginner friendly
#107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, react, typescript
Domain
frontend

Research direction

Start in packages/ui/src/components/workspace/FinancialsView.tsx around lines 26-55, where the new request keeps the previous symbol's state; make displayed metrics keyed to the current symbol and show loading/placeholder values while requests are pending. Read NewsView.test.tsx for the installHappyDom, TestI18n and mock-client patterns, then run bun test --isolate packages/ui/src/components/workspace. Cover valuation and profile resolving in either order, failure of the new symbol's request, and rapid consecutive switches; done means no metric from a prior symbol remains visible.

Written by the indexing model from the issue text.

Description

area:desktop bug help wanted

The financials tab can mix the previous stock's metrics with the newly selected stock's data.

复现

先为 AAPL.US 返回 PE = 43.21 和 EPS = 6.78。切换至 MSFT.US,用两个可控 Promise 暂停财务请求。在离线组件复现中,两组旧值仍在表格里。先完成新标的估值请求后,表格继续把 MSFT.US 的 PE = 25.00 与上一标的的 EPS = 6.78 显示在一起。

验收标准

  • 标的切换后,等待中的字段显示加载或占位状态。部分结果先到时,每个已显示的财务值仍与当前标的对应。
  • 用模拟客户端测试估值和资料先后返回,并覆盖新标的请求失败、快速连续切换的情形。

源码与测试入口

  • FinancialsView 发起新请求时仍保留上一组 state。 财务页面加载逻辑
  • 可参照同目录的 installHappyDom、TestI18n 和 mock 客户端,使用 bun test --isolate packages/ui/src/components/workspace 验证。 工作台组件测试示例

欢迎评论 /claim 认领。PR 请关联本 Issue,并附上实际执行的测试命令和结果。 贡献指南

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
8h 8m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.