docs(spec): update automation design with review feedback

Key changes:
- Extend existing stores instead of creating new automationStore
- Use type adapter pattern instead of new type hierarchy
- Add explicit HandParamsForm parameter passing fix
- Add category mapping for 7 existing Hands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-03-18 15:14:36 +08:00
parent 552efb513b
commit c856673936

View File

@@ -87,7 +87,7 @@
desktop/src/
├── components/
│ ├── Automation/ # 新建目录
│ │ ├── AutomationPanel.tsx # 统一入口
│ │ ├── AutomationPanel.tsx # 统一入口(组合层)
│ │ ├── AutomationCard.tsx # Hand/Workflow 卡片
│ │ ├── AutomationFilters.tsx # 分类筛选
│ │ ├── ScheduleEditor.tsx # 可视化调度器
@@ -96,14 +96,19 @@ desktop/src/
│ │ └── ApprovalQueue.tsx # 审批队列
│ └── HandsPanel.tsx # 重构为 AutomationPanel 入口
├── store/
│ ├── automationStore.ts # 新建:统一状态管理
── handStore.ts # 保留:逐步迁移
│ ├── handStore.ts # 扩展:添加批量操作方法
── workflowStore.ts # 保留:工作流状态
│ └── automationCoordinator.ts # 新建:跨 store 协调层
├── types/
── automation.ts # 新建:统一类型定义
── hands.ts # 扩展:添加 CategoryType
│ └── automation.ts # 新建:类型适配器
└── hooks/
└── useAutomationEvents.ts # 新建WebSocket 事件 Hook
```
> **设计决策**: 不创建新的 `automationStore.ts`,而是扩展现有的 `handStore.ts` 和 `workflowStore.ts`
> 通过轻量级的 `automationCoordinator.ts` 进行跨 store 协调。这遵循了现有代码库的模式。
---
## 三、核心组件设计