Hide old Agent UI when ACP flag set (#36533)
- **Use key value store instead of JSON** - **Default NewThread to the native agent when flagged** Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
ecee6746ec
commit
757b37fd41
1 changed files with 6 additions and 28 deletions
|
@ -881,6 +881,9 @@ impl AgentPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_thread(&mut self, action: &NewThread, window: &mut Window, cx: &mut Context<Self>) {
|
fn new_thread(&mut self, action: &NewThread, window: &mut Window, cx: &mut Context<Self>) {
|
||||||
|
if cx.has_flag::<AcpFeatureFlag>() {
|
||||||
|
return self.new_agent_thread(AgentType::NativeAgent, window, cx);
|
||||||
|
}
|
||||||
// Preserve chat box text when using creating new thread
|
// Preserve chat box text when using creating new thread
|
||||||
let preserved_text = self
|
let preserved_text = self
|
||||||
.active_message_editor()
|
.active_message_editor()
|
||||||
|
@ -2386,9 +2389,9 @@ impl AgentPanel {
|
||||||
})
|
})
|
||||||
.item(
|
.item(
|
||||||
ContextMenuEntry::new("New Thread")
|
ContextMenuEntry::new("New Thread")
|
||||||
.icon(IconName::Thread)
|
|
||||||
.icon_color(Color::Muted)
|
|
||||||
.action(NewThread::default().boxed_clone())
|
.action(NewThread::default().boxed_clone())
|
||||||
|
.icon(IconName::ZedAssistant)
|
||||||
|
.icon_color(Color::Muted)
|
||||||
.handler({
|
.handler({
|
||||||
let workspace = workspace.clone();
|
let workspace = workspace.clone();
|
||||||
move |window, cx| {
|
move |window, cx| {
|
||||||
|
@ -2399,7 +2402,7 @@ impl AgentPanel {
|
||||||
{
|
{
|
||||||
panel.update(cx, |panel, cx| {
|
panel.update(cx, |panel, cx| {
|
||||||
panel.set_selected_agent(
|
panel.set_selected_agent(
|
||||||
AgentType::Zed,
|
AgentType::NativeAgent,
|
||||||
window,
|
window,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
@ -2436,31 +2439,6 @@ impl AgentPanel {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.item(
|
|
||||||
ContextMenuEntry::new("New Native Agent Thread")
|
|
||||||
.icon(IconName::ZedAssistant)
|
|
||||||
.icon_color(Color::Muted)
|
|
||||||
.handler({
|
|
||||||
let workspace = workspace.clone();
|
|
||||||
move |window, cx| {
|
|
||||||
if let Some(workspace) = workspace.upgrade() {
|
|
||||||
workspace.update(cx, |workspace, cx| {
|
|
||||||
if let Some(panel) =
|
|
||||||
workspace.panel::<AgentPanel>(cx)
|
|
||||||
{
|
|
||||||
panel.update(cx, |panel, cx| {
|
|
||||||
panel.set_selected_agent(
|
|
||||||
AgentType::NativeAgent,
|
|
||||||
window,
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.separator()
|
.separator()
|
||||||
.header("External Agents")
|
.header("External Agents")
|
||||||
.when(cx.has_flag::<AcpFeatureFlag>(), |menu| {
|
.when(cx.has_flag::<AcpFeatureFlag>(), |menu| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue