mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-26 18:40:25 +01:00
df1ba676f2
Keep the external agent composer compact and match the Zed Agent's Fast Mode and Thinking Effort controls. Model and Mode stay next to Send. Other settings go in Agent Options, where pickers keep their search, groups, and favorites. If the agent changes its options while a submenu is open, close the menu and release the old picker. <img width="635" height="197" alt="image" src="https://github.com/user-attachments/assets/2f2ad595-98ea-441e-80c7-f41d9c01bc00" /> (Fast mode will use the fast mode toggle in the next adapter release) Release Notes: - Aligned External Agent config options with native Zed agent UI for similar controls.
82 lines
2.5 KiB
Rust
82 lines
2.5 KiB
Rust
mod agent_notification;
|
|
mod end_trial_upsell;
|
|
mod mention_crease;
|
|
mod sandbox_status_tooltip;
|
|
mod session_notice;
|
|
mod terminal_tool_header;
|
|
mod undo_reject_toast;
|
|
|
|
pub use agent_notification::*;
|
|
pub use end_trial_upsell::*;
|
|
pub use language_model_selector::{
|
|
ModelSelectorFooter, ModelSelectorHeader, ModelSelectorListItem, ModelSelectorTooltip,
|
|
};
|
|
pub use mention_crease::*;
|
|
pub use sandbox_status_tooltip::*;
|
|
pub use session_notice::*;
|
|
pub use terminal_tool_header::*;
|
|
pub use undo_reject_toast::*;
|
|
|
|
use gpui::{App, ElementId, SharedString};
|
|
use ui::{ButtonLike, IconButton, TintColor, prelude::*};
|
|
|
|
pub(crate) fn fast_mode_button(id: impl Into<ElementId>, enabled: bool, cx: &App) -> IconButton {
|
|
let (icon, color) = if enabled {
|
|
(IconName::FastForward, Color::Accent)
|
|
} else {
|
|
(
|
|
IconName::FastForwardOff,
|
|
Color::Custom(cx.theme().colors().icon_disabled.opacity(0.8)),
|
|
)
|
|
};
|
|
IconButton::new(id, icon)
|
|
.icon_size(IconSize::Small)
|
|
.icon_color(color)
|
|
}
|
|
|
|
pub(crate) fn thinking_effort_trigger(
|
|
id: impl Into<ElementId>,
|
|
label: impl Into<SharedString>,
|
|
menu_open: bool,
|
|
standalone: bool,
|
|
) -> ButtonLike {
|
|
let (label_color, icon) = if menu_open {
|
|
(Color::Accent, IconName::ChevronUp)
|
|
} else {
|
|
(Color::Muted, IconName::ChevronDown)
|
|
};
|
|
let label = Label::new(label).size(LabelSize::Small).color(label_color);
|
|
let chevron = Icon::new(icon).size(IconSize::XSmall).color(Color::Muted);
|
|
let trigger = if standalone {
|
|
ButtonLike::new(id).child(
|
|
h_flex()
|
|
.gap_1()
|
|
.child(
|
|
Icon::new(IconName::ThinkingMode)
|
|
.size(IconSize::Small)
|
|
.color(Color::Accent),
|
|
)
|
|
.child(label)
|
|
.child(chevron),
|
|
)
|
|
} else {
|
|
ButtonLike::new_rounded_right(id)
|
|
.child(label)
|
|
.child(chevron)
|
|
};
|
|
trigger.selected_style(ButtonStyle::Tinted(TintColor::Accent))
|
|
}
|
|
|
|
/// Returns the appropriate [`DocumentationSide`] for documentation asides
|
|
/// in the agent panel, based on the current dock position.
|
|
pub fn documentation_aside_side(cx: &gpui::App) -> ui::DocumentationSide {
|
|
use agent_settings::AgentSettings;
|
|
use settings::Settings;
|
|
use ui::DocumentationSide;
|
|
|
|
match AgentSettings::get_global(cx).dock {
|
|
settings::DockPosition::Left => DocumentationSide::Right,
|
|
settings::DockPosition::Bottom | settings::DockPosition::Right => DocumentationSide::Left,
|
|
}
|
|
}
|