agent: Fix opening configuration view from the model selector (#28154)
This PR fixes an issue where opening the configuration view from the model selector in the Agent (or inline assist) was not working properly. Fixes https://github.com/zed-industries/zed/issues/28078. Release Notes: - Agent Beta: Fixed an issue where selecting "Configure" in the model selector would not bring up the configuration view.
This commit is contained in:
parent
525755c28e
commit
caf0d6c5fa
11 changed files with 46 additions and 20 deletions
|
@ -19,6 +19,5 @@ log.workspace = true
|
|||
picker.workspace = true
|
||||
proto.workspace = true
|
||||
ui.workspace = true
|
||||
workspace.workspace = true
|
||||
zed_actions.workspace = true
|
||||
workspace-hack.workspace = true
|
||||
zed_actions.workspace = true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use feature_flags::ZedPro;
|
||||
use feature_flags::{Assistant2FeatureFlag, ZedPro};
|
||||
use gpui::{
|
||||
Action, AnyElement, AnyView, App, Corner, DismissEvent, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, Subscription, Task, WeakEntity, action_with_deprecated_aliases,
|
||||
|
@ -11,7 +11,6 @@ use language_model::{
|
|||
use picker::{Picker, PickerDelegate};
|
||||
use proto::Plan;
|
||||
use ui::{ListItem, ListItemSpacing, PopoverMenu, PopoverMenuHandle, PopoverTrigger, prelude::*};
|
||||
use workspace::ShowConfiguration;
|
||||
|
||||
action_with_deprecated_aliases!(
|
||||
assistant,
|
||||
|
@ -522,7 +521,13 @@ impl PickerDelegate for LanguageModelPickerDelegate {
|
|||
.icon_color(Color::Muted)
|
||||
.icon_position(IconPosition::Start)
|
||||
.on_click(|_, window, cx| {
|
||||
window.dispatch_action(ShowConfiguration.boxed_clone(), cx);
|
||||
let configure_action = if cx.has_flag::<Assistant2FeatureFlag>() {
|
||||
zed_actions::agent::OpenConfiguration.boxed_clone()
|
||||
} else {
|
||||
zed_actions::assistant::ShowConfiguration.boxed_clone()
|
||||
};
|
||||
|
||||
window.dispatch_action(configure_action, cx);
|
||||
}),
|
||||
)
|
||||
.into_any(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue