fix(blocks): block previews leave out members of other visibility states (#1819)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-16 00:11:56 +03:00
1 parent 98cce048c7
commit c8f67ad35b
1 file changed
+5 -2
+5 -2
View File
@@ -431,7 +431,8 @@ impl Scene {
/// Tessellate one block definition's entities into block-local wire models
/// (insertion base at origin) for the block-palette thumbnail. Nested INSERTs
/// expand through the block cache. Unknown / empty block → `vec![]`.
/// expand through the block cache; invisible members (another visibility
/// state) are left out, as on the canvas. Unknown / empty block → `vec![]`.
pub(crate) fn block_preview_wires(&self, name: &str) -> Vec<WireModel> {
use codec::EntityType;
let Some(br) = self.document.block_records.get(name) else {
@@ -442,7 +443,9 @@ impl Scene {
let Some(e) = self.document.get_entity(eh) else {
continue;
};
if matches!(e, EntityType::Block(_) | EntityType::BlockEnd(_)) {
if matches!(e, EntityType::Block(_) | EntityType::BlockEnd(_))
|| e.common().invisible
{
continue;
}
out.extend(self.tessellate_one(e));