Method renaming intended to be included in #29551 (#29553)

Michael Sloan created

`text_hover_view` --> `ContextPillHover::new_text`

Release Notes:

- N/A

Change summary

crates/agent/src/ui/context_pill.rs | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)

Detailed changes

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> {
-    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<dyn Fn(&mut Window, &mut App) -> AnyElement>,
 }
@@ -695,6 +683,18 @@ impl ContextPillHover {
             render_hover: Box::new(render_hover),
         })
     }
+
+    fn new_text(content: SharedString, cx: &mut App) -> Entity<Self> {
+        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 {