feat: migrate address-bar web search to support Tavily - #4
feat: migrate address-bar web search to support Tavily#4manisrinivasan2k1 wants to merge 2 commits into
Conversation
…le fallback for address-bar web searches
|
Thanks for the PRs, and for the detail in the write-ups. I'm going to pass on these, and I want to be straight about why. Bah's main constraint is that it has to work for someone who just downloads the installer and opens it — no signup, no API key. These PRs read As they stand, the three PRs also each register the same If Tavily ever has a keyless tier that works with no signup, I'd genuinely be interested — that's the bar for anything that ships in the default experience here. |
Summary
Adds Tavily as a configurable alternative to Google for address-bar web searches (ADDITIVE migration — Google remains the default).
When the user sets
localStorage.defaultSearchEngineto'tavily', search queries typed in the address bar are routed through the Tavily API via IPC. Results are displayed in the chat panel as formatted markdown. If Tavily returns no results or fails, the search falls back to Google navigation automatically.Files Changed
package.json— Added@tavily/coredependencysrc/main/main.ts— Addedtavily:searchIPC handler that calls the Tavily search API usingTAVILY_API_KEYenv varsrc/preload/preload.ts— ExposedtavilySearchbridge method to the renderersrc/renderer/App.tsx— Updatednavigate()to checkdefaultSearchEnginesetting and route to Tavily when selected; addedtavilySearchto theWindow.electronAPItype declarationsrc/renderer/site-knowledge.ts— Added Tavily entry toSITE_SHORTCUTSarrayDependency Changes
@tavily/core: ^0.0.7todependenciesinpackage.jsonEnvironment Variable Changes
TAVILY_API_KEY— read by the main process in thetavily:searchIPC handler; required for Tavily search to functionNotes for Reviewers
localStorage.setItem('defaultSearchEngine', 'tavily')import()so the module is only loaded when actually neededAutomated Review
@tavily/core@^0.7.6in package.json (matching prior units), a top-level static import in main.ts, and tab ID captured before the async Tavily call in App.tsx to prevent race conditions. The IPC handler is properly guarded against missing API keys and query strings, loading state is correctly managed in both success and error paths, and fallback to Google works in both the empty-results and error cases. The preload bridge exposure and site-knowledge.ts entry are clean. Only minor issues found.