Fixed bugs in workflow step preview (#16445)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2024-08-18 22:18:04 -07:00 committed by GitHub
parent 43e13df9f3
commit 86efde4b76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 109 additions and 42 deletions

View file

@ -373,6 +373,7 @@ pub trait ItemHandle: 'static + Send {
fn dragged_tab_content(&self, params: TabContentParams, cx: &WindowContext) -> AnyElement;
fn project_path(&self, cx: &AppContext) -> Option<ProjectPath>;
fn project_entry_ids(&self, cx: &AppContext) -> SmallVec<[ProjectEntryId; 3]>;
fn project_paths(&self, cx: &AppContext) -> SmallVec<[ProjectPath; 3]>;
fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[EntityId; 3]>;
fn for_each_project_item(
&self,
@ -531,6 +532,16 @@ impl<T: Item> ItemHandle for View<T> {
result
}
fn project_paths(&self, cx: &AppContext) -> SmallVec<[ProjectPath; 3]> {
let mut result = SmallVec::new();
self.read(cx).for_each_project_item(cx, &mut |_, item| {
if let Some(id) = item.project_path(cx) {
result.push(id);
}
});
result
}
fn project_item_model_ids(&self, cx: &AppContext) -> SmallVec<[EntityId; 3]> {
let mut result = SmallVec::new();
self.read(cx).for_each_project_item(cx, &mut |id, _| {