feat(confidence-engine): wire focused contribution finding derivation
This commit is contained in:
@@ -271,9 +271,20 @@ export default function ScenarioForm() {
|
||||
}
|
||||
|
||||
function appendFocusedContribution(contribution) {
|
||||
// Derive a single stored contribution object and use it for BOTH
|
||||
// contribution storage AND Finding derivation so the same identity
|
||||
// appears in focusedContributions[] and Finding.contributionId.
|
||||
setFocusedContributions((prev) => {
|
||||
const seq = prev.length + 1;
|
||||
return [...prev, { ...contribution, sequence: seq, id: `contrib-${String(seq).padStart(4, "0")}` }];
|
||||
const storedContribution = { ...contribution, sequence: seq, id: `contrib-${String(seq).padStart(4, "0")}` };
|
||||
|
||||
// Derive Findings from the exact stored Contribution (not a separate approximation)
|
||||
setFindings((prevFindings) => {
|
||||
const newFindings = deriveFindingsFromContributions([storedContribution]).findings;
|
||||
return normalizeFindings([...prevFindings, ...newFindings]);
|
||||
});
|
||||
|
||||
return [...prev, storedContribution];
|
||||
});
|
||||
}
|
||||
const textareaRef = useRef(null);
|
||||
|
||||
Reference in New Issue
Block a user