agent: Make read_file and edit_file tool call titles more specific (#37639)

For read_file and edit_file, show the worktree-relative path if there's
only one visible worktree, and the "full path" otherwise. Also restores
the display of line numbers for read_file calls.

Release Notes:

- N/A
This commit is contained in:
Cole Miller
2025-09-08 12:57:22 -04:00
committed by GitHub
parent a66cd820b3
commit 5f01f6d75f
22 changed files with 393 additions and 173 deletions
+12 -4
View File
@@ -69,6 +69,7 @@ pub struct MarkdownStyle {
pub heading_level_styles: Option<HeadingLevelStyles>,
pub table_overflow_x_scroll: bool,
pub height_is_multiple_of_line_height: bool,
pub prevent_mouse_interaction: bool,
}
impl Default for MarkdownStyle {
@@ -89,6 +90,7 @@ impl Default for MarkdownStyle {
heading_level_styles: None,
table_overflow_x_scroll: false,
height_is_multiple_of_line_height: false,
prevent_mouse_interaction: false,
}
}
}
@@ -575,16 +577,22 @@ impl MarkdownElement {
window: &mut Window,
cx: &mut App,
) {
if self.style.prevent_mouse_interaction {
return;
}
let is_hovering_link = hitbox.is_hovered(window)
&& !self.markdown.read(cx).selection.pending
&& rendered_text
.link_for_position(window.mouse_position())
.is_some();
if is_hovering_link {
window.set_cursor_style(CursorStyle::PointingHand, hitbox);
} else {
window.set_cursor_style(CursorStyle::IBeam, hitbox);
if !self.style.prevent_mouse_interaction {
if is_hovering_link {
window.set_cursor_style(CursorStyle::PointingHand, hitbox);
} else {
window.set_cursor_style(CursorStyle::IBeam, hitbox);
}
}
let on_open_url = self.on_url_click.take();