diff --git a/crates/acp/src/acp.rs b/crates/acp/src/acp.rs index 8804d0cfe2515988ae0f508d5bbce55d48869064..ac9c1954bbf9c5811fb6896d36efef2a8a3a233f 100644 --- a/crates/acp/src/acp.rs +++ b/crates/acp/src/acp.rs @@ -137,6 +137,12 @@ pub enum ToolCall { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct ToolCallId(ThreadEntryId); +impl ToolCallId { + pub fn as_u64(&self) -> u64 { + self.0.0 + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct ThreadEntryId(pub u64); diff --git a/crates/acp/src/server.rs b/crates/acp/src/server.rs index 6bb198b87aa3ce3ff826d329724e8cf989e9e9b4..b485e6a3463b93d068124164358c8968c82c7afe 100644 --- a/crates/acp/src/server.rs +++ b/crates/acp/src/server.rs @@ -284,6 +284,6 @@ impl From for ToolCallId { impl From for acp::ToolCallId { fn from(tool_call_id: ToolCallId) -> Self { - acp::ToolCallId(tool_call_id.0.0) + acp::ToolCallId(tool_call_id.as_u64()) } } diff --git a/crates/acp/src/thread_view.rs b/crates/acp/src/thread_view.rs index e07b2bbc7ae5db99e8805dfa4ef722015ac60598..32aa14e45effe1089f61733d8f3397377d36f8df 100644 --- a/crates/acp/src/thread_view.rs +++ b/crates/acp/src/thread_view.rs @@ -223,20 +223,24 @@ impl AcpThreadView { match message.role { Role::User => div() - .text_xs() - .m_1() .p_2() - .bg(cx.theme().colors().editor_background) - .rounded_lg() - .shadow_md() - .border_1() - .border_color(cx.theme().colors().border) - .child(message_body) + .pt_4() + .child( + div() + .text_xs() + .p_2() + .bg(cx.theme().colors().editor_background) + .rounded_lg() + .shadow_md() + .border_1() + .border_color(cx.theme().colors().border) + .child(message_body), + ) .into_any(), Role::Assistant => div() .text_ui(cx) - .px_2() - .py_4() + .p_4() + .pt_2() .child(message_body) .into_any(), } @@ -261,14 +265,14 @@ impl AcpThreadView { )) .child( h_flex() - .child(Button::new(("allow", id.0.0), "Allow").on_click( + .child(Button::new(("allow", id.as_u64()), "Allow").on_click( cx.listener({ move |this, _, _, cx| { this.authorize_tool_call(id, true, cx); } }), )) - .child(Button::new(("reject", id.0.0), "Reject").on_click( + .child(Button::new(("reject", id.as_u64()), "Reject").on_click( cx.listener({ move |this, _, _, cx| { this.authorize_tool_call(id, false, cx); @@ -307,12 +311,10 @@ impl Render for AcpThreadView { ThreadState::LoadError(e) => div() .p_2() .child(Label::new(format!("Failed to load {e}")).into_any_element()), - ThreadState::Ready { .. } => div() - .child( - list(self.list_state.clone()) - .with_sizing_behavior(gpui::ListSizingBehavior::Infer), - ) - .p_2(), + ThreadState::Ready { .. } => div().h_full().child( + list(self.list_state.clone()) + .with_sizing_behavior(gpui::ListSizingBehavior::Infer), + ), }) .when(self.send_task.is_some(), |this| { this.child(