forked from mozilla-mobile/fenix
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
increase number of various suggestions
- Loading branch information
1 parent
799063d
commit 4b02488
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
automation/iceraven/patches/suggestions_increase_number.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/BookmarksStorageSuggestionProvider.kt b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/BookmarksStorageSuggestionProvider.kt | ||
index 73252c1560..0544a51f59 100644 | ||
--- a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/BookmarksStorageSuggestionProvider.kt | ||
+++ b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/BookmarksStorageSuggestionProvider.kt | ||
@@ -86,7 +86,7 @@ class BookmarksStorageSuggestionProvider( | ||
* @param query String to filter bookmarks' title or URL by. | ||
*/ | ||
private suspend fun getBookmarksSuggestions(query: String) = bookmarksStorage | ||
- .searchBookmarks(query, BOOKMARKS_SUGGESTION_LIMIT) | ||
+ .searchBookmarks(query, BOOKMARKS_SUGGESTION_LIMIT * BOOKMARKS_RESULTS_TO_FILTER_SCALE_FACTOR) | ||
.filter { it.url != null } | ||
.distinctBy { it.url } | ||
.sortedBy { it.guid } | ||
diff --git a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/CombinedHistorySuggestionProvider.kt b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/CombinedHistorySuggestionProvider.kt | ||
index 5d79e8caed..293a5cee78 100644 | ||
--- a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/CombinedHistorySuggestionProvider.kt | ||
+++ b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/CombinedHistorySuggestionProvider.kt | ||
@@ -145,7 +145,7 @@ class CombinedHistorySuggestionProvider( | ||
* @param query String to filter bookmarks' title or URL by. | ||
*/ | ||
private suspend fun getMetadataSuggestions(query: String) = historyMetadataStorage | ||
- .queryHistoryMetadata(query, maxNumberOfSuggestions) | ||
+ .queryHistoryMetadata(query, maxNumberOfSuggestions * COMBINED_HISTORY_RESULTS_TO_FILTER_SCALE_FACTOR) | ||
.filter { it.totalViewTime > 0 } | ||
.into(this@CombinedHistorySuggestionProvider, icons, loadUrlUseCase, showEditSuggestion) | ||
|
||
@@ -169,7 +169,7 @@ class CombinedHistorySuggestionProvider( | ||
* @param query String to filter history entry's title or URL by. | ||
*/ | ||
private suspend fun getHistorySuggestions(query: String) = historyStorage | ||
- .getSuggestions(query, maxNumberOfSuggestions) | ||
+ .getSuggestions(query, maxNumberOfSuggestions * COMBINED_HISTORY_RESULTS_TO_FILTER_SCALE_FACTOR) | ||
.sortedByDescending { it.score } | ||
.distinctBy { it.id } | ||
.into(this@CombinedHistorySuggestionProvider, icons, loadUrlUseCase, showEditSuggestion) | ||
diff --git a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryMetadataSuggestionProvider.kt b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryMetadataSuggestionProvider.kt | ||
index ad1d7590b7..512262ee9a 100644 | ||
--- a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryMetadataSuggestionProvider.kt | ||
+++ b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryMetadataSuggestionProvider.kt | ||
@@ -85,7 +85,7 @@ class HistoryMetadataSuggestionProvider( | ||
* @param query String to filter history entry's title or URL by. | ||
*/ | ||
private suspend fun getHistorySuggestions(query: String) = historyStorage | ||
- .queryHistoryMetadata(query, maxNumberOfSuggestions) | ||
+ .queryHistoryMetadata(query, maxNumberOfSuggestions * HISTORY_METADATA_RESULTS_TO_FILTER_SCALE_FACTOR) | ||
.filter { it.totalViewTime > 0 } | ||
|
||
/** | ||
diff --git a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryStorageSuggestionProvider.kt b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryStorageSuggestionProvider.kt | ||
index e9d56bede3..c95da08651 100644 | ||
--- a/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryStorageSuggestionProvider.kt | ||
+++ b/components/feature/awesomebar/src/main/java/mozilla/components/feature/awesomebar/provider/HistoryStorageSuggestionProvider.kt | ||
@@ -110,7 +110,7 @@ class HistoryStorageSuggestionProvider( | ||
* @param query String to filter history entry's title or URL by. | ||
*/ | ||
private fun getHistorySuggestions(query: String) = historyStorage | ||
- .getSuggestions(query, maxNumberOfSuggestions) | ||
+ .getSuggestions(query, maxNumberOfSuggestions * HISTORY_RESULTS_TO_FILTER_SCALE_FACTOR) | ||
// In case of duplicates we want to pick the suggestion with the highest score. | ||
// See: https://github.com/mozilla/application-services/issues/970 | ||
.sortedByDescending { it.score } |