From c39adc5242ddc8cd2e88d2e2a87bd6f01b44126f Mon Sep 17 00:00:00 2001 From: Julia Ryan Date: Fri, 25 Apr 2025 04:00:25 -0700 Subject: [PATCH] Select collab channel filter query upon focusing (#29383) In the process of implementing this I learned that you can also hit escape to clear the query which is a decent workaround, but I think this behavior more closely matches expectations. For example when you run the "focus search" actions, those select the query. Release Notes: - N/A --- crates/collab_ui/src/collab_panel.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 6c5328ae190f74de56fc9fdd273818a9ad2f7df7..e8eac4aaf6df462279f1d3aa0d0e9403543d3615 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -65,6 +65,15 @@ pub fn init(cx: &mut App) { cx.observe_new(|workspace: &mut Workspace, _, _| { workspace.register_action(|workspace, _: &ToggleFocus, window, cx| { workspace.toggle_panel_focus::(window, cx); + if let Some(collab_panel) = workspace.panel::(cx) { + collab_panel.update(cx, |panel, cx| { + panel.filter_editor.update(cx, |editor, cx| { + if editor.snapshot(window, cx).is_focused() { + editor.select_all(&Default::default(), window, cx); + } + }); + }) + } }); workspace.register_action(|_, _: &OpenChannelNotes, window, cx| { let channel_id = ActiveCall::global(cx)