From 0a4269ffa27927861d31d013965f98f77ddbae17 Mon Sep 17 00:00:00 2001 From: Xiaobo Liu Date: Wed, 25 Mar 2026 14:23:42 +0800 Subject: [PATCH] git_ui: Fix Git Graph button flicker in Git panel (#52285) Release Notes: - Fixed Git Graph button flicker in Git panel --- crates/git_ui/src/git_panel.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index d640a3cd15cfc8368e72dd163687dd00fddd6b4d..6c6b4de1e9a4ac6e7a7f6028d49c2f7b86c4f6b3 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, ) -> Option { 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::(); 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)