fix: simplify conversion prompt confirmation

This commit is contained in:
2026-05-20 21:45:17 +08:00
parent 41e71d3865
commit d1e2b1785e
2 changed files with 33 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3936,9 +3936,12 @@ function SourceSubjectPipeline({
const effectiveAgentViews = subjectViewsForQuantity(effectiveAgentQuantity) const effectiveAgentViews = subjectViewsForQuantity(effectiveAgentQuantity)
const effectivePrompt = (agentPrompt || subjectAgent?.generation_prompt_en || "").trim() const effectivePrompt = (agentPrompt || subjectAgent?.generation_prompt_en || "").trim()
const effectiveRequirement = (subjectAgent?.requirements_zh || agentRequirement).trim() const effectiveRequirement = (subjectAgent?.requirements_zh || agentRequirement).trim()
const requirementSummary = effectivePrompt
? "提示词已生成,请在确认弹窗里检查后出图;需要改动时直接继续发送消息。"
: effectiveRequirement || "按当前参考图和保留元素生成。"
const agentUserMessageCount = agentMessages.filter((message) => message.role === "user").length const agentUserMessageCount = agentMessages.filter((message) => message.role === "user").length
const agentHiddenAssistantCount = agentMessages.length - agentUserMessageCount const agentHiddenAssistantCount = agentMessages.length - agentUserMessageCount
const agentSummaryVisible = Boolean(effectiveRequirement || selectedAgentTraits.length || agentMessages.length) const agentSummaryVisible = Boolean(effectivePrompt || effectiveRequirement || selectedAgentTraits.length || agentMessages.length)
const canGenerateAgentPack = effectiveAgentMode === "custom" const canGenerateAgentPack = effectiveAgentMode === "custom"
? Boolean(effectiveRequirement || agentReferenceFrames.length) ? Boolean(effectiveRequirement || agentReferenceFrames.length)
: agentReferenceFrames.length > 0 : agentReferenceFrames.length > 0
@@ -4209,9 +4212,21 @@ function SourceSubjectPipeline({
<MessageSquare className="h-3.5 w-3.5 text-cyan-100/55" /> <MessageSquare className="h-3.5 w-3.5 text-cyan-100/55" />
</span> </span>
<span className="text-[9px] text-white/34"> {effectivePrompt ? (
{reconstructionModeConfig(effectiveAgentMode).label} · {effectiveAgentQuantity} <button
</span> type="button"
onClick={() => setPromptConfirmOpen(true)}
disabled={!canGenerateAgentPack || subjectBusy || agentModeRunning}
className="inline-flex h-6 items-center gap-1 rounded-md border border-[#d6b36a]/28 bg-[#d6b36a]/[0.075] px-2 text-[9px] font-semibold text-[#f4dc88] transition hover:border-[#d6b36a]/48 hover:bg-[#d6b36a]/12 disabled:cursor-not-allowed disabled:opacity-40"
>
<Check className="h-3 w-3" />
· {effectiveAgentViews.length}
</button>
) : (
<span className="text-[9px] text-white/34">
{reconstructionModeConfig(effectiveAgentMode).label} · {effectiveAgentQuantity}
</span>
)}
</div> </div>
<div className="min-h-[86px] flex-1 overflow-auto rounded border border-white/8 bg-black/20 p-1.5"> <div className="min-h-[86px] flex-1 overflow-auto rounded border border-white/8 bg-black/20 p-1.5">
{agentSummaryVisible ? ( {agentSummaryVisible ? (
@@ -4219,7 +4234,7 @@ function SourceSubjectPipeline({
<div className="rounded-md border border-cyan-200/12 bg-cyan-300/[0.06] px-2 py-1.5"> <div className="rounded-md border border-cyan-200/12 bg-cyan-300/[0.06] px-2 py-1.5">
<div className="text-[9px] font-semibold text-cyan-50/62"></div> <div className="text-[9px] font-semibold text-cyan-50/62"></div>
<p className="mt-0.5 line-clamp-3 text-[10px] leading-snug text-white/64"> <p className="mt-0.5 line-clamp-3 text-[10px] leading-snug text-white/64">
{effectiveRequirement || "按当前参考图和保留元素生成。"} {requirementSummary}
</p> </p>
</div> </div>
{selectedAgentTraits.length ? ( {selectedAgentTraits.length ? (
@@ -4315,24 +4330,6 @@ function SourceSubjectPipeline({
</div> </div>
</div> </div>
{effectivePrompt ? (
<div className="mt-2 rounded-md border border-[#d6b36a]/24 bg-[#d6b36a]/[0.075] p-2">
<div className="flex items-center justify-between gap-2">
<span className="text-[10px] font-semibold text-[#f4dc88]"></span>
<span className="text-[9px] text-white/42">{effectiveAgentViews.length} </span>
</div>
<p className="mt-1 line-clamp-4 text-[9.5px] leading-snug text-white/58">{effectivePrompt}</p>
<button
type="button"
onClick={() => setPromptConfirmOpen(true)}
disabled={!canGenerateAgentPack || subjectBusy || agentModeRunning}
className="skg-primary-action mt-2 inline-flex h-8 w-full items-center justify-center gap-1.5 px-2 text-[10.5px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-40"
>
<Check className="h-3.5 w-3.5" />
{effectiveAgentViews.length}
</button>
</div>
) : null}
</div> </div>
</div> </div>
</div> </div>