Skip to content

Commit

Permalink
on iOS allow bookmarks in top hits (#812)
Browse files Browse the repository at this point in the history
Required:

Task/Issue URL: https://app.asana.com/0/0/1207251449708624/f
iOS PR: duckduckgo/iOS#2835
macOS PR: duckduckgo/macos-browser#2754
What kind of version bump will this require?: Major/Minor/Patch

Optional:

Tech Design URL:
CC:

Description:

Bookmarks are added to top hits on iOS, but the behaviour is unchanged on macOS.

Steps to test this PR:

iOS

On iOS launch the app (use the md variant by editing the scheme > run > check environment variable VARIANT is md and enabled
Add some bookmarks
Start typing in the address bar
The bookmarks should appear in the top hits section (ie at the top of the suggestions list)
Check that launching the app clean with no variant still works as expected.
macOS

Launch the app and confirm that suggestions works as it did previously. ie Bookmarks should not be in top hits unless they have been visited several times.
brindy authored May 9, 2024
1 parent 9df0476 commit 8b8092d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Suggestions/Suggestion.swift
Original file line number Diff line number Diff line change
@@ -70,10 +70,17 @@ extension Suggestion {

init?(bookmark: Bookmark) {
guard let urlObject = URL(string: bookmark.url) else { return nil }
#if os(macOS)
self = .bookmark(title: bookmark.title,
url: urlObject,
isFavorite: bookmark.isFavorite,
allowedInTopHits: bookmark.isFavorite)
#else
self = .bookmark(title: bookmark.title,
url: urlObject,
isFavorite: bookmark.isFavorite,
allowedInTopHits: true)
#endif
}

init(historyEntry: HistorySuggestion) {

0 comments on commit 8b8092d

Please sign in to comment.