agent: Add newtype for profile IDs (#27939)
This PR adds an `AgentProfileId` newtype for profile IDs that we can use instead of `Arc<str>` everywhere. Release Notes: - N/A
This commit is contained in:
parent
b2904e5d9f
commit
646f65511c
7 changed files with 59 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use assistant_settings::{AgentProfile, AssistantSettings};
|
||||
use assistant_settings::{AgentProfile, AgentProfileId, AssistantSettings};
|
||||
use fs::Fs;
|
||||
use gpui::{Action, Entity, FocusHandle, Subscription, WeakEntity, prelude::*};
|
||||
use indexmap::IndexMap;
|
||||
|
@ -15,7 +15,7 @@ use util::ResultExt as _;
|
|||
use crate::{ManageProfiles, ThreadStore, ToggleProfileSelector};
|
||||
|
||||
pub struct ProfileSelector {
|
||||
profiles: IndexMap<Arc<str>, AgentProfile>,
|
||||
profiles: IndexMap<AgentProfileId, AgentProfile>,
|
||||
fs: Arc<dyn Fs>,
|
||||
thread_store: WeakEntity<ThreadStore>,
|
||||
focus_handle: FocusHandle,
|
||||
|
@ -133,7 +133,7 @@ impl Render for ProfileSelector {
|
|||
.active_model()
|
||||
.map_or(false, |model| model.supports_tools());
|
||||
|
||||
let icon = match profile_id.as_ref() {
|
||||
let icon = match profile_id.as_str() {
|
||||
"write" => IconName::Pencil,
|
||||
"ask" => IconName::MessageBubbles,
|
||||
_ => IconName::UserRoundPen,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue