Fix search stability and improve Escape key behavior
- Add bounds check in _mark_message_as_read to prevent IndexError - Clear metadata_by_id when search returns no results - Escape now focuses search input when in search mode instead of exiting - Add focus_input() method to SearchPanel
This commit is contained in:
@@ -216,6 +216,11 @@ class SearchPanel(Widget):
|
||||
self._cancel_debounce()
|
||||
self.result_count = -1
|
||||
|
||||
def focus_input(self) -> None:
|
||||
"""Focus the search input field."""
|
||||
input_widget = self.query_one("#search-input", Input)
|
||||
input_widget.focus()
|
||||
|
||||
@property
|
||||
def is_visible(self) -> bool:
|
||||
"""Check if the panel is visible."""
|
||||
|
||||
Reference in New Issue
Block a user