mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-19 11:04:06 +00:00
Remove project panel undo and redo feature flag (#62124)
Release Notes: - N/A
This commit is contained in:
parent
b8c75f1717
commit
a12e3c0673
4 changed files with 8 additions and 31 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -14281,7 +14281,6 @@ dependencies = [
|
|||
"collections",
|
||||
"criterion",
|
||||
"editor",
|
||||
"feature_flags",
|
||||
"file_icons",
|
||||
"fs",
|
||||
"futures 0.3.32",
|
||||
|
|
|
|||
|
|
@ -78,22 +78,6 @@ impl FeatureFlag for RenameToolFeatureFlag {
|
|||
}
|
||||
register_feature_flag!(RenameToolFeatureFlag);
|
||||
|
||||
pub struct ProjectPanelUndoRedoFeatureFlag;
|
||||
|
||||
impl FeatureFlag for ProjectPanelUndoRedoFeatureFlag {
|
||||
const NAME: &'static str = "project-panel-undo-redo";
|
||||
type Value = PresenceFlag;
|
||||
|
||||
fn enabled_for_staff() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn enabled_for_all() -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
register_feature_flag!(ProjectPanelUndoRedoFeatureFlag);
|
||||
|
||||
/// Controls how agent thread worktree chips are labeled in the sidebar.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, EnumFeatureFlag)]
|
||||
pub enum AgentThreadWorktreeLabel {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ markdown_preview.workspace = true
|
|||
zed_actions.workspace = true
|
||||
telemetry.workspace = true
|
||||
notifications.workspace = true
|
||||
feature_flags.workspace = true
|
||||
fs.workspace = true
|
||||
log.workspace = true
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use editor::{
|
|||
entry_diagnostic_aware_icon_name_and_color, entry_git_aware_label_color,
|
||||
},
|
||||
};
|
||||
use feature_flags::{FeatureFlagAppExt, ProjectPanelUndoRedoFeatureFlag};
|
||||
use file_icons::FileIcons;
|
||||
use fs::TrashId;
|
||||
use git;
|
||||
|
|
@ -1111,7 +1110,7 @@ impl ProjectPanel {
|
|||
};
|
||||
|
||||
let has_pasteable_content = self.has_pasteable_content(cx);
|
||||
let context_menu = ContextMenu::build(window, cx, |menu, _, cx| {
|
||||
let context_menu = ContextMenu::build(window, cx, |menu, _, _| {
|
||||
menu.context(self.focus_handle.clone()).map(|menu| {
|
||||
if is_read_only {
|
||||
menu.when(is_markdown, |menu| {
|
||||
|
|
@ -1156,16 +1155,13 @@ impl ProjectPanel {
|
|||
.action("Copy", Box::new(Copy))
|
||||
.action("Duplicate", Box::new(Duplicate))
|
||||
.action_disabled_when(!has_pasteable_content, "Paste", Box::new(Paste))
|
||||
.when(
|
||||
!is_collab && cx.has_flag::<ProjectPanelUndoRedoFeatureFlag>(),
|
||||
|menu| {
|
||||
let can_undo = self.undo_manager.can_undo();
|
||||
let can_redo = self.undo_manager.can_redo();
|
||||
.when(!is_collab, |menu| {
|
||||
let can_undo = self.undo_manager.can_undo();
|
||||
let can_redo = self.undo_manager.can_redo();
|
||||
|
||||
menu.action_disabled_when(!can_undo, "Undo", Box::new(Undo))
|
||||
.action_disabled_when(!can_redo, "Redo", Box::new(Redo))
|
||||
},
|
||||
)
|
||||
menu.action_disabled_when(!can_undo, "Undo", Box::new(Undo))
|
||||
.action_disabled_when(!can_redo, "Redo", Box::new(Redo))
|
||||
})
|
||||
.when(is_remote, |menu| {
|
||||
menu.separator()
|
||||
.action("Download...", Box::new(DownloadFromRemote))
|
||||
|
|
@ -6932,7 +6928,6 @@ impl Render for ProjectPanel {
|
|||
// version that understands these messages.
|
||||
let is_collab = project.is_via_collab();
|
||||
let is_local = project.is_local();
|
||||
let supports_undo = cx.has_flag::<ProjectPanelUndoRedoFeatureFlag>();
|
||||
|
||||
if has_worktree {
|
||||
let item_count = self
|
||||
|
|
@ -7077,7 +7072,7 @@ impl Render for ProjectPanel {
|
|||
.on_action(cx.listener(Self::add_to_gitignore))
|
||||
.on_action(cx.listener(Self::add_to_git_info_exclude))
|
||||
.when(!is_collab, |el| el.on_action(cx.listener(Self::trash)))
|
||||
.when(!is_collab && supports_undo, |el| {
|
||||
.when(!is_collab, |el| {
|
||||
el.on_action(cx.listener(Self::undo))
|
||||
.on_action(cx.listener(Self::redo))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue