assistant2: Add modal for adding context servers (#27434)
This PR adds a modal for adding context servers from the Assistant 2 configuration view: <img width="1394" alt="Screenshot 2025-03-25 at 12 22 50 PM" src="https://github.com/user-attachments/assets/52fe194f-7d88-4f3b-aee1-8c6385136e6b" /> Release Notes: - N/A
This commit is contained in:
parent
6b7167a32d
commit
275cecb262
3 changed files with 161 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
|||
mod add_context_server_modal;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use assistant_tool::{ToolSource, ToolWorkingSet};
|
||||
|
@ -5,12 +7,14 @@ use collections::HashMap;
|
|||
use context_server::manager::ContextServerManager;
|
||||
use gpui::{Action, AnyView, App, Entity, EventEmitter, FocusHandle, Focusable, Subscription};
|
||||
use language_model::{LanguageModelProvider, LanguageModelProviderId, LanguageModelRegistry};
|
||||
use ui::{
|
||||
prelude::*, Disclosure, Divider, DividerColor, ElevationIndex, Indicator, Switch, Tooltip,
|
||||
};
|
||||
use ui::{prelude::*, Disclosure, Divider, DividerColor, ElevationIndex, Indicator, Switch};
|
||||
use util::ResultExt as _;
|
||||
use zed_actions::ExtensionCategoryFilter;
|
||||
|
||||
pub(crate) use add_context_server_modal::AddContextServerModal;
|
||||
|
||||
use crate::AddContextServer;
|
||||
|
||||
pub struct AssistantConfiguration {
|
||||
focus_handle: FocusHandle,
|
||||
configuration_views_by_provider: HashMap<LanguageModelProviderId, AnyView>,
|
||||
|
@ -307,8 +311,9 @@ impl AssistantConfiguration {
|
|||
.icon(IconName::Plus)
|
||||
.icon_size(IconSize::Small)
|
||||
.icon_position(IconPosition::Start)
|
||||
.disabled(true)
|
||||
.tooltip(Tooltip::text("Not yet implemented")),
|
||||
.on_click(|_event, window, cx| {
|
||||
window.dispatch_action(AddContextServer.boxed_clone(), cx)
|
||||
}),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue