fix: add passthrough action on detail reference cards
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-04-28 19:34:02 +08:00
parent 81cd4d1754
commit ab35298e23

View File

@ -4175,6 +4175,19 @@ export function AgentGenerationWorkspaceDarkV2({
references: current.references.filter((card) => card.id !== cardId),
}));
}, [updateDetailReplacementState]);
const handleToggleDetailReferenceCardPassthrough = useCallback((cardId: string) => {
updateDetailReplacementState((current) => ({
...current,
references: current.references.map((card) =>
card.id === cardId
? {
...card,
passthrough: card.passthrough ? false : true,
}
: card
),
}));
}, [updateDetailReplacementState]);
const handleClearDetailReferenceCards = useCallback(() => {
updateDetailReplacementState((current) => ({
...current,
@ -5668,7 +5681,10 @@ export function AgentGenerationWorkspaceDarkV2({
<div className="relative min-h-[220px] overflow-hidden bg-[radial-gradient(circle_at_top,rgba(16,185,129,0.12),transparent_55%),linear-gradient(180deg,#0b0d0f_0%,#101316_100%)]">
<button
type="button"
onClick={() => handleRemoveDetailReferenceCard(card.id)}
onClick={(event) => {
event.stopPropagation();
handleRemoveDetailReferenceCard(card.id);
}}
className="absolute right-3 top-3 rounded-full border border-white/10 bg-black/40 px-2 py-1 text-[11px] text-white/70 transition-colors hover:border-white/20 hover:text-white"
>
删除
@ -5703,8 +5719,27 @@ export function AgentGenerationWorkspaceDarkV2({
</div>
</div>
</div>
<div className="border-t border-white/10 px-3 py-2 text-[11px] text-white/45">
删除某张后,后面的参考图会自动上移补位,不留空位。
<div className="flex items-center justify-between gap-3 border-t border-white/10 px-3 py-2">
<div className="text-[11px] text-white/45">
{card.passthrough
? "当前切片不会参与生图,会直接进入结果区。"
: "删除某张后,后面的参考图会自动上移补位,不留空位。"}
</div>
<button
type="button"
onClick={(event) => {
event.stopPropagation();
handleToggleDetailReferenceCardPassthrough(card.id);
}}
className={cn(
"shrink-0 rounded-full border px-3 py-1 text-[11px] transition-colors",
card.passthrough
? "border-cyan-400/35 bg-cyan-500/[0.12] text-cyan-100"
: "border-white/10 bg-white/[0.03] text-white/68 hover:border-white/20 hover:text-white"
)}
>
{card.passthrough ? "取消不处理" : "标记不处理"}
</button>
</div>
</div>
);