Fix focus handle leak (#26090)
This fixes a major performance issue in the current git beta. This PR also removes the PopoverButton component, which was easy to misuse. Release Notes: - Git Beta: Fix frame drops caused by opening the git panel --------- Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
parent
fe18c73a07
commit
674fb7621f
13 changed files with 276 additions and 459 deletions
|
@ -8,6 +8,7 @@ use gpui::{
|
|||
TextStyle, WeakEntity,
|
||||
};
|
||||
use language_model::LanguageModelRegistry;
|
||||
use language_model_selector::ToggleModelSelector;
|
||||
use rope::Point;
|
||||
use settings::Settings;
|
||||
use std::time::Duration;
|
||||
|
@ -297,11 +298,9 @@ impl Render for MessageEditor {
|
|||
v_flex()
|
||||
.key_context("MessageEditor")
|
||||
.on_action(cx.listener(Self::chat))
|
||||
.on_action(cx.listener(|this, action, window, cx| {
|
||||
let selector = this.model_selector.read(cx).selector.clone();
|
||||
selector.update(cx, |this, cx| {
|
||||
this.toggle_model_selector(action, window, cx);
|
||||
})
|
||||
.on_action(cx.listener(|this, _: &ToggleModelSelector, window, cx| {
|
||||
this.model_selector
|
||||
.update(cx, |model_selector, cx| model_selector.toggle(window, cx));
|
||||
}))
|
||||
.on_action(cx.listener(Self::toggle_context_picker))
|
||||
.on_action(cx.listener(Self::remove_all_context))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue