From 01e8df43d218fa1f55ba6ba6b28d824f54bd8892 Mon Sep 17 00:00:00 2001 From: Om Chillure Date: Tue, 10 Mar 2026 18:20:51 +0530 Subject: [PATCH] agent_ui: Fix button to copy the command from terminal calls not appearing (#51191) Fixes #51048 The "Copy Command" button uses `.visible_on_hover(group)` from GPUI to only appear when the user hovers over its parent container. In `render_collapsible_command` (used to render the code blocks for terminal tool calls like "Run Command"), the parent `v_flex()` container was missing the `.group()` assignment. This caused the copy button to never become visible, which became apparent when an agent session was restored from history. This commit adds `.group(group.clone())` to the root `v_flex()` container in `render_collapsible_command` to restore the hover visibility for the "Copy Command" button. Video : [Screencast from 2026-03-10 18-06-57.webm](https://github.com/user-attachments/assets/ae931ac3-c7f1-4044-a3d8-a91a93d9c3bb) [Screencast from 2026-03-10 18-06-01.webm](https://github.com/user-attachments/assets/5ddb8085-bafe-4e9a-bb02-74e3d860ae1a) Release Notes: - Agent: Fixed an issue where the "Copy Command" button would not appear on hover for terminal tool calls. --- crates/agent_ui/src/connection_view/thread_view.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/agent_ui/src/connection_view/thread_view.rs b/crates/agent_ui/src/connection_view/thread_view.rs index 0519362ab1194a6e21ff9b3f213112f94f4cce55..f5fc681a82b636ec401f3a8c6168bcb368931930 100644 --- a/crates/agent_ui/src/connection_view/thread_view.rs +++ b/crates/agent_ui/src/connection_view/thread_view.rs @@ -4870,6 +4870,7 @@ impl ThreadView { cx: &Context, ) -> Div { v_flex() + .group(group.clone()) .p_1p5() .bg(self.tool_card_header_bg(cx)) .when(is_preview, |this| {