Files
mindfulness/spec_kit/Text Wrap/modules/integration/tasks.md
2026-02-10 11:39:33 +08:00

64 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# integration任务清单
> 目标:实现 `wrapText()` 统一入口并串联所有子模块,供 Home/Widget 使用。
## 0. 对齐与准备
- [x] 阅读并对齐口径
- [x] 阅读 `spec_kit/Text Wrap/modules/integration/spec.md`
- [x] 阅读 `spec_kit/Text Wrap/modules/integration/plan.md`
- [x] 阅读 `spec_kit/Text Wrap/spec.md` 的对外接口定义
## 1. 对外类型定义
- [x] 新建 `client/src/features/textWrap/types.ts`
- [x] 定义 `WrapTextInput`(与大 spec 对齐)
- [x] 定义 `WrapTextMeta`(包含 configVersion/fallback_type/overflow_type/reason/breaks/scoreTopTerms
- [x] 定义 `WrapTextOutput`
## 2. 实现 wrapText() 入口
- [x] 新建 `client/src/features/textWrap/wrapText.ts`
- [x] normalizeWhitespace固定策略 NORMALIZE
- [x] tokenize
- [x] ENtokenizeEN
- [x] TCsegmentGraphemes → Token[]
- [x] generateBreakpoints接入 forbiddenBreakRanges
- [x] 组装 scoring 的 lexicons
- [x] protectedPhrases 来自 constraints.protectedPhrases若有
- [x] 搜索:
- [x] APPsearchBestLayoutApp测量 mockablefontSpec 缺字段报错由 width-measurement 保证)
- [x] WIDGETsearchBestLayoutWidget默认 APPROX可选 MEASURE
- [x] 搜索失败/未覆盖 N
- [x] 调用 applyOverflowFallbackoverflowMode 默认APP=CLIPWIDGET=ELLIPSIS
- [x] 汇总输出 meta
- [x] configVersion
- [x] breaks若可得
- [x] scoreTopTermsdebug=true
- [x] fallback_type/overflow_type/reason
## 3. 导出
- [x] 新建 `client/src/features/textWrap/index.ts`
- [x] 导出 types 与 `wrapText`
## 4. 调整 Golden Tests 入口
- [x]`client/src/features/textWrap/golden/__tests__/golden.test.ts` 从测试 harness 切换为 `wrapText()`
- [x] 保持现有 fixtures 期望不变
## 5. 单测补充(最小)
- [x] 新建 `client/src/features/textWrap/__tests__/wrapText.integration.test.ts`
- [x] SYSTEM_DEFAULTmeta.fallback_type=SYSTEM_DEFAULT 且仍返回 lines/wrappedText
## 6. 收尾
- [x] `npm test`
- [x] `npx tsc --noEmit`
- [x] 将本 `tasks.md` 全部勾选完成
- [x] 更新 `spec_kit/overview.md`
- [x] 标记 `integration` 已完成(阶段性)
- [x] 写入变更文件清单