Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
git_ui: Fix Git Graph button flicker in Git panel (#52285)
Xiaobo Liu0a4269ffa279
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rsindex d640a3cd15c..6c6b4de1e9a 100644--- a/crates/git_ui/src/git_panel.rs+++ b/crates/git_ui/src/git_panel.rs@@ -20,6 +20,7 @@ use editor::{actions::ExpandAllDiffHunks,};use editor::{EditorStyle, RewrapOptions};+use feature_flags::{FeatureFlagAppExt as _, GitGraphFeatureFlag};use file_icons::FileIcons;use futures::StreamExt as _;use git::commit::ParsedCommitMessage;@@ -4519,7 +4520,7 @@ impl GitPanel {fn render_previous_commit(&self,- window: &mut Window,+ _window: &mut Window,cx: &mut Context<Self>,) -> Option<impl IntoElement> {let active_repository = self.active_repository.as_ref()?;@@ -4527,6 +4528,7 @@ impl GitPanel {let commit = branch.most_recent_commit.as_ref()?.clone();let workspace = self.workspace.clone();let this = cx.entity();+ let can_open_git_graph = cx.has_flag::<GitGraphFeatureFlag>();Some(h_flex()@@ -4604,7 +4606,7 @@ impl GitPanel {),)})- .when(window.is_action_available(&Open, cx), |this| {+ .when(can_open_git_graph, |this| {this.child(panel_icon_button("git-graph-button", IconName::GitGraph).icon_size(IconSize::Small)