diff --git a/README.md b/README.md index 8cf8c2f..2cfe27d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![npx](https://img.shields.io/badge/npx-epcode-orange)](./tools/cli/) [![License](https://img.shields.io/badge/license-MIT-green)]() -> 📍 **最新进展**: Phase 1 已完成(v0.6.0 · 5 Sprint · 整体完成度 98%)。Phase 2 启动 · Sprint 6 ⑥ UI/UX 设计稿完整首发(**[🎨 11 个 HTML 原型](./docs/design/ui/prototype/)** + 10 wireframes + 5 flows + 映射表)。 +> 📍 **最新进展**: Phase 1 完成(v0.6.0 · 整体 98%)。Phase 2 · Sprint 6 ⑥ UI/UX 扩展中 · **[🎨 17 个 HTML 原型](./docs/design/ui/prototype/)**(完整用户旅程: 登录 → 选项目/新建(4 模式)→ 主视图 → 场景工作流 + Prompt 一键操作)。 > > - 🧰 [统一 CLI · epcode](./tools/cli/) · 10 个子命令,零依赖 `npx epcode --help` > - 🌐 **[文档站 · epcode-ai.github.io/ep-code-ai](https://epcode-ai.github.io/ep-code-ai/)** ✅ 已上线 · 首页以 4 接入模式为一等公民 diff --git a/docs/design/ui/README.md b/docs/design/ui/README.md index a0b549c..4e90c83 100644 --- a/docs/design/ui/README.md +++ b/docs/design/ui/README.md @@ -60,8 +60,9 @@ | 8 | [conversation-context-menu.md](./wireframes/08-conversation-context-menu.md) | 会话右键菜单 + 收藏 + 分组 | | 9 | [empty-states.md](./wireframes/09-empty-states.md) | 各种空状态 | | 10 | [env-status-bar.md](./wireframes/10-env-status-bar.md) | 持久化环境健康状态栏 | -| **11** | [**登录**](./wireframes/11-login.md) | 企业 SSO + IM 扫码 + 账号密码(Sprint 6 新增) | -| **12-15** | [**四大场景工作流**](./wireframes/12-15-workflow-scenes.md) | 业务/开发/测试/运维 角色视角(Sprint 6 新增) | +| **11** | [**登录**](./wireframes/11-login.md) | 企业 SSO + IM 扫码 + 账号密码 | +| **12-15** | [**四大场景工作流**](./wireframes/12-15-workflow-scenes.md) | 业务/开发/测试/运维 角色视角 + Prompt 一键操作 | +| **16-17** | [**项目列表 + 新建项目向导**](./wireframes/16-17-projects-and-new-project.md) | 4 种接入模式(A/B/C/D)的 GUI 入口 ⭐ | ### Interaction Flows(交互流程,5 个 Mermaid) diff --git a/docs/design/ui/prototype/01-main-three-pane.html b/docs/design/ui/prototype/01-main-three-pane.html index cba6ac8..98fe1f8 100644 --- a/docs/design/ui/prototype/01-main-three-pane.html +++ b/docs/design/ui/prototype/01-main-three-pane.html @@ -14,9 +14,19 @@
- +
- EP Code AI + 🚀 EP Code AI + + / + + +
+ 离职流程优化 + A · 绿地 + +
+
- +
- + - +
@@ -167,9 +177,9 @@
- +
-
📦 Artifacts (2)
+
📦 产出物 (2)
@@ -192,7 +202,7 @@
- +
✅ 环境正常 · Node v20 / Claude Code v1.2.3 Anthropic · 240ms diff --git a/docs/design/ui/prototype/03-settings.html b/docs/design/ui/prototype/03-settings.html index 4881224..c60fe42 100644 --- a/docs/design/ui/prototype/03-settings.html +++ b/docs/design/ui/prototype/03-settings.html @@ -144,7 +144,7 @@

设置

- +

通用设置

@@ -185,7 +185,7 @@

数据

- +

供应商管理

@@ -220,7 +220,7 @@

供应商管理

- +

快捷键

@@ -243,7 +243,7 @@

输入

- +

实验性功能 ⚗️

⚠️ 以下功能不稳定,启用前请知悉风险

diff --git a/docs/design/ui/prototype/05-artifact-panel-expanded.html b/docs/design/ui/prototype/05-artifact-panel-expanded.html index 44cb909..84b4659 100644 --- a/docs/design/ui/prototype/05-artifact-panel-expanded.html +++ b/docs/design/ui/prototype/05-artifact-panel-expanded.html @@ -2,7 +2,7 @@ -05 · Artifact 全屏 · EP Code AI +05 · 产出物全屏 · EP Code AI + + + +
+ 🎨 原型 17 · 新建项目向导 · 选接入模式 → 填基本信息 → 完成 + ← 返回 · 上页(项目列表) +
+ + +
+
+ ◀ 返回项目列表 + | + 新建项目 +
+ +
+ 张工 +
+
+ +
+ + +
+
1. 选接入模式
+
2. 项目基本信息
+
3. 起步清单预览
+
4. 初始化完成
+
+ + +
+

你的项目处于什么阶段?

+

+ 选对接入模式,框架才能给你最合适的引导。不确定?可以看每张卡片下面的判定条件。 +

+ +
+ +
+
A
+
+
绿地项目
+
全套上车 · 从 0 开始建
+
+ 判定: 项目刚立项,尚未开始编码 · 团队愿意从 Day 1 走规范 +
适合: 新业务 / 创新项目 / 独立新系统 +
+
+
+ +
+
B
+
+
开发中项目
+
从现在追溯补齐
+
+ 判定: 代码已开始写,但未上线 · 零散 PRD / 设计 +
适合: 接手半成品 · 新项目改造 +
+
+
+ +
+
C
+
+
迭代中项目
+
每版本加一层 · 渐进嵌入
+
+ 判定: 已上线,双周/月迭代 · 有成熟但不同的流程 +
适合: 老项目升级 · 存量业务改造 +
+
+
+ +
+
D
+
+
稳态运维项目
+
聚焦运维 · 只做关键层
+
+ 判定: 运行 1 年+,不再大版本迭代 · 只做 bug 修复 +
适合: 线上老系统 · 维护中的服务 +
+
+
+ +
+ +
+ 🤔 还不确定? 花 5 分钟阅读 + 接入模式判定流程, + 根据 5 个问题帮你定位。 +
+ 模式可随时切换(通过 epcode adopt 命令或在项目设置里改)。 +
+
+ + + + +
+ + + + + + + + + + + + + + diff --git a/docs/design/ui/prototype/index.html b/docs/design/ui/prototype/index.html index 1cb795d..107ff54 100644 --- a/docs/design/ui/prototype/index.html +++ b/docs/design/ui/prototype/index.html @@ -63,7 +63,7 @@ @@ -113,7 +113,7 @@

供应商切换浮层

07

全局搜索 ⌘K

-

会话 / Artifact / 命令 / 消息 · 分组结果

+

会话 / 产出物 / 命令 / 消息 · 分组结果

08
@@ -132,13 +132,23 @@

环境健康状态栏

-

身份与登录

+

用户旅程(登录 → 项目 → 主视图)

四大场景工作流(角色视角)

diff --git a/docs/design/ui/prototype/prototype-modules-map.md b/docs/design/ui/prototype/prototype-modules-map.md index 4f5c8ea..f24b0f6 100644 --- a/docs/design/ui/prototype/prototype-modules-map.md +++ b/docs/design/ui/prototype/prototype-modules-map.md @@ -25,6 +25,8 @@ | **13** | [**开发工作流**](./13-workflow-development.html) | 开发视角 | 设计→ADR→合入 · 7 步 | 共用 `WorkflowView.swift` | `skills/development/` 7 个 prompt | | **14** | [**测试工作流**](./14-workflow-testing.html) | 测试视角 | 策略→用例→准出 · 6 步 | 共用 | `skills/testing/` 8 个 prompt | | **15** | [**运维工作流**](./15-workflow-operations.html) | 运维视角 | 发布→事件→复盘 · 6 步 | 共用 | `skills/operations/` 8 个 prompt | +| **16** | [**项目列表**](./16-project-list.html) | 多项目切换 · 4 模式徽章 | 登录后入口 · 筛选 / 切换 / 新建 | **新增** `ProjectListView.swift`
`ProjectStore.swift`
`ProjectCard.swift` | CLI: `epcode init --mode=X` · 读 `docs/chapters/00-adoption/` | +| **17** | [**新建项目向导**](./17-new-project.html) | 4 模式初始化 | 选 A/B/C/D → 填信息 → 起步清单 → 完成 | **新增** `NewProjectWizardView.swift`
调用 `epcode init` | 复用 `tools/cli/scaffolds/mode-{a,b,c,d}/` | --- diff --git a/docs/design/ui/prototype/styles.css b/docs/design/ui/prototype/styles.css index 0af544b..3537f0f 100644 --- a/docs/design/ui/prototype/styles.css +++ b/docs/design/ui/prototype/styles.css @@ -795,3 +795,161 @@ body.with-banner .app { padding-top: 32px; } height: 1px; background: var(--color-border); } + +/* ============ 接入模式徽章(Sprint 6 新增) ============ */ + +.mode-badge { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 2px 8px; + border-radius: var(--radius-sm); + font-size: var(--fs-xs); + font-weight: 600; + border: 1px solid transparent; +} +.mode-badge.mode-a { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; } +.mode-badge.mode-b { background: #fff3e0; color: #e65100; border-color: #ffcc80; } +.mode-badge.mode-c { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; } +.mode-badge.mode-d { background: #f3e5f5; color: #4a148c; border-color: #ce93d8; } + +/* ============ 项目列表 / 切换 ============ */ + +.projects-wrap { + max-width: 1100px; + margin: 0 auto; + padding: 64px 24px 40px; +} +.projects-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + margin-bottom: var(--sp-6); +} +.projects-header h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-1); } +.projects-header p { color: var(--color-text-muted); font-size: var(--fs-lg); } +.projects-filter { + display: flex; + gap: var(--sp-2); + margin-bottom: var(--sp-5); + flex-wrap: wrap; + align-items: center; +} +.filter-chip { + padding: var(--sp-1) var(--sp-3); + border: 1px solid var(--color-border); + border-radius: var(--radius-xl); + font-size: var(--fs-sm); + cursor: pointer; + background: var(--color-bg); +} +.filter-chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); } + +.project-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: var(--sp-4); +} +.project-card { + padding: var(--sp-4); + border: 1px solid var(--color-border); + border-radius: var(--radius-lg); + background: var(--color-bg); + cursor: pointer; + transition: all 0.2s; + display: flex; + flex-direction: column; + gap: var(--sp-2); + text-decoration: none; + color: inherit; +} +.project-card:hover { + border-color: var(--color-primary); + transform: translateY(-2px); + box-shadow: var(--shadow-md); + text-decoration: none; +} +.project-card-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: var(--sp-2); +} +.project-name { font-size: var(--fs-lg); font-weight: 600; } +.project-meta { + font-size: var(--fs-sm); + color: var(--color-text-muted); + display: flex; + gap: var(--sp-3); + flex-wrap: wrap; +} +.project-last { + font-size: var(--fs-xs); + color: var(--color-text-muted); + margin-top: var(--sp-2); + padding-top: var(--sp-2); + border-top: 1px dashed var(--color-border); +} +.project-card.new-project { + border-style: dashed; + background: var(--color-bg-alt); + align-items: center; + justify-content: center; + min-height: 160px; + text-align: center; +} +.project-card.new-project:hover { + background: var(--color-primary-lightest); + border-style: solid; +} + +/* ============ 新建项目向导(模式卡片) ============ */ + +.mode-card-select { + padding: var(--sp-4); + border: 2px solid var(--color-border); + border-radius: var(--radius-md); + cursor: pointer; + transition: all 0.2s; + display: flex; + gap: var(--sp-3); + align-items: flex-start; +} +.mode-card-select:hover { + border-color: var(--color-primary); +} +.mode-card-select.selected { + border-color: var(--color-primary); + background: var(--color-primary-lightest); +} +.mode-card-select .letter { + font-size: 32px; + font-weight: 700; + width: 48px; + height: 48px; + border-radius: var(--radius-md); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + background: var(--color-bg); + border: 1px solid var(--color-border); +} +.mode-card-select .mode-a .letter, +.mode-card-select.mode-a .letter { background: #e8f5e9; color: #1b5e20; } + +/* ============ 顶栏项目切换器 ============ */ + +.project-switcher { + display: inline-flex; + align-items: center; + gap: var(--sp-2); + padding: var(--sp-1) var(--sp-3); + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + cursor: pointer; + font-size: var(--fs-sm); + background: var(--color-bg); +} +.project-switcher:hover { background: var(--color-bg-hover); } +.project-switcher .name { font-weight: 500; } diff --git a/docs/design/ui/wireframes/16-17-projects-and-new-project.md b/docs/design/ui/wireframes/16-17-projects-and-new-project.md new file mode 100644 index 0000000..db00546 --- /dev/null +++ b/docs/design/ui/wireframes/16-17-projects-and-new-project.md @@ -0,0 +1,168 @@ +# Wireframe 16-17 · 项目列表 + 新建项目(Sprint 6 新增) + +> 补齐 4 种接入模式(A/B/C/D)在 GUI 里的入口。这是框架的一等公民,不能只存在于 CLI 和文档里。 + +## 完整用户旅程 + +```mermaid +flowchart LR + A[登录 11] --> B[项目列表 16] + B -->|选已有项目| C[主视图 01] + B -->|+ 新建项目| D[新建向导 17] + D -->|1. 选模式| E[2. 填信息] + E --> F[3. 起步清单预览] + F --> G[4. 初始化成功] + G --> C + C --> H[场景工作流 12-15] + C -->|顶栏切换| B +``` + +## 16 · 项目列表 + +### 布局 + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ 🚀 EP Code AI 张工 · 产品 │ ① 顶部窄条 +├─────────────────────────────────────────────────────────────────┤ +│ │ +│ 我的项目 [+ 新建项目] │ ② 标题 + 新建 +│ 选一个项目进入,或新建项目 │ +│ │ +│ 筛选: [全部] [A·绿地] [B·开发中] [C·迭代中] [D·稳态运维] │ ③ 筛选条 +│ 排序: 最近访问 ▾ │ +│ │ +│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────┐ │ +│ │ 离职流程优化 [A] │ │ 支付服务 [D] │ │ 订单导出 [B] │ │ ④ 卡片网格 +│ │ 📁 12 📄 8 👥 3 │ │ 📁 32 📄 15 ⚠️ │ │ ... │ │ +│ │ 上次: 11 分钟前 │ │ 上次: 3h 前 │ │ │ │ +│ └──────────────────┘ └──────────────────┘ └──────────────┘ │ +│ │ +│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────┐ │ +│ │ 移动端App [C] │ │ 数据分析 [C] │ │ + 新建项目 │ │ +│ │ ... │ │ ... │ │ │ │ +│ └──────────────────┘ └──────────────────┘ └──────────────┘ │ +│ │ +│ ───────────────────────────────────────────────────────────── │ +│ 💡 什么是"接入模式"? │ ⑤ 帮助区 +│ [A 绿地] [B 开发中] [C 迭代中] [D 稳态] 四张小卡片 │ +└─────────────────────────────────────────────────────────────────┘ +``` + +### 卡片元素(必展示) + +| 元素 | 数据来源 | +|------|---------| +| 项目名 | 用户填(新建时)或从目录读 | +| 模式徽章 | A/B/C/D 色系区分 | +| 会话数 / 产出物数 / 成员数 | 本地统计 | +| 预警状态 | 如有 P1/P2 事件显示 ⚠️ | +| 简介 | 用户填 | +| 上次访问 | 本地缓存 | +| 当前阶段 | 项目上下文(如"业务/PRD 编写") | + +### 模式徽章配色 + +| 模式 | 色 | 使用场景 | +|------|---|---------| +| A · 绿地 | 绿(成长) | 新项目活力 | +| B · 开发中 | 橙(进行中) | 积极追赶 | +| C · 迭代中 | 蓝(稳定) | 持续进化 | +| D · 稳态运维 | 紫(成熟) | 稳重维护 | + +## 17 · 新建项目向导 + +### 4 步流程 + +**第 1 步 · 选接入模式** ⭐ 最关键 + +4 张大卡片,每张含: +- 模式字母 (大字) +- 名称 + 副标题 +- 判定条件(2-3 条) +- 适合场景 + +默认选中 B(最常见情况),用户可点击其他。底部"还不确定?"链接到 `docs/chapters/00-adoption/`。 + +**第 2 步 · 项目基本信息** + +| 字段 | 必填 | 说明 | +|------|-----|------| +| 项目名(英文) | ✓ | 小写 + 短横线,用作目录/仓库名 | +| 显示名 | ✓ | 中文展示名 | +| 描述 | - | 一句话说明 | +| 本地目录 | ✓ | 默认 `~/projects/<项目名>` | +| Git 远程 | - | 暂不关联 / 新建 GitLab / 新建 GitHub / 关联已有 | + +**第 3 步 · 起步清单预览** + +根据所选模式动态生成: +- 目录树(调用 `tools/cli/scaffolds/mode-{a,b,c,d}/`) +- Checklist(来自对应 mode README 的"起步清单") + +用户看清楚"将要发生什么",无意外。 + +**第 4 步 · 初始化完成** + +- 显示成功 + 项目路径 +- 按钮: 进入项目 / 在 Finder 中打开 +- "下一步建议"block 用文字列 3-4 项 + +### 底层命令 + +点"开始初始化"实际执行: +```bash +epcode init --mode= --name= --dir= +``` + +进度实时在界面反馈(可看到 stdout)。失败时可看日志 + 重试。 + +## 主视图 (01) 顶栏的项目切换器 + +``` + 🚀 EP Code AI / [离职流程优化 · A·绿地 ▾] [💼业务 💻开发 🧪测试 🚀运维] ... 张工 ▾ + ↑ + 项目切换器: 点击回到项目列表(16) + 显示当前项目名 + 模式徽章 +``` + +4 个场景工作流(12-15)顶栏同样加这个切换器,用户始终知道"我在哪个项目的哪个场景"。 + +## 权限与协作(Phase 3) + +Phase 2 简化实现:项目就是本地目录 + Git 仓库,所有成员通过 Git clone 拿到同一份。 + +Phase 3(服务端 RFC ④ 落地后): +- 项目有唯一 ID +- 成员通过企业用户体系加入 +- 角色权限(Owner / Admin / Member / Viewer) +- 跨成员的事件流聚合(谁改了啥,谁当前在哪个场景) + +## Sprint 7 实现影响 + +| 新 Swift 文件 | 作用 | +|-------------|------| +| `Project.swift` | 项目数据模型 | +| `ProjectStore.swift` | 本地项目列表持久化 | +| `ProjectListView.swift` | 16 页面 | +| `ProjectCard.swift` | 列表卡片 | +| `NewProjectWizardView.swift` | 17 页面 | +| `ModeContext.swift` | 当前项目模式 → 影响工作流 Checklist | + +主视图和场景工作流的现有 Swift 文件改造: +- `ContentView.swift` 顶栏加项目切换器 +- `WorkflowView.swift` 头部加项目 + 模式信息 +- Checklist 内容根据模式动态渲染 + +## 模式 → 工作流可见性的规则 + +| 模式 | 业务 | 开发 | 测试 | 运维 | +|------|:----:|:----:|:----:|:----:| +| A · 绿地 | ✅ 全 | ✅ 全 | ✅ 全 | ✅ 全 | +| B · 开发中 | 🟡 追溯补齐 | ✅ 全 | ✅ 全 | 🟡 | +| C · 迭代中 | 🟡 按 level 启用 | 🟡 按 level | 🟡 按 level | 🟡 按 level | +| D · 稳态运维 | ❌ 隐藏 | 🟡 只提测/发布 | 🟡 回归为主 | ✅ 全 | + +🟡 = 工作流仍可见但 Checklist 简化或标"可选"。❌ = 入口隐藏。 + +这样每个模式的用户在 GUI 里只看到"自己该看到的",不被多余功能干扰。