acp: Add onboarding modal & title bar banner (#36784)
Release Notes: - N/A --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
1 parent
c5d3c7d790
commit
bd4e943597
12 files changed
+1556
-28
No files matched your search
File diff suppressed because it is too large.
Load diff
|
After Width: | Height: | Size: 176 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="160" height="61" fill="none"><g clip-path="url(#a)"><path fill="#000" d="M130.75.385c5.428 0 10.297 2.81 13.011 7.511l14.214 24.618-.013-.005c2.599 4.504 2.707 9.932.28 14.513-2.618 4.944-7.862 8.015-13.679 8.015h-31.811c-.452 0-.873-.242-1.103-.637a1.268 1.268 0 0 1 0-1.274l3.919-6.78c.223-.394.65-.636 1.102-.636h28.288a5.622 5.622 0 0 0 4.925-2.849 5.615 5.615 0 0 0 0-5.69l-14.214-24.617a5.621 5.621 0 0 0-4.925-2.848 5.621 5.621 0 0 0-4.925 2.848l-14.214 24.618a6.267 6.267 0 0 0-.319.643.998.998 0 0 1-.069.14L101.724 54.4l-.823 1.313-2.529 4.39a1.27 1.27 0 0 1-1.103.636h-7.83c-.452 0-.873-.242-1.102-.637-.23-.394-.23-.879 0-1.274l2.188-3.791H66.803c-3.32 0-6.454-1.122-8.818-3.167a17.141 17.141 0 0 1-3.394-3.96 1.261 1.261 0 0 1-.091-.137L34.2 12.573a5.622 5.622 0 0 0-4.925-2.849 5.621 5.621 0 0 0-4.924 2.85L10.137 37.19a5.615 5.615 0 0 0 0 5.69 5.63 5.63 0 0 0 4.925 2.841h29.862a1.276 1.276 0 0 1 1.102 1.912l-3.912 6.778a1.27 1.27 0 0 1-1.102.638H14.495c-3.32 0-6.454-1.128-8.817-3.173-5.906-5.104-7.36-12.883-3.62-19.363L16.267 7.89C18.872 3.385 23.517.583 28.697.39c.184-.006.356-.006.534-.006 5.378 0 10.45 3.007 13.246 7.85l12.986 22.372L68.58 7.891C71.186 3.385 75.83.582 81.01.39c.185-.006.358-.006.536-.006 4.453 0 8.71 2.039 11.672 5.588.337.407.388.98.127 1.446l-3.765 6.6a1.268 1.268 0 0 1-2.205.006l-.847-1.465a5.623 5.623 0 0 0-4.926-2.848 5.622 5.622 0 0 0-4.924 2.848L62.464 37.18a5.614 5.614 0 0 0 0 5.689 5.628 5.628 0 0 0 4.925 2.842H95.91L117.76 7.87c2.714-4.683 7.575-7.486 12.99-7.486Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 .385h160v60.36H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,2 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="119" height="44" fill="none"><path fill="#fff" d="M28.35 32.01c.994 0 1.896.242 2.706.725a5.339 5.339 0 0 1 1.937 1.916c.483.81.725 1.733.725 2.77 0 1.093-.242 2.094-.725 3.002a5.564 5.564 0 0 1-1.917 2.13c-.81.525-1.717.788-2.725.788-.994 0-1.896-.228-2.706-.682a5.337 5.337 0 0 1-1.937-1.916c-.468-.824-.703-1.761-.703-2.812 0-1.121.235-2.13.703-3.024.469-.894 1.107-1.597 1.916-2.108.81-.526 1.719-.789 2.727-.789Zm9.775.341h3.578v.831l-3.578.042-.042 5.921c0 .639.05 1.186.148 1.64.114.44.292.774.534 1 .241.228.553.342.936.342.398 0 .767-.114 1.108-.341a3.27 3.27 0 0 0 .937-.937l.575.468c-.312.468-.625.838-.937 1.108a3.42 3.42 0 0 1-.873.596 2.42 2.42 0 0 1-.788.256 3.63 3.63 0 0 1-.617.063c-.327 0-.66-.049-1.002-.148a2.237 2.237 0 0 1-.959-.533c-.283-.27-.51-.66-.681-1.171-.17-.525-.255-1.214-.255-2.066l.042-6.176-1.64.021v-.916c.37-.014.746-.148 1.13-.404.383-.27.724-.632 1.022-1.086.312-.454.525-.952.638-1.491h.724v2.981Zm10.067-.34c.994 0 1.896.241 2.706.724a5.339 5.339 0 0 1 1.937 1.916c.483.81.725 1.733.725 2.77 0 1.093-.242 2.094-.725 3.002a5.564 5.564 0 0 1-1.917 2.13c-.81.525-1.718.788-2.726.788-.993 0-1.895-.228-2.705-.682a5.337 5.337 0 0 1-1.937-1.916c-.469-.824-.703-1.761-.703-2.812 0-1.121.234-2.13.703-3.024.468-.894 1.107-1.597 1.916-2.108.81-.526 1.718-.789 2.726-.789Zm12.245 0c.795 0 1.484.12 2.066.362.596.241 1.058.56 1.385.958.326.397.49.831.49 1.3 0 .312-.086.581-.256.808-.17.213-.419.32-.745.32-.355.014-.611-.093-.768-.32-.141-.241-.212-.454-.212-.639 0-.142.021-.283.064-.425a.954.954 0 0 1 .255-.426c-.114-.34-.312-.59-.596-.746a2.34 2.34 0 0 0-.894-.32 4.112 4.112 0 0 0-.745-.085c-.966 0-1.782.392-2.45 1.172-.653.767-.98 1.888-.98 3.365 0 .95.149 1.797.447 2.535.312.738.746 1.32 1.3 1.746a3.127 3.127 0 0 0 1.917.617 3.76 3.76 0 0 0 1.916-.532c.61-.355 1.086-.788 1.427-1.299l.553.426a4.877 4.877 0 0 1-1.34 1.448c-.512.37-1.044.64-1.598.81-.54.17-1.05.255-1.533.255a5.586 5.586 0 0 1-2.642-.64 5.057 5.057 0 0 1-1.916-1.873c-.468-.824-.703-1.81-.703-2.96 0-.738.135-1.456.404-2.151.27-.696.646-1.32 1.13-1.874A5.46 5.46 0 0 1 58.18 32.5a5.157 5.157 0 0 1 2.258-.49Zm10.593 0c.994 0 1.896.241 2.705.724a5.339 5.339 0 0 1 1.938 1.916c.483.81.724 1.733.724 2.77 0 1.093-.242 2.094-.724 3.002a5.564 5.564 0 0 1-1.917 2.13c-.81.525-1.718.788-2.726.788-.994 0-1.895-.228-2.705-.682a5.337 5.337 0 0 1-1.937-1.916c-.469-.824-.703-1.761-.703-2.812 0-1.121.234-2.13.703-3.024.468-.894 1.107-1.597 1.916-2.108.809-.526 1.718-.789 2.726-.789ZM6.92 28.048c1.377 0 2.535.157 3.472.47.937.312 1.654.773 2.151 1.383.497.61.766 1.37.809 2.28a4.83 4.83 0 0 1-.255 1.745c-.185.597-.54 1.165-1.066 1.705-.51.525-1.235.95-2.172 1.277-.937.326-2.137.49-3.6.49H5.94c-.156 0-.305-.007-.447-.021v3.087c0 .384-.007.717-.021 1.002 0 .27-.014.497-.042.681l.66-.043a9.66 9.66 0 0 1 .639-.02l.66-.043V43H2.17v-.703c.54-.028.909-.149 1.107-.362.2-.227.305-.532.32-.916.028-.397.043-.845.043-1.342v-9.2c0-.284.007-.554.021-.81.014-.269.028-.51.042-.723l-.767.042-.766.043v-.938c.752-.014 1.526-.02 2.321-.02.795-.014 1.605-.022 2.428-.022Zm14.152 3.961c.398 0 .745.107 1.043.32.298.213.448.554.448 1.022 0 .114-.036.256-.107.426a1.19 1.19 0 0 1-.34.426c-.157.113-.363.17-.618.17a.971.971 0 0 1-.745-.362 1.076 1.076 0 0 1-.214-.83c-.355-.014-.724.078-1.107.277a4.01 4.01 0 0 0-1.043.83c-.327.341-.618.746-.873 1.215l.02 5.239c0 .284-.006.54-.02.766 0 .213-.022.44-.065.682.227-.014.447-.021.66-.021.227-.015.455-.03.682-.043V43h-4.366v-.639c.44 0 .745-.106.916-.32.17-.226.27-.532.299-.915.028-.398.042-.853.042-1.364v-5.537c.014-.227.042-.46.085-.702l-.767.042c-.241 0-.49.007-.745.022v-.873h.66c.61 0 1.03-.058 1.257-.171a2.9 2.9 0 0 0 .596-.405h.618c.028.227.049.511.063.852.014.326.029.746.043 1.257.213-.355.504-.703.873-1.044a5.32 5.32 0 0 1 1.235-.852 3.33 3.33 0 0 1 1.47-.34Zm59.605 8.733c0 .284-.008.54-.022.766-.014.213-.042.44-.085.682.227-.014.448-.021.66-.021.228-.015.455-.03.682-.043V43h-4.345v-.639c.44 0 .746-.106.916-.32.17-.226.27-.532.298-.915.029-.398.043-.853.043-1.364V29.05c.014-.212.035-.46.064-.745l-.767.042c-.241.014-.49.03-.745.043v-.894c.625 0 1.108-.028 1.448-.085.355-.057.618-.128.788-.213.185-.085.327-.178.426-.277h.617l.022 13.822ZM28.35 32.82c-.739 0-1.342.213-1.811.639-.468.425-.816.98-1.043 1.66a7.314 7.314 0 0 0-.32 2.194c0 .88.12 1.719.362 2.514.241.78.61 1.42 1.107 1.917.497.497 1.122.745 1.874.745.753 0 1.35-.213 1.79-.639.44-.426.753-.98.937-1.66a7.649 7.649 0 0 0 .298-2.152c0-.64-.064-1.264-.192-1.874a6.01 6.01 0 0 0-.553-1.683 3.268 3.268 0 0 0-1.001-1.214c-.398-.298-.88-.447-1.448-.447Zm19.841 0c-.738 0-1.342.213-1.81.639-.469.425-.816.98-1.043 1.66a7.314 7.314 0 0 0-.32 2.194c0 .88.12 1.719.362 2.514.241.78.61 1.42 1.107 1.917.497.497 1.122.745 1.874.745.753 0 1.35-.213 1.79-.639.44-.426.752-.98.937-1.66a7.649 7.649 0 0 0 .298-2.152c0-.64-.064-1.264-.192-1.874a6.01 6.01 0 0 0-.553-1.683 3.268 3.268 0 0 0-1.001-1.214c-.398-.298-.88-.447-1.449-.447Zm22.838 0c-.738 0-1.342.Line truncated
|
||||
|
After Width: | Height: | Size: 14 KiB |
@@ -1093,7 +1093,7 @@ impl AgentConfiguration {
|
||||
)
|
||||
.child(
|
||||
Label::new(
|
||||
"Use the full power of Zed's UI with your favorite agent, connected via the Agent Client Protocol.",
|
||||
"Bring the agent of your choice to Zed via our new Agent Client Protocol.",
|
||||
)
|
||||
.color(Color::Muted),
|
||||
),
|
||||
|
||||
@@ -14,6 +14,7 @@ use zed_actions::agent::ReauthenticateAgent;
|
||||
|
||||
use crate::acp::{AcpThreadHistory, ThreadHistoryEvent};
|
||||
use crate::agent_diff::AgentDiffThread;
|
||||
use crate::ui::AcpOnboardingModal;
|
||||
use crate::{
|
||||
AddContextServer, AgentDiffPane, ContinueThread, ContinueWithBurnMode,
|
||||
DeleteRecentlyOpenThread, ExpandMessageEditor, Follow, InlineAssistant, NewTextThread,
|
||||
@@ -77,7 +78,10 @@ use workspace::{
|
||||
};
|
||||
use zed_actions::{
|
||||
DecreaseBufferFontSize, IncreaseBufferFontSize, ResetBufferFontSize,
|
||||
agent::{OpenOnboardingModal, OpenSettings, ResetOnboarding, ToggleModelSelector},
|
||||
agent::{
|
||||
OpenAcpOnboardingModal, OpenOnboardingModal, OpenSettings, ResetOnboarding,
|
||||
ToggleModelSelector,
|
||||
},
|
||||
assistant::{OpenRulesLibrary, ToggleFocus},
|
||||
};
|
||||
|
||||
@@ -201,6 +205,9 @@ pub fn init(cx: &mut App) {
|
||||
.register_action(|workspace, _: &OpenOnboardingModal, window, cx| {
|
||||
AgentOnboardingModal::toggle(workspace, window, cx)
|
||||
})
|
||||
.register_action(|workspace, _: &OpenAcpOnboardingModal, window, cx| {
|
||||
AcpOnboardingModal::toggle(workspace, window, cx)
|
||||
})
|
||||
.register_action(|_workspace, _: &ResetOnboarding, window, cx| {
|
||||
window.dispatch_action(workspace::RestoreBanner.boxed_clone(), cx);
|
||||
window.refresh();
|
||||
@@ -1841,19 +1848,6 @@ impl AgentPanel {
|
||||
menu
|
||||
}
|
||||
|
||||
pub fn set_selected_agent(
|
||||
&mut self,
|
||||
agent: AgentType,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if self.selected_agent != agent {
|
||||
self.selected_agent = agent.clone();
|
||||
self.serialize(cx);
|
||||
}
|
||||
self.new_agent_thread(agent, window, cx);
|
||||
}
|
||||
|
||||
pub fn selected_agent(&self) -> AgentType {
|
||||
self.selected_agent.clone()
|
||||
}
|
||||
@@ -1864,6 +1858,11 @@ impl AgentPanel {
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if self.selected_agent != agent {
|
||||
self.selected_agent = agent.clone();
|
||||
self.serialize(cx);
|
||||
}
|
||||
|
||||
match agent {
|
||||
AgentType::Zed => {
|
||||
window.dispatch_action(
|
||||
@@ -2544,7 +2543,7 @@ impl AgentPanel {
|
||||
workspace.panel::<AgentPanel>(cx)
|
||||
{
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.set_selected_agent(
|
||||
panel.new_agent_thread(
|
||||
AgentType::NativeAgent,
|
||||
window,
|
||||
cx,
|
||||
@@ -2570,7 +2569,7 @@ impl AgentPanel {
|
||||
workspace.panel::<AgentPanel>(cx)
|
||||
{
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.set_selected_agent(
|
||||
panel.new_agent_thread(
|
||||
AgentType::TextThread,
|
||||
window,
|
||||
cx,
|
||||
@@ -2598,7 +2597,7 @@ impl AgentPanel {
|
||||
workspace.panel::<AgentPanel>(cx)
|
||||
{
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.set_selected_agent(
|
||||
panel.new_agent_thread(
|
||||
AgentType::Gemini,
|
||||
window,
|
||||
cx,
|
||||
@@ -2625,7 +2624,7 @@ impl AgentPanel {
|
||||
workspace.panel::<AgentPanel>(cx)
|
||||
{
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.set_selected_agent(
|
||||
panel.new_agent_thread(
|
||||
AgentType::ClaudeCode,
|
||||
window,
|
||||
cx,
|
||||
@@ -2658,7 +2657,7 @@ impl AgentPanel {
|
||||
workspace.panel::<AgentPanel>(cx)
|
||||
{
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.set_selected_agent(
|
||||
panel.new_agent_thread(
|
||||
AgentType::Custom {
|
||||
name: agent_name
|
||||
.clone(),
|
||||
@@ -2682,9 +2681,9 @@ impl AgentPanel {
|
||||
})
|
||||
.when(cx.has_flag::<GeminiAndNativeFeatureFlag>(), |menu| {
|
||||
menu.separator().link(
|
||||
"Add Your Own Agent",
|
||||
"Add Other Agents",
|
||||
OpenBrowser {
|
||||
url: "https://agentclientprotocol.com/".into(),
|
||||
url: zed_urls::external_agents_docs(cx),
|
||||
}
|
||||
.boxed_clone(),
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
mod acp_onboarding_modal;
|
||||
mod agent_notification;
|
||||
mod burn_mode_tooltip;
|
||||
mod context_pill;
|
||||
@@ -6,6 +7,7 @@ mod onboarding_modal;
|
||||
pub mod preview;
|
||||
mod unavailable_editing_tooltip;
|
||||
|
||||
pub use acp_onboarding_modal::*;
|
||||
pub use agent_notification::*;
|
||||
pub use burn_mode_tooltip::*;
|
||||
pub use context_pill::*;
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
use client::zed_urls;
|
||||
use gpui::{
|
||||
ClickEvent, DismissEvent, Entity, EventEmitter, FocusHandle, Focusable, MouseDownEvent, Render,
|
||||
linear_color_stop, linear_gradient,
|
||||
};
|
||||
use ui::{TintColor, Vector, VectorName, prelude::*};
|
||||
use workspace::{ModalView, Workspace};
|
||||
|
||||
use crate::agent_panel::{AgentPanel, AgentType};
|
||||
|
||||
macro_rules! acp_onboarding_event {
|
||||
($name:expr) => {
|
||||
telemetry::event!($name, source = "ACP Onboarding");
|
||||
};
|
||||
($name:expr, $($key:ident $(= $value:expr)?),+ $(,)?) => {
|
||||
telemetry::event!($name, source = "ACP Onboarding", $($key $(= $value)?),+);
|
||||
};
|
||||
}
|
||||
|
||||
pub struct AcpOnboardingModal {
|
||||
focus_handle: FocusHandle,
|
||||
workspace: Entity<Workspace>,
|
||||
}
|
||||
|
||||
impl AcpOnboardingModal {
|
||||
pub fn toggle(workspace: &mut Workspace, window: &mut Window, cx: &mut Context<Workspace>) {
|
||||
let workspace_entity = cx.entity();
|
||||
workspace.toggle_modal(window, cx, |_window, cx| Self {
|
||||
workspace: workspace_entity,
|
||||
focus_handle: cx.focus_handle(),
|
||||
});
|
||||
}
|
||||
|
||||
fn open_panel(&mut self, _: &ClickEvent, window: &mut Window, cx: &mut Context<Self>) {
|
||||
self.workspace.update(cx, |workspace, cx| {
|
||||
workspace.focus_panel::<AgentPanel>(window, cx);
|
||||
|
||||
if let Some(panel) = workspace.panel::<AgentPanel>(cx) {
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.new_agent_thread(AgentType::Gemini, window, cx);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
cx.emit(DismissEvent);
|
||||
|
||||
acp_onboarding_event!("Open Panel Clicked");
|
||||
}
|
||||
|
||||
fn view_docs(&mut self, _: &ClickEvent, _: &mut Window, cx: &mut Context<Self>) {
|
||||
cx.open_url(&zed_urls::external_agents_docs(cx));
|
||||
cx.notify();
|
||||
|
||||
acp_onboarding_event!("Documentation Link Clicked");
|
||||
}
|
||||
|
||||
fn cancel(&mut self, _: &menu::Cancel, _: &mut Window, cx: &mut Context<Self>) {
|
||||
cx.emit(DismissEvent);
|
||||
}
|
||||
}
|
||||
|
||||
impl EventEmitter<DismissEvent> for AcpOnboardingModal {}
|
||||
|
||||
impl Focusable for AcpOnboardingModal {
|
||||
fn focus_handle(&self, _cx: &App) -> FocusHandle {
|
||||
self.focus_handle.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl ModalView for AcpOnboardingModal {}
|
||||
|
||||
impl Render for AcpOnboardingModal {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let illustration_element = |label: bool, opacity: f32| {
|
||||
h_flex()
|
||||
.px_1()
|
||||
.py_0p5()
|
||||
.gap_1()
|
||||
.rounded_sm()
|
||||
.bg(cx.theme().colors().element_active.opacity(0.05))
|
||||
.border_1()
|
||||
.border_color(cx.theme().colors().border)
|
||||
.border_dashed()
|
||||
.child(
|
||||
Icon::new(IconName::Stop)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Custom(cx.theme().colors().text_muted.opacity(0.15))),
|
||||
)
|
||||
.map(|this| {
|
||||
if label {
|
||||
this.child(
|
||||
Label::new("Your Agent Here")
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Muted),
|
||||
)
|
||||
} else {
|
||||
this.child(
|
||||
div().w_16().h_1().rounded_full().bg(cx
|
||||
.theme()
|
||||
.colors()
|
||||
.element_active
|
||||
.opacity(0.6)),
|
||||
)
|
||||
}
|
||||
})
|
||||
.opacity(opacity)
|
||||
};
|
||||
|
||||
let illustration = h_flex()
|
||||
.relative()
|
||||
.h(rems_from_px(126.))
|
||||
.bg(cx.theme().colors().editor_background)
|
||||
.border_b_1()
|
||||
.border_color(cx.theme().colors().border_variant)
|
||||
.justify_center()
|
||||
.gap_8()
|
||||
.rounded_t_md()
|
||||
.overflow_hidden()
|
||||
.child(
|
||||
div().absolute().inset_0().w(px(515.)).h(px(126.)).child(
|
||||
Vector::new(VectorName::AcpGrid, rems_from_px(515.), rems_from_px(126.))
|
||||
.color(ui::Color::Custom(cx.theme().colors().text.opacity(0.02))),
|
||||
),
|
||||
)
|
||||
.child(div().absolute().inset_0().size_full().bg(linear_gradient(
|
||||
0.,
|
||||
linear_color_stop(
|
||||
cx.theme().colors().elevated_surface_background.opacity(0.1),
|
||||
0.9,
|
||||
),
|
||||
linear_color_stop(
|
||||
cx.theme().colors().elevated_surface_background.opacity(0.),
|
||||
0.,
|
||||
),
|
||||
)))
|
||||
.child(
|
||||
div()
|
||||
.absolute()
|
||||
.inset_0()
|
||||
.size_full()
|
||||
.bg(gpui::black().opacity(0.15)),
|
||||
)
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_4()
|
||||
.child(
|
||||
Vector::new(VectorName::AcpLogo, rems_from_px(106.), rems_from_px(40.))
|
||||
.color(ui::Color::Custom(cx.theme().colors().text.opacity(0.8))),
|
||||
)
|
||||
.child(
|
||||
Vector::new(
|
||||
VectorName::AcpLogoSerif,
|
||||
rems_from_px(111.),
|
||||
rems_from_px(41.),
|
||||
)
|
||||
.color(ui::Color::Custom(cx.theme().colors().text.opacity(0.8))),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
v_flex()
|
||||
.gap_1p5()
|
||||
.child(illustration_element(false, 0.15))
|
||||
.child(illustration_element(true, 0.3))
|
||||
.child(
|
||||
h_flex()
|
||||
.pl_1()
|
||||
.pr_2()
|
||||
.py_0p5()
|
||||
.gap_1()
|
||||
.rounded_sm()
|
||||
.bg(cx.theme().colors().element_active.opacity(0.2))
|
||||
.border_1()
|
||||
.border_color(cx.theme().colors().border)
|
||||
.child(
|
||||
Icon::new(IconName::AiGemini)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Muted),
|
||||
)
|
||||
.child(Label::new("New Gemini CLI Thread").size(LabelSize::Small)),
|
||||
)
|
||||
.child(illustration_element(true, 0.3))
|
||||
.child(illustration_element(false, 0.15)),
|
||||
);
|
||||
|
||||
let heading = v_flex()
|
||||
.w_full()
|
||||
.gap_1()
|
||||
.child(
|
||||
Label::new("Now Available")
|
||||
.size(LabelSize::Small)
|
||||
.color(Color::Muted),
|
||||
)
|
||||
.child(Headline::new("Bring Your Own Agent to Zed").size(HeadlineSize::Large));
|
||||
|
||||
let copy = "Bring the agent of your choice to Zed via our new Agent Client Protocol (ACP), starting with Google's Gemini CLI integration.";
|
||||
|
||||
let open_panel_button = Button::new("open-panel", "Start with Gemini CLI")
|
||||
.icon_size(IconSize::Indicator)
|
||||
.style(ButtonStyle::Tinted(TintColor::Accent))
|
||||
.full_width()
|
||||
.on_click(cx.listener(Self::open_panel));
|
||||
|
||||
let docs_button = Button::new("add-other-agents", "Add Other Agents")
|
||||
.icon(IconName::ArrowUpRight)
|
||||
.icon_size(IconSize::Indicator)
|
||||
.icon_color(Color::Muted)
|
||||
.full_width()
|
||||
.on_click(cx.listener(Self::view_docs));
|
||||
|
||||
let close_button = h_flex().absolute().top_2().right_2().child(
|
||||
IconButton::new("cancel", IconName::Close).on_click(cx.listener(
|
||||
|_, _: &ClickEvent, _window, cx| {
|
||||
acp_onboarding_event!("Canceled", trigger = "X click");
|
||||
cx.emit(DismissEvent);
|
||||
},
|
||||
)),
|
||||
);
|
||||
|
||||
v_flex()
|
||||
.id("acp-onboarding")
|
||||
.key_context("AcpOnboardingModal")
|
||||
.relative()
|
||||
.w(rems(34.))
|
||||
.h_full()
|
||||
.elevation_3(cx)
|
||||
.track_focus(&self.focus_handle(cx))
|
||||
.overflow_hidden()
|
||||
.on_action(cx.listener(Self::cancel))
|
||||
.on_action(cx.listener(|_, _: &menu::Cancel, _window, cx| {
|
||||
acp_onboarding_event!("Canceled", trigger = "Action");
|
||||
cx.emit(DismissEvent);
|
||||
}))
|
||||
.on_any_mouse_down(cx.listener(|this, _: &MouseDownEvent, window, _cx| {
|
||||
this.focus_handle.focus(window);
|
||||
}))
|
||||
.child(illustration)
|
||||
.child(
|
||||
v_flex()
|
||||
.p_4()
|
||||
.gap_2()
|
||||
.child(heading)
|
||||
.child(Label::new(copy).color(Color::Muted))
|
||||
.child(
|
||||
v_flex()
|
||||
.w_full()
|
||||
.mt_2()
|
||||
.gap_1()
|
||||
.child(open_panel_button)
|
||||
.child(docs_button),
|
||||
),
|
||||
)
|
||||
.child(close_button)
|
||||
}
|
||||
}
|
||||
@@ -43,3 +43,11 @@ pub fn ai_privacy_and_security(cx: &App) -> String {
|
||||
server_url = server_url(cx)
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns the URL to Zed AI's external agents documentation.
|
||||
pub fn external_agents_docs(cx: &App) -> String {
|
||||
format!(
|
||||
"{server_url}/docs/ai/external-agents",
|
||||
server_url = server_url(cx)
|
||||
)
|
||||
}
|
||||
@@ -119,7 +119,7 @@ impl Render for OnboardingBanner {
|
||||
h_flex()
|
||||
.h_full()
|
||||
.gap_1()
|
||||
.child(Icon::new(self.details.icon_name).size(IconSize::Small))
|
||||
.child(Icon::new(self.details.icon_name).size(IconSize::XSmall))
|
||||
.child(
|
||||
h_flex()
|
||||
.gap_0p5()
|
||||
|
||||
@@ -275,11 +275,11 @@ impl TitleBar {
|
||||
|
||||
let banner = cx.new(|cx| {
|
||||
OnboardingBanner::new(
|
||||
"Debugger Onboarding",
|
||||
IconName::Debug,
|
||||
"The Debugger",
|
||||
None,
|
||||
zed_actions::debugger::OpenOnboardingModal.boxed_clone(),
|
||||
"ACP Onboarding",
|
||||
IconName::Sparkle,
|
||||
"Bring Your Own Agent",
|
||||
Some("Introducing:".into()),
|
||||
zed_actions::agent::OpenAcpOnboardingModal.boxed_clone(),
|
||||
cx,
|
||||
)
|
||||
});
|
||||
|
||||
@@ -13,6 +13,9 @@ use crate::prelude::*;
|
||||
)]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum VectorName {
|
||||
AcpGrid,
|
||||
AcpLogo,
|
||||
AcpLogoSerif,
|
||||
AiGrid,
|
||||
DebuggerGrid,
|
||||
Grid,
|
||||
|
||||
@@ -284,6 +284,8 @@ pub mod agent {
|
||||
OpenSettings,
|
||||
/// Opens the agent onboarding modal.
|
||||
OpenOnboardingModal,
|
||||
/// Opens the ACP onboarding modal.
|
||||
OpenAcpOnboardingModal,
|
||||
/// Resets the agent onboarding state.
|
||||
ResetOnboarding,
|
||||
/// Starts a chat conversation with the agent.
|
||||
|
||||
Reference in new issue
Block a user