From 150535ffcf99ed7a4b04659554e18f2d23712289 Mon Sep 17 00:00:00 2001 From: lanrtop Date: Fri, 19 Jun 2026 13:07:09 +0900 Subject: [PATCH] =?UTF-8?q?feat(onboarding):=20=E6=8E=A5=E5=85=A5=E5=8C=85?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=20UI=E2=80=94=E2=80=94=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=8D=87=E7=BA=A7=E4=B8=BA=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 治理面板 buff 区改为应用接入包:调 apply_onboarding_pack(种 3 模板 + 挂 buff),新增模板分发结果展示(written/skipped/failed)。接入包 A/B/C1/C2 就绪,剩 D 可信度提示。 --- .blueprint/modules/onboarding-pack.md | 4 +-- src/components/dashboard/BlueprintModal.tsx | 37 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.blueprint/modules/onboarding-pack.md b/.blueprint/modules/onboarding-pack.md index 3f56cc6..332ef54 100644 --- a/.blueprint/modules/onboarding-pack.md +++ b/.blueprint/modules/onboarding-pack.md @@ -73,8 +73,8 @@ git 是「过去时 + 量化」(做了什么),蓝图是「将来时 + 语 - files: src-tauri/src/commands/onboarding.rs, src-tauri/resources/onboarding/{AGENTS.md,lefthook.yml,git-workflow.md}.tmpl - acceptance: include_str! 内嵌 3 个标准模板(蓝本取自 enterprise-system);分发时文件不存在→写入、已存在→跳过并在报告标注,绝不覆盖;复用 mcp_inject 的路径解析(含 WSL);返回每个模板的 written/skipped/failed -### 🔵 B apply_onboarding_pack 编排 + 前端入口 -- status: in_progress +### ✅ B apply_onboarding_pack 编排 + 前端入口 +- status: done - complexity: M - depends: onboarding-pack(卡A) - files: src-tauri/src/commands/onboarding.rs, src-tauri/src/lib.rs, src/lib/commands.ts, src/components/dashboard/ProjectCard.tsx diff --git a/src/components/dashboard/BlueprintModal.tsx b/src/components/dashboard/BlueprintModal.tsx index f5a9d24..1851692 100644 --- a/src/components/dashboard/BlueprintModal.tsx +++ b/src/components/dashboard/BlueprintModal.tsx @@ -22,7 +22,7 @@ import { getFlywheelStats, generateMuhePrompt, archiveProjectDocs, - applyBlueprintBuff, + applyOnboardingPack, removeBlueprintBuff, getBuffStatus, getUserConventionsStatus, @@ -38,6 +38,7 @@ import { type FlywheelStats, type StalledProject, type BuffStatus, + type TemplateResult, type UserConventionsStatus, } from "../../lib/commands"; @@ -1068,6 +1069,7 @@ function GovernancePanel({ const [buffError, setBuffError] = useState(null); const [buffInitPrompt, setBuffInitPrompt] = useState(null); const [buffInitCopied, setBuffInitCopied] = useState(false); + const [packTemplates, setPackTemplates] = useState(null); const [promptMode, setPromptMode] = useState<"init" | "sync" | null>(null); const [prompt, setPrompt] = useState(""); @@ -1091,8 +1093,10 @@ function GovernancePanel({ setBuffLoading(true); setBuffError(null); setBuffInitPrompt(null); + setPackTemplates(null); try { - await applyBlueprintBuff(projectPath, projectId); + const report = await applyOnboardingPack(projectPath, projectId); + setPackTemplates(report.templates); refetchBuff(); // 只有尚无蓝图时才展示 init prompt;已有蓝图则 Buff 直接激活无需初始化 if (bpStatus?.status === "none") { @@ -1113,6 +1117,7 @@ function GovernancePanel({ await removeBlueprintBuff(projectPath); refetchBuff(); setBuffInitPrompt(null); + setPackTemplates(null); } catch (e) { setBuffError(String(e)); } finally { @@ -1435,13 +1440,13 @@ function GovernancePanel({ {/* ── 蓝图 Buff ─────────────────────────────────────── */}
-

蓝图 Buff

+

接入包

{buffStatus?.status === "active" && ( ⚡ 已激活 )}

- 施加 Buff 后,炼境将自动监听 git 提交,匹配任务文件并更新进度。 + 应用接入包:种入 AGENTS.md / lefthook / git-workflow 标准模板(不覆盖已有),并挂 buff 自动监听 git 提交、采集飞轮数据。

{buffStatus?.last_sync_at && (

上次同步:{buffStatus.last_sync_at}

@@ -1449,6 +1454,30 @@ function GovernancePanel({ {buffError && (

{buffError}

)} + {packTemplates && ( +
+

模板分发

+ {packTemplates.map((t) => ( +

+ + {t.action === "written" ? "✓" : t.action === "skipped" ? "○" : "✗"} + + {t.name} + + {t.action === "written" ? "已写入" : t.action === "skipped" ? "已存在" : t.detail} + +

+ ))} +
+ )} {buffStatus?.status === "active" ? (