feat: 市场搜索 + 品种 chip 拉取错误展示 (#105) - #110
Merged
Merged
Conversation
品种选择器不再内置默认品种列表,完全依赖 controller 的 symbolCatalog 信号从注册数据源获取,消除客户端硬编码兜底。
Default single-arg Effect.tryPromise wraps rejections in UnknownException,
swallowing the original error message. Switch to { try, catch } overload
to preserve Error/KLineChartError instances as-is.
Add regression test verifying fetcher error messages appear in logs.
Require normalized market identity across symbols, search results, caches, and semantic config. Add per-chart session registries and route gotdx Hong Kong time-share data without allowing unsupported search rows to poison valid results. Refs #105
Empty data (e.g. ETF without gotdx history) is a valid server response. Downgrade from Effect.fail to logWarning so the chart renders empty instead of rejecting the fetch.
Specify buffer-owned lastError signal and native chip title for explicit K-line Effect failures.
Record DataBuffer lastError on explicit Effect failures, expose chart dataError, and use it as the SymbolSelector native title while the warning icon is shown.
Place the warning icon and failure reason inside a pill-shaped tag on the symbol chip, with ellipsis and native title for overflow.
Use fallback 加载失败 when dataError is empty, and keep the error pill from collapsing to icon-only under chip flex constraints.
Successful empty fetch results now set DataBuffer lastError so the symbol chip shows 暂无K线数据 instead of the generic 加载失败 fallback.
3 tasks
Pure fund queries (e.g. 国泰中) returned only exchange=FUND rows. normalizeGotdxMarket rejected them all, so search threw and the UI showed 搜索失败 despite a successful API response. Map mainland fund/money extended exchanges to CN; keep futures and other unsupported exchanges rejected.
Search no longer fails when gotdx returns exchanges without a market session (e.g. EX-0, FUTURES). Rows are listed with empty market; chart selection surfaces 暂不支持该品种 instead of blank 搜索失败.
Propagate backend error body from history-tick HTTP failures and record TimeShareBuffer.lastError so chips can show messages like 「该日期暂无历史分时数据」; clear on successful reload.
Timeshare legend omitted volume and used bare short numbers; price/avg strokes were 2/1.5 vs 1px indicator convention after DPR scale. - Append 手 to timeshare volumeText; render it in preview legend - Draw price and average lines at 1px logical width - Cover both with unit tests
…ng metrics - TimeShareData.volume / amount改为可选字段 - gotdx适配器仅映射后端返回的Volume/Amount, 不再用 Price*Vol伪造成交额 - 分时渲染器仅在有 volume时保留25%量柱区域, 否则价格区占满pane - Canvas图例仅在字段非空时绘制成交量/成交额标签 - 新增个股/指数/amount-only分时的回归测试 Closes the data-synthesis issue: upstream-不可确认的指标不再伪造为0或NaN展示.
Owner
Author
新增提交(自 PR 描述后补充)分时成交量和成交额去伪(#105 数据完整性)核心改动(
配套修复:
|
Align AGENTS.md comment style rules with project convention: Chinese body, English technical terms, file header comments, function docs, and inline comments.
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.
摘要
推进 #105 的 market/session 半程,并在 Vue 品种 chip 上展示主品种 K 线拉取失败原因。
SymbolSpec.market必填;每个 Chart 持有独立的MarketSessionRegistry(内置CN/HK/US);Vue / React / Angular 可按实例覆盖。params.category→ ex API,params.market→ stock API(不按代码 / exchange 猜测)。/api/ex/history-tick→{ preClose, data };约 330 槽,时间轴末端 16:00。[]仅 warning;DataBuffer.lastError = 暂无K线数据;chip 显示图标 + 文案(无圆角外层 tag)。dataError透出原始 message。关联后端
KlineChartQuantGo分支feat/issue-105-market-search(ex history-tick)Issue
关联:#105
测试计划
自动化(本地已跑)
SymbolSelector.errorTitle测试pnpm type-check— 已知vue-tsc/ TS 崩溃(与本 PR 无关)pnpm test:unit— 根配置排除packages/**(请用包内测试)E2E 任务 — gotdx Fetcher 矩阵(issue #105)
1. gotdx 指数
000001上证指数 /399001深证成指)source=gotdx、market=CN,以及后端返回的params.market+ 指数kind2. gotdx 个股
600519/000001平安银行 — 注意与同代码指数区分)market=CN,params.market属于{0,1,2}{ preClose, data }形态正确;preClose > 03. gotdx ETF、基金、REITS
510300/159915/ 已知空数据158017)market已归一化,或作为不支持项被过滤暂无K线数据(不是笼统「加载失败」)exchange=FUND(及 ETF/REITS kind)映射到统一 market,并走对 stock vs ex 路由4. gotdx 港股
00700腾讯)market=HK,params.category+params.kind=exkline-by-date(不走 stock market 路由)history-tick;时间轴末端 16:00;日盘约 330 槽5. gotdx 新三板
params.market属于{0,1,2}时预期market=CN(当前与主板 stock 同路径)params.market的 stock history-tickUI 冒烟(chip / 搜索)
[]→ chip 文案暂无K线数据手工对照表
范围外 / 后续
158017空数据)主要提交
fcdbcafmarket-aware symbol sessions / gotdx 归一化c50aecd空 K 线仅 warning7327e06…ae4098bchip 拉取错误 +暂无K线数据