Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

assistant2: Add header to fork profile modal (#27666)

Marshall Bowers83f3fbfef564
diff --git a/crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs b/crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs
index 6df10953955..dd226a3fc48 100644
--- a/crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs
+++ b/crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs
@@ -307,9 +307,27 @@ impl ManageProfilesModal {
_window: &mut Window,
cx: &mut Context<Self>,
) -> impl IntoElement {
+ let settings = AssistantSettings::get_global(cx);
+
+ let base_profile_name = mode.base_profile_id.as_ref().map(|base_profile_id| {
+ settings
+ .profiles
+ .get(base_profile_id)
+ .map(|profile| profile.name.clone())
+ .unwrap_or_else(|| "Unknown".into())
+ });
+
v_flex()
.id("new-profile")
.track_focus(&self.focus_handle(cx))
+ .child(ProfileModalHeader::new(
+ match base_profile_name {
+ Some(base_profile) => format!("Fork {base_profile}"),
+ None => "New Profile".into(),
+ },
+ IconName::Plus,
+ ))
+ .child(ListSeparator)
.child(h_flex().p_2().child(mode.name_editor.clone()))
}