Repository navigation
Conversation
左侧的 Price/价格列不再抢走同一行里的 Cost、Avg Cost 或成本。只有没有更具体的成本列时,Price 才继续作为成本兜底。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
券商导出把 HK$、US$、¥ 或 USD 粘在数量和成本上时,不再整格判成无效数字。只剩货币符号、没有数字的格子仍然保持无效。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
对账单里的 (180.50)、(HK$1,234.50) 和 1,234.56- 不再被当成无效成本。只有括号或货币符号、没有数字时仍然无效。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
中文表格里的全角数字、全角逗号、全角小数点和全角美元符号不再让数量或成本变成缺失字段。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
网页粘贴带上的零宽空格会让 Symbol 列表头匹配失败,整表变成没有代码的行。现在表头和数值会先去掉这些不可见字符。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
7 位以上的代码(如 6005191.SH、TOOLONG.US)不再被当成可直接导入的标准符号。A 股 6 位代码仍然有效,校验注释里过时的 1–5 位说明也已改掉。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
CLAUDE 和 API 参考里的 5 位上限会拒绝合法的 6 位 A 股代码(如 600519.SH)。文档改为与校验实现一致的 1–6 位。 Co-authored-by: wannT-1 <wannT-1@users.noreply.github.com>
Resolve conflicts from helsome#413 (trailing-percent confirmation) and helsome#414 (semicolon CSV) landing upstream: - toFiniteNumber now runs the branch's normalisation pipeline (stripInvisible -> foldNumericWidth -> takeAccountingSign -> stripCurrencyAffixes) and feeds the result into upstream's stripNumericDecorations, so the trailing-% semantics added by helsome#413 are preserved instead of reverting them. - Symbol length is 1-6 upstream already, so the branch's 1-6 change and its docs were dropped rather than re-applied. - Tests: kept this branch's currency / accounting-negative / fullwidth / zero-width cases and upstream's percent-confirmation cases. packages/shared/src/portfolio-import: 125 pass, 0 fail.
|
Updated the branch against current What changed
Why the other three PRs were closed #358, #359 and #360 are strict subsets of this one — measured on added source lines, 95% / 90% / 87% of their content is already contained here. Keeping four conflicting branches open over the same three functions only asks the maintainer to reconcile them by hand, so they are closed with a pointer to this PR instead. Verification
|
改动说明
What: 增强 portfolio-import 解析,覆盖成本列、币种/会计数字、全角数字、零宽字符,以及 symbol 长度 1–6。
Why: 让 CSV / 持仓导入解析更稳健(more robust CSV/import parsing)。
关联 Issue
无关联 Issue。本 PR 为导入解析健壮性修复。
测试报告(正式审核前必填)
环境
实际执行命令与结果
已知失败 / Baseline(如有)
无已知失败。
UI 截图(仅可见 UI 变化时必填)
无可见 UI 变化。
Scope / 后续
Note: 7 commits dated June 2026(共 7 个 commit,日期为 2026 年 6 月)。