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
+5 -1
View File
@@ -58,7 +58,11 @@ impl AgentTool for CopyPathTool {
ToolKind::Move
}
fn initial_title(&self, input: Result<Self::Input, serde_json::Value>) -> ui::SharedString {
fn initial_title(
&self,
input: Result<Self::Input, serde_json::Value>,
_cx: &mut App,
) -> ui::SharedString {
if let Ok(input) = input {
let src = MarkdownInlineCode(&input.source_path);
let dest = MarkdownInlineCode(&input.destination_path);