mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
agent: Remove new thread location setting (#55575)
cc: @danilo-leal This setting is from when we had the git worktree picker in the agent panel, now that it is in the menu bar it doesn't make sense to keep it. We plan to add a similar feature in the future to handle the "new thread == new git worktree" workflow Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
6dd03c9fb8
commit
ff8fa053ff
8 changed files with 3 additions and 71 deletions
|
|
@ -1152,10 +1152,6 @@
|
|||
"tools": {},
|
||||
},
|
||||
},
|
||||
// Whether to start a new thread in the current local project or in a new Git worktree.
|
||||
//
|
||||
// Default: local_project
|
||||
"new_thread_location": "local_project",
|
||||
// Where to show notifications when the agent has either completed
|
||||
// its response, or else needs confirmation before it can run a
|
||||
// tool action.
|
||||
|
|
|
|||
|
|
@ -597,7 +597,6 @@ mod tests {
|
|||
tool_permissions,
|
||||
show_turn_stats: false,
|
||||
show_merge_conflict_indicator: true,
|
||||
new_thread_location: Default::default(),
|
||||
sidebar_side: Default::default(),
|
||||
thinking_display: Default::default(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use project::DisableAiSettings;
|
|||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::{
|
||||
DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection, NewThreadLocation,
|
||||
DockPosition, DockSide, LanguageModelParameters, LanguageModelSelection,
|
||||
NotifyWhenAgentWaiting, PlaySoundWhenAgentDone, RegisterSetting, Settings, SettingsContent,
|
||||
SettingsStore, SidebarDockPosition, SidebarSide, ThinkingBlockDisplay, ToolPermissionMode,
|
||||
update_settings_file, update_settings_file_with_completion,
|
||||
|
|
@ -167,7 +167,6 @@ pub struct AgentSettings {
|
|||
pub show_turn_stats: bool,
|
||||
pub show_merge_conflict_indicator: bool,
|
||||
pub tool_permissions: ToolPermissions,
|
||||
pub new_thread_location: NewThreadLocation,
|
||||
}
|
||||
|
||||
impl AgentSettings {
|
||||
|
|
@ -671,7 +670,6 @@ impl Settings for AgentSettings {
|
|||
show_turn_stats: agent.show_turn_stats.unwrap(),
|
||||
show_merge_conflict_indicator: agent.show_merge_conflict_indicator.unwrap(),
|
||||
tool_permissions: compile_tool_permissions(agent.tool_permissions),
|
||||
new_thread_location: agent.new_thread_location.unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -713,7 +713,6 @@ mod tests {
|
|||
tool_permissions: Default::default(),
|
||||
show_turn_stats: false,
|
||||
show_merge_conflict_indicator: true,
|
||||
new_thread_location: Default::default(),
|
||||
sidebar_side: Default::default(),
|
||||
thinking_display: Default::default(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ use crate::DEFAULT_THREAD_TITLE;
|
|||
use crate::message_editor::SessionCapabilities;
|
||||
use rope::Point;
|
||||
use settings::{
|
||||
NewThreadLocation, NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide,
|
||||
ThinkingBlockDisplay,
|
||||
NotifyWhenAgentWaiting, Settings as _, SettingsStore, SidebarSide, ThinkingBlockDisplay,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -862,10 +861,7 @@ impl ConversationView {
|
|||
SidebarSide::Left => "left",
|
||||
SidebarSide::Right => "right",
|
||||
};
|
||||
let thread_location = match AgentSettings::get_global(cx).new_thread_location {
|
||||
NewThreadLocation::LocalProject => "current_worktree",
|
||||
NewThreadLocation::NewWorktree => "new_worktree",
|
||||
};
|
||||
let thread_location = "current_worktree";
|
||||
|
||||
let load_task = cx.spawn_in(window, async move |this, cx| {
|
||||
let connection = match connect_result.await {
|
||||
|
|
|
|||
|
|
@ -9,30 +9,6 @@ use crate::ExtendingVec;
|
|||
|
||||
use crate::DockPosition;
|
||||
|
||||
/// Where new threads should start by default.
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Default,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
JsonSchema,
|
||||
MergeFrom,
|
||||
strum::VariantArray,
|
||||
strum::VariantNames,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum NewThreadLocation {
|
||||
/// Start threads in the current project.
|
||||
#[default]
|
||||
LocalProject,
|
||||
/// Start threads in a new worktree.
|
||||
NewWorktree,
|
||||
}
|
||||
|
||||
/// Where to position the threads sidebar.
|
||||
#[derive(
|
||||
Clone,
|
||||
|
|
@ -161,10 +137,6 @@ pub struct AgentSettingsContent {
|
|||
///
|
||||
/// Default: write
|
||||
pub default_profile: Option<Arc<str>>,
|
||||
/// Where new threads should start by default.
|
||||
///
|
||||
/// Default: "local_project"
|
||||
pub new_thread_location: Option<NewThreadLocation>,
|
||||
/// The available agent profiles.
|
||||
pub profiles: Option<IndexMap<Arc<str>, AgentProfileContent>>,
|
||||
/// Where to show a popup notification when the agent is waiting for user input.
|
||||
|
|
@ -270,10 +242,6 @@ impl AgentSettingsContent {
|
|||
self.default_profile = Some(profile_id);
|
||||
}
|
||||
|
||||
pub fn set_new_thread_location(&mut self, value: NewThreadLocation) {
|
||||
self.new_thread_location = Some(value);
|
||||
}
|
||||
|
||||
pub fn add_favorite_model(&mut self, model: LanguageModelSelection) {
|
||||
// Note: this is intentional to not compare using `PartialEq`here.
|
||||
// Full equality would treat entries that differ just in thinking/effort/speed
|
||||
|
|
|
|||
|
|
@ -7429,29 +7429,6 @@ fn ai_page(cx: &App) -> SettingsPage {
|
|||
}),
|
||||
];
|
||||
|
||||
items.push(SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "New Thread Location",
|
||||
description: "Whether to start a new thread in the current local project or in a new Git worktree.",
|
||||
field: Box::new(SettingField {
|
||||
json_path: Some("agent.new_thread_location"),
|
||||
pick: |settings_content| {
|
||||
settings_content
|
||||
.agent
|
||||
.as_ref()?
|
||||
.new_thread_location
|
||||
.as_ref()
|
||||
},
|
||||
write: |settings_content, value, _| {
|
||||
settings_content
|
||||
.agent
|
||||
.get_or_insert_default()
|
||||
.new_thread_location = value;
|
||||
},
|
||||
}),
|
||||
metadata: None,
|
||||
files: USER,
|
||||
}));
|
||||
|
||||
items.extend([
|
||||
SettingsPageItem::SettingItem(SettingItem {
|
||||
title: "Single File Review",
|
||||
|
|
|
|||
|
|
@ -530,7 +530,6 @@ fn init_renderers(cx: &mut App) {
|
|||
.add_basic_renderer::<settings::SteppingGranularity>(render_dropdown)
|
||||
.add_basic_renderer::<settings::NotifyWhenAgentWaiting>(render_dropdown)
|
||||
.add_basic_renderer::<settings::PlaySoundWhenAgentDone>(render_dropdown)
|
||||
.add_basic_renderer::<settings::NewThreadLocation>(render_dropdown)
|
||||
.add_basic_renderer::<settings::ThinkingBlockDisplay>(render_dropdown)
|
||||
.add_basic_renderer::<settings::ImageFileSizeUnit>(render_dropdown)
|
||||
.add_basic_renderer::<settings::StatusStyle>(render_dropdown)
|
||||
|
|
|
|||
Loading…
Reference in a new issue