Add Himalaya search integration tests and fix 0 results display

- Add test mailbox with 5 sample emails for integration testing
- Add himalaya_test_config.toml for local Maildir backend testing
- Create 12 integration tests covering search by from/to/subject/body
- Fix search results display to clear list and show message when 0 results
- Add clear_content() method to ContentContainer widget
This commit is contained in:
Bendt
2025-12-19 14:42:10 -05:00
parent 8be4b4785c
commit bbc53b4ce7
9 changed files with 411 additions and 1 deletions

View File

@@ -1003,9 +1003,21 @@ class EmailViewerApp(App):
config = get_config()
# Add search results header
header_label = f"Search: '{query}' ({len(results)} result{'s' if len(results) != 1 else ''})"
if results:
header_label = f"Search: '{query}' ({len(results)} result{'s' if len(results) != 1 else ''})"
else:
header_label = f"Search: '{query}' - No results found"
envelopes_list.append(ListItem(GroupHeader(label=header_label)))
if not results:
# Clear the message viewer when no results
content_container = self.query_one(ContentContainer)
content_container.clear_content()
self.message_store.envelopes = []
self.total_messages = 0
self.current_message_id = 0
return
# Create a temporary message store for search results
search_store = MessageStore()
search_store.load(results, self.sort_order_ascending)