[Good first issue] 对比页显示行情源已提供的股息率

Open Beginner friendly
#103 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
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start in packages/shared/src/compare/service.ts around the row that produces Dividend Yield and see where it looks up the rate from dividend history only; then read packages/shared/src/capabilities/manifests/company-valuation.ts for the dpsRate contract, including how a zero value is represented. Add the valuation fallback so 0 still renders as a valid 0%, keep the missing state when neither source has a rate, and extend packages/shared/src/compare/compare.test.ts with both fixtures. Done is bun test --isolate packages/shared/src/compare/compare.test.ts passing with the new cases.

Written by the indexing model from the issue text.

Description

area:desktop bug good first issue help wanted

Compare displays a missing dividend yield even when the valuation capability returns one.

复现

让长桥估值行情的 fixture 返回 dps_rate: "2.5",同时让分红历史返回一条包含 ex_date 的 DividendRecord。解析和能力层输出已包含 company.valuation.data.dpsRate = 2.5,但离线调用 buildComparison() 后,Dividend Yield 单元格仍是 —,因为服务只在分红历史数据里查找股息率。

验收标准

  • 有有效的 company.valuation.dpsRate 时,对比页把 2.5 展示为 2.5%。确认 0 也能作为有效值展示。
  • 两种来源均缺少股息率时保留缺失态,并用已有的显式 dividendYield fixture 做兼容回归。

源码与测试入口

欢迎评论 /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.