Skip to content

refactor(tui): extract components infra and services layers#183

Merged
minorcell merged 10 commits into
1024XEngineer:mainfrom
creatang:codex/tui-split-02-adapters-infra-services
Apr 7, 2026
Merged

refactor(tui): extract components infra and services layers#183
minorcell merged 10 commits into
1024XEngineer:mainfrom
creatang:codex/tui-split-02-adapters-infra-services

Conversation

@creatang

@creatang creatang commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

背景:把渲染、基础设施、外部对接从核心状态机中拆离。
本次改动:
新增 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 粒度回滚。

@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

@minorcell

Copy link
Copy Markdown
Member

@creatang CI 失败了。

creatang added 2 commits April 7, 2026 19:41
- 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.
@phantom5099

Copy link
Copy Markdown
Collaborator

internal/tui/infra/workspace_exec.go:20 新的 infra 命令执行器还没接到真实 App 路径上,当前运行中的 & 命令仍走 internal/tui/input_features.go:46 这套旧实现。结果是 PR 引入了两份同职责逻辑,测试覆盖的是新副本,不是线上路径。
internal/tui/services/file_service.go:40 ResolveWorkspaceDirectory 把旧 /cwd 逻辑里的“路径必须存在且必须是目录”校验丢掉了。等 core 真切到这层后,UI 会接受无效工作区路径。

@creatang

creatang commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator Author

internal/tui/infra/workspace_exec.go:20 新的 infra 命令执行器还没接到真实 App 路径上,当前运行中的 & 命令仍走 internal/tui/input_features.go:46 这套旧实现。结果是 PR 引入了两份同职责逻辑,测试覆盖的是新副本,不是线上路径。 internal/tui/services/file_service.go:40 ResolveWorkspaceDirectory 把旧 /cwd 逻辑里的“路径必须存在且必须是目录”校验丢掉了。等 core 真切到这层后,UI 会接受无效工作区路径。

我是拆分了tui原本架构,分多个pr提交,最后的是没有复用的。

@minorcell minorcell merged commit f56458b into 1024XEngineer:main Apr 7, 2026
2 checks passed
@creatang creatang deleted the codex/tui-split-02-adapters-infra-services branch April 15, 2026 11:32
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.

3 participants