Skip to content

fix(settings): restore search-engine switcher in dashboard + desktop#1618

Merged
esengine merged 1 commit into
mainfrom
fix/restore-search-engine-switcher
May 23, 2026
Merged

fix(settings): restore search-engine switcher in dashboard + desktop#1618
esengine merged 1 commit into
mainfrom
fix/restore-search-engine-switcher

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

Changes

  • protocol.ts (desktop + dashboard): webSearchEngine? added to SettingsEvent + SettingsPatch. Type alias WebSearchEngineName exported.
  • App.tsx (desktop + dashboard): same field on the Settings state, plumbed through the $settings reducer.
  • dashboard/src/lib/tauri-bridge.ts: emitServerSettings forwards webSearchEngine from GET /api/settings (server side was already wired by feat(web-search): default to Bing, drop Mojeek, dashboard engine switcher #1558).
  • src/cli/commands/desktop.ts: extends settings_save InMessage + handler to persist via writeConfig; emitSettings reads back via webSearchEngine().
  • desktop/src/ui/settings.tsx + dashboard/src/ui/settings.tsx: new <select> row in PageGeneral behavior section.
  • desktop/src/i18n/{en,zh-CN}.ts: copies the six already-translated strings (label, six engine options, note) that were living only in the dashboard bundle.

API keys for metaso / tavily / perplexity / exa still go through the /search-engine <engine> <key> slash or direct config.json edit — UI-side key entry can come later.

Test plan

  • npm run typecheck (root + dashboard + desktop) clean
  • npm run lint clean (only pre-existing warning in welcome-banner-hints)
  • npm run test — 3586 pass
  • npm run build:dashboard builds clean
  • Manual desktop: pick each engine, verify config.json gets webSearchEngine field; restart app, value persists; status bar / next web_search call uses the new engine
  • Manual dashboard: same — pick engine, refresh, value persists across /api/settings GET

The dashboard's <select> for switching web search backends shipped in
#1558 against the old Preact panel; the React port (#1418) dropped it
silently and the i18n strings have been dead code since. The desktop
settings panel never had it. Both surfaces now expose the same dropdown
under General → Behavior, alongside reasoning effort / edit mode /
budget — six engines (bing, searxng, metaso, tavily, perplexity, exa)
matching the `/search-engine` slash.

- protocol: `webSearchEngine` on SettingsEvent + SettingsPatch in both
  desktop and dashboard mirrors
- backend: `src/cli/commands/desktop.ts` settings_save persists the
  field via writeConfig; emitSettings reads it back via webSearchEngine()
- dashboard bridge: emitServerSettings forwards the field from
  `GET /api/settings` (server side was already wired by #1558)
- desktop i18n: copies the six already-translated strings that were
  living only in the dashboard bundle

API keys for metaso / tavily / perplexity / exa still go through the
slash command (or config.json) — UI-side key entry can come later if
demand shows up.
@esengine esengine merged commit b16f614 into main May 23, 2026
4 checks passed
@esengine esengine deleted the fix/restore-search-engine-switcher branch May 23, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant