Skip to content

fix(portfolio-import): 支持分号分隔 CSV - #414

Merged
helsome merged 1 commit into
helsome:mainfrom
wannT-1:fix/portfolio-import-semicolon
Nov 12, 2026
Merged

helsome merged 1 commit into
helsome:mainfrom
wannT-1:fix/portfolio-import-semicolon

Conversation

@wannT-1

@wannT-1 wannT-1 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

What

组合 CSV 导入现在把未加引号的 ; 识别为分隔符。csvDelimiter、splitCsvLine 和 resolveCsvColumns 的分隔符类型包含 ;。引号内的分号(包括转义引号)仍留在同一个单元格里。

Why

欧洲区域 Excel「另存为 CSV」常用分号作分隔符。原先 csvDelimiter 只识别逗号和制表符,整行被当成一列,symbol、quantity、cost 无法分开。

本改动只覆盖分隔符检测与切分,不改变欧洲小数点或千分位的数字语义,也不包含 #356–#360 的解析改动。

关联 Issue

Closes #408

测试报告(正式审核前必填)

环境

  • Bun:1.4.4
  • OS:Linux 6.12.94+

实际执行命令与结果

bun test packages/shared/src/portfolio-import
→ 104 pass / 0 fail(4 files,273 expect)

bun run --filter @finagent/shared typecheck
→ @finagent/shared typecheck: Exited with code 0

已知失败 / Baseline(如有)

  • 无

  • 已提供实际测试命令与 pass/fail 结果

  • 已说明测试环境

  • 如果存在已知 baseline / 环境失败,已提供 main 对照或说明

  • 核心改动已有对应 focused test / smoke / integration 验证

UI 截图(仅可见 UI 变化时必填)

  • 本 PR 无可见 UI 变化(无需截图)
  • 本 PR 有可见 UI 变化,已提供修改后的 UI 截图
  • 已提供 Before / After 对比截图(适用时)

Scope / 后续

仅 delimiter 检测与切分。欧洲千分位/小数点数字语义不在本 PR。

@helsome
helsome merged commit 15a0fd2 into helsome:main Nov 12, 2026
wannT-1 added a commit to wannT-1/folio that referenced this pull request Nov 17, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(portfolio-import): 欧洲 Excel 分号分隔 CSV 被整行当成单列

2 participants