agent: Make directory context display update on rename (#29189)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-21 19:44:31 -06:00 committed by GitHub
parent c15382c4d8
commit 2e8ee9b64f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 74 additions and 31 deletions

View file

@ -3282,12 +3282,10 @@ pub(crate) fn open_context(
}
}
AssistantContext::Directory(directory_context) => {
let project_path = directory_context.project_path(cx);
let entry_id = directory_context.entry_id;
workspace.update(cx, |workspace, cx| {
workspace.project().update(cx, |project, cx| {
if let Some(entry) = project.entry_for_path(&project_path, cx) {
cx.emit(project::Event::RevealInProjectPanel(entry.id));
}
workspace.project().update(cx, |_project, cx| {
cx.emit(project::Event::RevealInProjectPanel(entry_id));
})
})
}