Remap score to combined_score for common ancestor in prediction results

Duplicative with existing change in MOB-513’s confidence calculation fix, but makes a combined score available for sorting or filtering.
This commit is contained in:
Kirk van Gorkom
2025-03-02 23:43:01 -08:00
parent cff703fbfe
commit 2c8d4d3e9f

View File

@@ -78,11 +78,16 @@ const filterSuggestions = ( suggestionsToFilter, usingOfflineSuggestions, common
};
}
// online common ancestor
// online or offline common ancestor
if ( commonAncestor ) {
const sortableCommonAncestor = {
...commonAncestor,
// temp patch to let calling code sort online common ancestor with other suggestions
combined_score: commonAncestor.combined_score ?? commonAncestor.score
};
return {
...newSuggestions,
topSuggestion: commonAncestor,
topSuggestion: sortableCommonAncestor,
topSuggestionType: TOP_SUGGESTION_COMMON_ANCESTOR
};
}