mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
🐛 **Problem**: Refactoring broke search - showing 'No results' for valid queries 🔧 **Root Cause**: Replaced working on:input handler with reactive statement ⚡ **Solution**: Restored on:input={handleInput} approach **Why the reactive statement failed:** - `$: performSearch(searchQuery)` runs before history prop is ready - Svelte reactive statements execute immediately on component init - History prop from parent may not be available yet, causing search to fail **Why on:input works better:** ✅ Explicit user-triggered execution (only when typing) ✅ Ensures history prop is available when search runs ✅ Cleaner separation of concerns (input vs reactive computations) ✅ Matches existing OpenWebUI patterns **Functionality restored:** - Real-time search through chat messages ✅ - Accurate result counting ✅ - Case-insensitive matching ✅ - Navigation between results ✅ The search now works exactly as it did before the refactoring attempt.