pyqt_reactive.services.search_service
Shared search service for UI components.
This module provides a framework-agnostic search service that can be used by both PyQt and Textual implementations to ensure consistent search behavior across the application.
Classes
|
Framework-agnostic search service with minimum character trigger. |
- class pyqt_reactive.services.search_service.SearchService(all_items: Dict[str, T], searchable_text_extractor: Callable[[T], str], min_chars: int = 2)[source]
Framework-agnostic search service with minimum character trigger.
This service provides consistent search behavior across PyQt and Textual implementations, ensuring the same code path is used for all search operations.
Key features: - Minimum character threshold (default: 2) - Customizable searchable text extraction - Performance optimization for short searches
- MIN_SEARCH_CHARS = 2
- __init__(all_items: Dict[str, T], searchable_text_extractor: Callable[[T], str], min_chars: int = 2)[source]
Initialize search service.
- Parameters:
all_items – Dictionary of all searchable items (key -> item)
searchable_text_extractor – Function to extract searchable text from an item
min_chars – Minimum characters required to trigger search (default: 2)