Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git_ui: Refine display of the "Review Diff" button (#49710)

Danilo Lealb1366c38b32a
diff --git a/crates/git_ui/src/project_diff.rs b/crates/git_ui/src/project_diff.rs
index 0f55c47946d..e005c959274 100644
--- a/crates/git_ui/src/project_diff.rs
+++ b/crates/git_ui/src/project_diff.rs
@@ -1626,7 +1626,10 @@ impl Render for BranchDiffToolbar {
let focus_handle = project_diff.focus_handle(cx);
let review_count = project_diff.read(cx).total_review_comment_count();
- let show_review_button = AgentSettings::get_global(cx).enabled(cx);
+ let is_multibuffer_empty = project_diff.read(cx).multibuffer.read(cx).is_empty();
+ let is_ai_enabled = AgentSettings::get_global(cx).enabled(cx);
+
+ let show_review_button = !is_multibuffer_empty && is_ai_enabled;
h_group_xl()
.my_neg_1()