fix(ai): 保留拆解生成结果

This commit is contained in:
Script Generator
2026-07-01 13:05:51 +08:00
parent 063545c865
commit 24e8635a94
5 changed files with 343 additions and 107 deletions

View File

@@ -27,9 +27,21 @@ interface Props {
target: AgentDecomposeTarget;
dedupeSummary?: { removedDevTaskCount: number; removedTestCaseCount: number };
onClose: () => void;
onAdopted?: () => void;
onRejected?: () => void;
}
export function DecomposeReportModal({ result, version, plan, requirements, target, dedupeSummary, onClose }: Props) {
export function DecomposeReportModal({
result,
version,
plan,
requirements,
target,
dedupeSummary,
onClose,
onAdopted,
onRejected,
}: Props) {
const { createTask } = useDevTaskStore();
const { createTestCase } = useTestCaseStore();
const { categories } = useTaskCategoryStore();
@@ -163,7 +175,10 @@ export function DecomposeReportModal({ result, version, plan, requirements, targ
setSubmitting(false);
// 1.5 秒后自动关闭
setTimeout(() => onClose(), 1500);
setTimeout(() => {
onAdopted?.();
onClose();
}, 1500);
};
const visibleRecommendationCount = useMemo(() => {
@@ -438,10 +453,21 @@ export function DecomposeReportModal({ result, version, plan, requirements, targ
</div>
<div className="flex gap-2">
<button
onClick={onClose}
onClick={() => {
onRejected?.();
onClose();
}}
disabled={submitting || submitted}
className="h-8 px-3 rounded-lg text-[12px] font-medium border border-[var(--line)] text-[var(--ink-soft)] hover:bg-[var(--bg-subtle)]"
>
</button>
<button
onClick={onClose}
disabled={submitting || submitted}
className="h-8 px-3 rounded-lg text-[12px] font-medium border border-[var(--line)] text-[var(--ink-soft)] hover:bg-[var(--bg-subtle)]"
>
</button>
<button
onClick={handleAdopt}