sidebar: Fix space not working in archive view's search editor (#53268)

Danilo Leal created

Similar to https://github.com/zed-industries/zed/pull/52444 but now in
the archive view's search editor.

Release Notes:

- N/A

Change summary

crates/agent_ui/src/threads_archive_view.rs | 7 +++++++
crates/sidebar/src/sidebar.rs               | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)

Detailed changes

crates/agent_ui/src/threads_archive_view.rs 🔗

@@ -218,6 +218,13 @@ impl ThreadsArchiveView {
         handle.focus(window, cx);
     }
 
+    pub fn is_filter_editor_focused(&self, window: &Window, cx: &App) -> bool {
+        self.filter_editor
+            .read(cx)
+            .focus_handle(cx)
+            .is_focused(window)
+    }
+
     fn update_items(&mut self, cx: &mut Context<Self>) {
         let sessions = ThreadMetadataStore::global(cx)
             .read(cx)

crates/sidebar/src/sidebar.rs 🔗

@@ -1769,7 +1769,11 @@ impl Sidebar {
         dispatch_context.add("ThreadsSidebar");
         dispatch_context.add("menu");
 
-        let identifier = if self.filter_editor.focus_handle(cx).is_focused(window) {
+        let is_archived_search_focused = matches!(&self.view, SidebarView::Archive(archive) if archive.read(cx).is_filter_editor_focused(window, cx));
+
+        let identifier = if self.filter_editor.focus_handle(cx).is_focused(window)
+            || is_archived_search_focused
+        {
             "searching"
         } else {
             "not_searching"