fix(review): 验收冲突显示与闸门对齐 — 验收报 CONFLICT_UNRESOLVED 时回拉最新审稿并回灌冲突;未审稿不再误显「可直接验收」
This commit is contained in:
@@ -16,10 +16,12 @@ import {
|
||||
type Verdict,
|
||||
} from "@/lib/review/decisions";
|
||||
import {
|
||||
latestReview,
|
||||
normalizeConflicts,
|
||||
normalizeForeshadowSug,
|
||||
normalizePace,
|
||||
} from "@/lib/review/history";
|
||||
import { api } from "@/lib/api/client";
|
||||
import {
|
||||
displayOrder,
|
||||
groupConflicts,
|
||||
@@ -315,8 +317,26 @@ export function ReviewReport({
|
||||
finalText,
|
||||
drafts,
|
||||
);
|
||||
if (outcome.missingIndices.length > 0) {
|
||||
setMissing(new Set(outcome.missingIndices));
|
||||
if (!outcome.conflictUnresolved) {
|
||||
if (outcome.missingIndices.length > 0) {
|
||||
setMissing(new Set(outcome.missingIndices));
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 验收闸读的是「持久化的最新审稿」;本页冲突可能为空/过期(显示 0 冲突却被拦)。
|
||||
// 回拉最新审稿留痕 → 回灌冲突 + 重置裁决草稿,把「看不见的冲突」显式呈现供裁决。
|
||||
const { data } = await api.GET(
|
||||
"/projects/{project_id}/chapters/{chapter_no}/reviews",
|
||||
{ params: { path: { project_id: project.id, chapter_no: chapterNo } } },
|
||||
);
|
||||
const fresh = normalizeConflicts(latestReview(data?.reviews));
|
||||
setMissing(new Set(outcome.missingIndices));
|
||||
if (fresh.length > 0) {
|
||||
review.seed({ conflicts: fresh, foreshadow, pace, style });
|
||||
setDrafts(emptyDecisions(fresh.length));
|
||||
toast("审稿报告已刷新:检测到未裁决冲突,请裁决后再验收", "error");
|
||||
} else {
|
||||
toast("尚有冲突未裁决,请先「重新审稿」查看", "error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -520,6 +540,7 @@ export function ReviewReport({
|
||||
<AcceptPanel
|
||||
projectId={project.id}
|
||||
chapterNo={chapterNo}
|
||||
reviewed={initialReview !== undefined || review.state.phase === "done"}
|
||||
conflictCount={conflictCount}
|
||||
unresolvedCount={resolved ? 0 : unresolved}
|
||||
foreshadowCount={foreshadow.length}
|
||||
|
||||
Reference in New Issue
Block a user