Skip to content

Commit

Permalink
just use the search term as the title for search history and explode …
Browse files Browse the repository at this point in the history
…switch to be more explicit
  • Loading branch information
brindy committed Jun 21, 2024
1 parent 15d97ce commit 2358bed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "8dabf4495ba93aaab87640b68240f7420e3ce4f9",
"version" : "159.0.1"
"revision" : "28687a848cff47267e64e3bfcdf5c92effbee5ce",
"version" : "159.0.2"
}
},
{
Expand Down
16 changes: 13 additions & 3 deletions DuckDuckGo/AutocompleteView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,25 @@ private struct SuggestionView: View {
SuggestionListItem(icon: Image("Globe-24"),
title: url.formattedForSuggestion())

case .bookmark(let title, let url, let isFavorite, _):
SuggestionListItem(icon: Image(isFavorite ? "Bookmark-Fav-24" :"Bookmark-24"),
case .bookmark(let title, let url, let isFavorite, _) where isFavorite:
SuggestionListItem(icon: Image("Bookmark-Fav-24"),
title: title,
subtitle: url.formattedForSuggestion())

case .bookmark(let title, let url, _, _):
SuggestionListItem(icon: Image("Bookmark-24"),
title: title,
subtitle: url.formattedForSuggestion())

case .historyEntry(_, let url, _) where url.isDuckDuckGoSearch:
SuggestionListItem(icon: Image("History-24"),
title: url.searchQuery ?? "",
subtitle: UserText.autocompleteSearchDuckDuckGo)

case .historyEntry(let title, let url, _):
SuggestionListItem(icon: Image("History-24"),
title: title ?? "",
subtitle: url.isDuckDuckGoSearch ? UserText.autocompleteSearchDuckDuckGo : url.formattedForSuggestion())
subtitle: url.formattedForSuggestion())

case .internalPage, .unknown:
FailedAssertionView("Unknown or unsupported suggestion type")
Expand Down

0 comments on commit 2358bed

Please sign in to comment.