feat: add Brave, Ecosia, and all search engine logos + launcher AI icon fix#238
feat: add Brave, Ecosia, and all search engine logos + launcher AI icon fix#238enzocarpentier wants to merge 3 commits intothe-ora:mainfrom
Conversation
…tion Adds Brave and Ecosia to default search engines. Refactors capsule logic to use templates natively, avoiding duplicated inverted sets. Fixes bug in LauncherSuggestionsView rendering wrong AI logo. Integrates all SVG assets.
Greptile SummaryThis PR adds Brave and Ecosia as new default search engines, integrates SVG logos for all built-in engines (both conventional and AI), and fixes a launcher bug where AI suggestions always showed the default AI's logo instead of the correct engine-specific one.
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LauncherSuggestionsView] -->|ForEach suggestion| B{suggestion.type == .aiChat?}
B -->|Yes, has name| C[getSearchEngine byName]
B -->|No or no name| D[getDefaultAIChat]
C --> E[LauncherSuggestionItem]
D --> E
E --> F{defaultAI has non-empty icon?}
F -->|Yes| G["Image(aiIcon) with foregroundColor"]
F -->|No| H[FavIcon / system icon fallback]
G --> I[Render in Launcher]
H --> I
style C fill:#4CAF50,color:#fff
style G fill:#4CAF50,color:#fff
|
ora/Assets/Catalogs/Capsule.xcassets/gemini-capsule-logo.imageset/Contents.json
Outdated
Show resolved
Hide resolved
| let engine = suggestion.type == .aiChat && suggestion.name != nil ? searchEngineService | ||
| .getSearchEngine(byName: suggestion.name!) : searchEngineService.getDefaultAIChat() |
There was a problem hiding this comment.
Force-unwrap on suggestion.name
While the suggestion.name != nil check in the ternary condition guards the force-unwrap on suggestion.name!, this pattern is fragile — a future refactor could easily separate the nil check from the unwrap and introduce a crash. Consider using if let or flatMap for safer unwrapping:
| let engine = suggestion.type == .aiChat && suggestion.name != nil ? searchEngineService | |
| .getSearchEngine(byName: suggestion.name!) : searchEngineService.getDefaultAIChat() | |
| let engine = suggestion.type == .aiChat && suggestion.name != nil ? searchEngineService | |
| .getSearchEngine(byName: suggestion.name!) : searchEngineService.getDefaultAIChat() |
A safer alternative would be:
let engine: SearchEngine? = {
if suggestion.type == .aiChat, let name = suggestion.name {
return searchEngineService.getSearchEngine(byName: name)
}
return searchEngineService.getDefaultAIChat()
}()…set/Contents.json Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Description
This PR adds Brave and Ecosia as default search engines and integrates official SVG logos for all search engines (conventional and AI) throughout the Ora app.
It also fixes a bug in the launcher where the wrong AI logo could appear (e.g., ChatGPT logo instead of Claude).
Main changes
Screenshots