From 7c6f7118e4d3aa91a5be47066aa529c910725335 Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:41:17 -0500 Subject: [PATCH] git_graph: Add feature graph (#47861) We need another work of polish before end users are able to use the git graph. Release Notes: - N/A --- Cargo.lock | 1 + crates/git_graph/Cargo.toml | 1 + crates/git_graph/src/git_graph.rs | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index fdc2a0c224167de908eedf4921d898169a365df4..0ad2709c786c00d86ac568b8d0d31b9c4fe10af5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7196,6 +7196,7 @@ dependencies = [ "anyhow", "collections", "db", + "feature_flags", "fs", "git", "git_ui", diff --git a/crates/git_graph/Cargo.toml b/crates/git_graph/Cargo.toml index f3fb46ffe477b4c46b0a4f3f2173b3c06f8bb4ae..b3bcbc4c726973dd4b212b630a043fca7ecb9912 100644 --- a/crates/git_graph/Cargo.toml +++ b/crates/git_graph/Cargo.toml @@ -22,6 +22,7 @@ test-support = [ anyhow.workspace = true collections.workspace = true db.workspace = true +feature_flags.workspace = true git.workspace = true git_ui.workspace = true gpui.workspace = true diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs index ec5065e5c2a953341d212df610ea3bced6691d89..8ca21071814d7406c5c7e45301fa078d0eb30b6a 100644 --- a/crates/git_graph/src/git_graph.rs +++ b/crates/git_graph/src/git_graph.rs @@ -1,4 +1,5 @@ use collections::{BTreeMap, HashMap}; +use feature_flags::{FeatureFlag, FeatureFlagAppExt as _}; use git::{ BuildCommitPermalinkParams, GitHostingProviderRegistry, GitRemote, Oid, ParsedGitRemote, parse_git_remote_url, @@ -29,6 +30,12 @@ use workspace::{ item::{Item, ItemEvent, SerializableItem}, }; +pub struct GitGraphFeatureFlag; + +impl FeatureFlag for GitGraphFeatureFlag { + const NAME: &'static str = "git-graph"; +} + const COMMIT_CIRCLE_RADIUS: Pixels = px(4.5); const COMMIT_CIRCLE_STROKE_WIDTH: Pixels = px(1.5); const LANE_WIDTH: Pixels = px(16.0); @@ -496,7 +503,8 @@ pub fn init(cx: &mut App) { cx.observe_new(|workspace: &mut workspace::Workspace, _, _| { workspace.register_action_renderer(|div, workspace, _, cx| { div.when( - workspace.project().read(cx).active_repository(cx).is_some(), + workspace.project().read(cx).active_repository(cx).is_some() + && cx.has_flag::(), |div| { let workspace = workspace.weak_handle();