Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assistant_context_editor: Close menus on send #25440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/assistant_context_editor/src/context_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,14 @@ impl ContextEditor {
}

fn assist(&mut self, _: &Assist, window: &mut Window, cx: &mut Context<Self>) {
self.slash_menu_handle.hide(cx);
self.language_model_selector_menu_handle.hide(cx);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would checking if they are open be better?

    if self.slash_menu_handle.is_deployed() {
        self.slash_menu_handle.hide(cx);
    }
    if self.language_model_selector_menu_handle.is_deployed() {
        self.language_model_selector_menu_handle.hide(cx);
    }

self.send_to_model(RequestType::Chat, window, cx);
}

fn edit(&mut self, _: &Edit, window: &mut Window, cx: &mut Context<Self>) {
self.slash_menu_handle.hide(cx);
self.language_model_selector_menu_handle.hide(cx);
self.send_to_model(RequestType::SuggestEdits, window, cx);
}

Expand Down
Loading