From 130470597b1e4b36fa583a2879125c808196c20d Mon Sep 17 00:00:00 2001 From: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com> Date: Tue, 26 May 2026 19:24:31 -0700 Subject: [PATCH] agent_ui: Show global skill paths in edits summary (#57767) Summary - Display the full path for global skill files in the agent edits summary when they do not have a project-relative file name. Closes AI-320 Validation - cargo check -p agent_ui --lib Release Notes: - Fixed global skill edits appearing without a file path in the agent changes summary. --- .../src/conversation_view/thread_view.rs | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/crates/agent_ui/src/conversation_view/thread_view.rs b/crates/agent_ui/src/conversation_view/thread_view.rs index 6bcdd9151a..c4416f06d7 100644 --- a/crates/agent_ui/src/conversation_view/thread_view.rs +++ b/crates/agent_ui/src/conversation_view/thread_view.rs @@ -645,6 +645,15 @@ enum ToolCallLayout { Embedded, } +fn full_path_for_empty_project_path(file: &dyn language::File, cx: &App) -> Option { + if file.path().file_name().is_some() { + return None; + } + + let full_path = file.full_path(cx).display().to_string(); + (!full_path.is_empty()).then_some(full_path) +} + impl ThreadView { pub(crate) fn new( root_thread_id: ThreadId, @@ -2703,6 +2712,9 @@ impl ThreadView { let path_style = file.path_style(cx); let separator = file.path_style(cx).primary_separator(); + let fallback_full_path = + full_path_for_empty_project_path(file.as_ref(), cx); + let file_path = path.parent().and_then(|parent| { if parent.is_empty() { None @@ -2719,14 +2731,25 @@ impl ThreadView { } }); - let file_name = path.file_name().map(|name| { - Label::new(name.to_string()) - .size(LabelSize::XSmall) - .buffer_font(cx) - .ml_1() - }); + let file_name = path + .file_name() + .map(|name| { + Label::new(name.to_string()) + .size(LabelSize::XSmall) + .buffer_font(cx) + .ml_1() + }) + .or_else(|| { + fallback_full_path.as_ref().map(|path| { + Label::new(path.clone()) + .size(LabelSize::XSmall) + .buffer_font(cx) + .ml_1() + }) + }); - let full_path = path.display(path_style).to_string(); + let full_path = fallback_full_path + .unwrap_or_else(|| path.display(path_style).to_string()); let file_icon = FileIcons::get_icon(path.as_std_path(), cx) .map(Icon::from_path)