Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ARCANGEL0 EVA SearchEnginePanel

From Leeroopedia
Knowledge Sources
Domains Configuration, Search, UI_Architecture
Last Updated 2026-10-29 14:00 GMT

Overview

Concrete tool for configuring web search engines — enabling/disabling engines, entering API keys, and deploying SearXNG — as a Textual TUI panel, provided by the Mitsu search dialog module.

Description

The SearchEnginePanel class is a Textual container widget that allows the operator to:

  • Toggle engines: Enable/disable search engines (SearXNG, Google, Bing, DuckDuckGo, Brave, etc.) using space-key toggles.
  • Enter API keys: For paid engines, provides Input widgets for API key and base URL entry.
  • Validate connections: Calls `validate_search_engine` to test the connection before saving.
  • Deploy SearXNG: Optionally starts a local SearXNG Docker container via `setup_local_searxng`.
  • Save settings: Persists engine settings to `credentials.json` via `CredentialStore.save_search_engines`.

The panel supports both onboarding mode (first-run) and standalone configuration mode.

Usage

  • Onboarding wizard: Embedded as a step in `OnboardingScreen` during first-run setup.
  • Configuration dialog: Opened from the settings hub to reconfigure search engines.

Code Reference

Source Location

  • Repository: Mitsu
  • File: tui/dialogs/search_engines.py

Signature

class SearchEnginePanel(Vertical):
    def __init__(
        self,
        credentials: CredentialStore,
        onboarding: bool = False,
        on_finish: Callable[[bool], None] | None = None,
        id: str | None = None,
    ) -> None: ...

Import

from mitsu.tui.dialogs.search_engines import SearchEnginePanel

I/O Contract

Inputs

Name Type Required Description
credentials CredentialStore Yes Credential store for saving engine settings
onboarding bool No True during first-run wizard (default: False)
on_finish Callable[[bool], None] No Completion callback (success flag)
id None No Textual widget ID

Outputs

Name Type Description
side effect None Saves search engine settings to credentials.json

Usage Examples

During Onboarding

from mitsu.tui.dialogs.search_engines import SearchEnginePanel
from mitsu.config.storage import CredentialStore

credentials = CredentialStore()
panel = SearchEnginePanel(
    credentials=credentials,
    onboarding=True,
    on_finish=lambda success: print(f"Setup {'complete' if success else 'cancelled'}"),
)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment