From b41ffae1610fb531432a5b95b9a451e02b127f0a Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Mon, 28 Apr 2025 12:00:53 -0600 Subject: [PATCH] Method renaming intended to be included in #29551 (#29553) `text_hover_view` --> `ContextPillHover::new_text` Release Notes: - N/A --- crates/agent/src/ui/context_pill.rs | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/agent/src/ui/context_pill.rs b/crates/agent/src/ui/context_pill.rs index d7483cb2c672fe9108bc8abe7d699cd3039cfb88..e0be906c7f0a7b78244bfa7950e93a70efcb0fde 100644 --- a/crates/agent/src/ui/context_pill.rs +++ b/crates/agent/src/ui/context_pill.rs @@ -491,7 +491,7 @@ impl AddedContext { let thread = handle.thread.clone(); Some(Rc::new(move |_, cx| { let text = thread.read(cx).latest_detailed_summary_or_text(); - text_hover_view(text.clone(), cx).into() + ContextPillHover::new_text(text.clone(), cx).into() })) }, handle: AgentContextHandle::Thread(handle), @@ -509,7 +509,7 @@ impl AddedContext { render_hover: { let text = context.text.clone(); Some(Rc::new(move |_, cx| { - text_hover_view(text.clone(), cx).into() + ContextPillHover::new_text(text.clone(), cx).into() })) }, handle: AgentContextHandle::Thread(context.handle.clone()), @@ -554,7 +554,7 @@ impl AddedContext { render_hover: { let text = context.text.clone(); Some(Rc::new(move |_, cx| { - text_hover_view(text.clone(), cx).into() + ContextPillHover::new_text(text.clone(), cx).into() })) }, handle: AgentContextHandle::Rules(context.handle.clone()), @@ -670,18 +670,6 @@ impl ContextFileExcerpt { } } -fn text_hover_view(content: SharedString, cx: &mut App) -> Entity { - ContextPillHover::new(cx, move |_, _| { - div() - .id("context-pill-hover-contents") - .overflow_scroll() - .max_w_128() - .max_h_96() - .child(content.clone()) - .into_any_element() - }) -} - struct ContextPillHover { render_hover: Box AnyElement>, } @@ -695,6 +683,18 @@ impl ContextPillHover { render_hover: Box::new(render_hover), }) } + + fn new_text(content: SharedString, cx: &mut App) -> Entity { + Self::new(cx, move |_, _| { + div() + .id("context-pill-hover-contents") + .overflow_scroll() + .max_w_128() + .max_h_96() + .child(content.clone()) + .into_any_element() + }) + } } impl Render for ContextPillHover {