refactor(tui): extract components infra and services layers#183
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
test(tui): improve coverage for bridge and infra helpers
|
@creatang CI 失败了。 |
- Relax shell menu newline assertion on Windows (CJK paths cause wrapping) - Increase workspace command executor timeout from 5s to 15s for Windows
filepath.Abs returns a path with NUL on Linux instead of erroring. Add explicit NUL check to match the test expectation and prevent invalid paths from leaking through.
|
internal/tui/infra/workspace_exec.go:20 新的 infra 命令执行器还没接到真实 App 路径上,当前运行中的 & 命令仍走 internal/tui/input_features.go:46 这套旧实现。结果是 PR 引入了两份同职责逻辑,测试覆盖的是新副本,不是线上路径。 |
我是拆分了tui原本架构,分多个pr提交,最后的是没有复用的。 |
背景:把渲染、基础设施、外部对接从核心状态机中拆离。
本次改动:
新增 internal/tui/components/:原子渲染组件(仅输入数据,输出字符串)。
新增 internal/tui/infra/:剪贴板、Markdown 渲染缓存、工作区执行/扫描等底层能力。
新增 internal/tui/services/*:runtime/provider/command/file 服务封装,统一 tea.Cmd/tea.Msg 边界。
补充对应单测。
影响范围:仅 internal/tui,不触及 runtime/provider 业务实现。
验证:
go test ./internal/tui/... ./internal/app
风险与回滚:
中低风险(目录迁移+封装);可按 PR 粒度回滚。