-
Notifications
You must be signed in to change notification settings - Fork 5
refactor(tui): 按 feature-first 重组 packages/tui 目录与边界 #212
Copy link
Copy link
Closed
Labels
area:coreCore runtime and session stateCore runtime and session statearea:docsDocumentation and docs UXDocumentation and docs UXarea:toolsBuilt-in tools and tool runtimeBuilt-in tools and tool runtimearea:tuiTerminal UI and interaction layerTerminal UI and interaction layerenhancementNew feature or requestNew feature or requestneeds-triageIssue needs initial triageIssue needs initial triage
Metadata
Metadata
Assignees
Labels
area:coreCore runtime and session stateCore runtime and session statearea:docsDocumentation and docs UXDocumentation and docs UXarea:toolsBuilt-in tools and tool runtimeBuilt-in tools and tool runtimearea:tuiTerminal UI and interaction layerTerminal UI and interaction layerenhancementNew feature or requestNew feature or requestneeds-triageIssue needs initial triageIssue needs initial triage
背景
当前
packages/tui/src存在多种拆分维度并存(UI 区块、技术职责、命令域),导致目录语义不统一、模块边界模糊,维护成本逐步升高。现状问题
App.tsx体量过大(会话编排 + 状态接线 + 命令分发 + UI 装配),成为超级容器。bottom_pane/chatwidget/overlays(UI)+controllers/state/review(职责)+commands/mcp(业务域)。目标
将 TUI 重组为 feature-first 结构,统一边界与依赖方向:
建议目录(示例)
src/ app/ features/ session/ composer/ timeline/ review/ mcp/ shared/ ui/ lib/ types/分阶段实施建议
App.tsx:抽出useSessionRuntime、useApprovals、useModelSwitch等 hooks。controllers/*按归属迁入 feature 或shared/lib,逐步移除“controller”语义目录。验收标准
App.tsx明显瘦身,职责聚焦于组装 UI。