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:
Marshall Bowers 2025-04-05 12:32:16 -04:00 committed by GitHub
parent 525755c28e
commit caf0d6c5fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 46 additions and 20 deletions

View file

@ -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

View file

@ -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(),