From 3e7f2e3f9a576c4704c2f71497f6ba3516d9339b Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:23:09 -0300 Subject: [PATCH] agent_ui: Add branch diff menu item to context menu (#51487) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds the recently introduced "branch diff" mention option to the "Add Context" menu in the message editor: Screenshot 2026-03-13 at 9  58@2x Release Notes: - N/A --- .../agent_ui/src/connection_view/thread_view.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/agent_ui/src/connection_view/thread_view.rs b/crates/agent_ui/src/connection_view/thread_view.rs index 030f6c5431eb79258be60f9d0139b8757611aa71..f50f5eee302bca163954d5ae0ff06345d0caa5b0 100644 --- a/crates/agent_ui/src/connection_view/thread_view.rs +++ b/crates/agent_ui/src/connection_view/thread_view.rs @@ -3557,6 +3557,7 @@ impl ThreadView { let message_editor = self.message_editor.clone(); let workspace = self.workspace.clone(); let supports_images = self.prompt_capabilities.borrow().image; + let supports_embedded_context = self.prompt_capabilities.borrow().embedded_context; let has_editor_selection = workspace .upgrade() @@ -3672,6 +3673,21 @@ impl ThreadView { } }), ) + .item( + ContextMenuEntry::new("Branch Diff") + .icon(IconName::GitBranch) + .icon_color(Color::Muted) + .icon_size(IconSize::XSmall) + .disabled(!supports_embedded_context) + .handler({ + move |window, cx| { + message_editor.focus_handle(cx).focus(window, cx); + message_editor.update(cx, |editor, cx| { + editor.insert_context_type("diff", window, cx); + }); + } + }), + ) }) }