feat: wire dynamic payload factory into web serve - #27
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
变更说明存在“本地数据”表述与实际 loader.load() 行为不一致的问题,且缺少对 CLI web serve wiring 的单元测试覆盖。
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
该 PR 将 CLI 的 web serve 从“启动时生成一次 payload”改为“每次 HTTP 请求动态生成 payload”,以便页面自动刷新时能反映最新数据/状态。
Changes:
- 在
src/goratio/cli.py引入make_web_payload()并将其作为payload_factory传入serve_dashboard - 更新
CHANGELOG.md与.planning/ROADMAP.md,记录 CLI 已接入动态 payload factory
File summaries
| File | Description |
|---|---|
| src/goratio/cli.py | 将 web serve 改为通过 payload_factory 每次请求生成 payload |
| CHANGELOG.md | 追加发布说明,描述 web serve 的动态刷新能力与 CLI 接入情况 |
| .planning/ROADMAP.md | 勾选完成项:CLI web serve 已接入动态 payload_factory |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - `contracts portfolio` CLI:从合约 CSV 直接运行批量持仓高层汇总; | ||
| - `web serve` 支持 `payload_factory`,每次请求重新生成页面,实现真正自动刷新。 | ||
| - `web serve` 支持 `payload_factory`,每次请求重新生成页面,实现真正自动刷新; | ||
| - CLI `web serve` 已接入动态 payload_factory,每次请求重新加载本地数据。 |
Comment on lines
560
to
+565
| if args.web_command == "serve": | ||
| serve_dashboard(payload, host=args.host, port=args.port) | ||
| serve_dashboard( | ||
| payload_factory=make_web_payload, | ||
| host=args.host, | ||
| port=args.port, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLI web serve 每次请求重新加载本地数据并生成页面。