From 43f2e4c476be1459d3272be69046600338e3c547 Mon Sep 17 00:00:00 2001 From: Askar <36728206+SirSilver@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:59:27 +0500 Subject: [PATCH] assistant: Add missing toggle model selector action handler (#25248) #25032 removes handling of `ToggleModelSelector` action. This PR adds missing handler to context editor. Release Notes: - N/A --- crates/assistant_context_editor/src/context_editor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/assistant_context_editor/src/context_editor.rs b/crates/assistant_context_editor/src/context_editor.rs index d6ffb2a116..3c56270971 100644 --- a/crates/assistant_context_editor/src/context_editor.rs +++ b/crates/assistant_context_editor/src/context_editor.rs @@ -2043,6 +2043,15 @@ impl ContextEditor { }); } + fn toggle_model_selector( + &mut self, + _: &ToggleModelSelector, + window: &mut Window, + cx: &mut Context, + ) { + self.language_model_selector_menu_handle.toggle(window, cx); + } + fn save(&mut self, _: &Save, _window: &mut Window, cx: &mut Context) { self.context.update(cx, |context, cx| { context.save(Some(Duration::from_millis(500)), self.fs.clone(), cx) @@ -2886,6 +2895,7 @@ impl Render for ContextEditor { .on_action(cx.listener(ContextEditor::edit)) .on_action(cx.listener(ContextEditor::assist)) .on_action(cx.listener(ContextEditor::split)) + .on_action(cx.listener(ContextEditor::toggle_model_selector)) .size_full() .children(self.render_notice(cx)) .child(