Skip to content

Fix clicking a layer to select it multiple times, making its Properties panel disappear #2911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,12 @@ impl NodeGraphMessageHandler {
}
}

// The same layer/node may appear several times. Sort and dedup them for a stable ordering.
layers.sort();
layers.dedup();
nodes.sort();
nodes.dedup();

// Next, we decide what to display based on the number of layers and nodes selected
match *layers.as_slice() {
// If no layers are selected, show properties for all selected nodes
Expand Down
2 changes: 2 additions & 0 deletions editor/src/messages/portfolio/document/utility_types/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub struct LayerPanelEntry {
pub clippable: bool,
}

/// IMPORTANT: the same node may appear multiple times.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize, PartialEq, Eq, specta::Type)]
pub struct SelectedNodes(pub Vec<NodeId>);

Expand Down Expand Up @@ -129,6 +130,7 @@ impl SelectedNodes {
self.selected_layers(metadata).any(|selected| selected == layer)
}

/// IMPORTANT: the same node may appear multiple times.
pub fn selected_nodes(&self) -> impl Iterator<Item = &NodeId> + '_ {
self.0.iter()
}
Expand Down
Loading