workspace: Fix auto-reveal-in-project-panel for Images, Notebooks and.. Terminals? (#40128)

Piotr Osiewicz created

This regressed in #39199

Release Notes:

- Fixed image files not getting auto-revealed in project panel.

Change summary

crates/image_viewer/src/image_viewer.rs   | 3 +++
crates/repl/src/notebook/notebook_ui.rs   | 4 ++++
crates/terminal_view/src/terminal_view.rs | 4 ++++
3 files changed, 11 insertions(+)

Detailed changes

crates/image_viewer/src/image_viewer.rs 🔗

@@ -188,6 +188,9 @@ impl Item for ImageView {
     fn has_deleted_file(&self, cx: &App) -> bool {
         self.image_item.read(cx).file.disk_state() == DiskState::Deleted
     }
+    fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+        workspace::item::ItemBufferKind::Singleton
+    }
 }
 
 fn breadcrumbs_text_for_image(project: &Project, image: &ImageItem, cx: &App) -> String {

crates/repl/src/notebook/notebook_ui.rs 🔗

@@ -716,6 +716,10 @@ impl Item for NotebookEditor {
         Some(cx.new(|cx| Self::new(self.project.clone(), self.notebook_item.clone(), window, cx)))
     }
 
+    fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+        workspace::item::ItemBufferKind::Singleton
+    }
+
     fn for_each_project_item(
         &self,
         cx: &App,

crates/terminal_view/src/terminal_view.rs 🔗

@@ -1211,6 +1211,10 @@ impl Item for TerminalView {
         None
     }
 
+    fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+        workspace::item::ItemBufferKind::Singleton
+    }
+
     fn clone_on_split(
         &self,
         workspace_id: Option<WorkspaceId>,