fix: 已有蓝图时禁用「初始化蓝图」按钮

避免用户误用初始化覆盖已有蓝图,引导使用「更新蓝图描绘」。
disabled 状态加 tooltip 提示原因。
This commit is contained in:
lanrtop 2026-04-04 23:33:13 +09:00
parent 157df716c7
commit 23b109119a

View File

@ -1141,8 +1141,12 @@ function GovernancePanel({
<div className="flex gap-2">
<button
onClick={() => handleOpenPrompt("init")}
disabled={bpStatus?.status !== "none"}
title={bpStatus?.status !== "none" ? "该项目已有蓝图,请使用「更新蓝图描绘」" : undefined}
className={`flex-1 py-1.5 rounded-lg text-xs transition-colors ${
promptMode === "init"
bpStatus?.status !== "none"
? "border border-gray-100 text-gray-300 cursor-not-allowed"
: promptMode === "init"
? "bg-blue-600 text-white"
: "border border-gray-200 text-gray-600 hover:bg-gray-50"
}`}