From 2c8d4d3e9f9136396f6259ecf8df5e7d90042ea4 Mon Sep 17 00:00:00 2001 From: Kirk van Gorkom Date: Sun, 2 Mar 2025 23:43:01 -0800 Subject: [PATCH] Remap score to combined_score for common ancestor in prediction results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Duplicative with existing change in MOB-513’s confidence calculation fix, but makes a combined score available for sorting or filtering. --- src/sharedHooks/useSuggestions/filterSuggestions.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sharedHooks/useSuggestions/filterSuggestions.js b/src/sharedHooks/useSuggestions/filterSuggestions.js index 945106505..b969fd7b2 100644 --- a/src/sharedHooks/useSuggestions/filterSuggestions.js +++ b/src/sharedHooks/useSuggestions/filterSuggestions.js @@ -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 }; }