Resolve removal menu import and share visibility admission

This commit is contained in:
2026-09-24 18:39:58 -07:00
parent ed6eaaa73e
commit 81db58c8b3
+11 -6
View File
@@ -3,6 +3,7 @@ use super::*;
use crate::behavior::scenario::{self, group_removal, selection};
use crate::diagram_selection::Snapshot;
use crate::diagram_usage::Target;
use crate::model_menu;
#[cfg(test)]
mod tests;
@@ -50,15 +51,19 @@ impl App {
}
fn scenario_removal_matches(&self, context: scenario::Context, snapshot: &Snapshot) -> bool {
self.scenario_context() == Some(context)
&& self
if self.scenario_context() != Some(context)
|| !self
.diagram_selection
.as_ref()
.is_some_and(|selected| selected.matches(snapshot, selection::context(context)))
&& snapshot
.targets()
.iter()
.all(|target| self.multiselect_target_visible(target))
{
return false;
}
let visible = selection::visible(self.project(), context, self.selected);
snapshot
.targets()
.iter()
.all(|target| visible.contains(target))
}
pub(super) fn scenario_removal_event(&mut self, event: Event) -> Task<Message> {