From da0f70bb5f88bb93223d1669a52394d9e91662d2 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sat, 22 Aug 2026 11:48:27 +0000 Subject: [PATCH] Stage the flip's document reset markers --- editor/src/messages/portfolio/document_migration.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editor/src/messages/portfolio/document_migration.rs b/editor/src/messages/portfolio/document_migration.rs index 4bad328df5..28966d2900 100644 --- a/editor/src/messages/portfolio/document_migration.rs +++ b/editor/src/messages/portfolio/document_migration.rs @@ -1024,6 +1024,13 @@ fn replace_optional_f64_null(input: &str) -> String { result } +/// Serialized proto identifiers of the Merge and Artboard layer internals that the +/// leveled-records flip retires. When the flip lands, `document_migration_reset_node_definition` +/// starts matching these, so every pre-flip document rebuilds its layer definitions through the +/// same reset mechanism as the `SourceNodeIdNode` entry there. A test pins each marker to the +/// live identifier so a pre-flip rename cannot silently invalidate the staged strings. +pub const FLIP_RESET_NODE_MARKERS: &[&str] = &["graphic_nodes::graphic::WriteAttributeNode"]; + pub fn document_migration_reset_node_definition(document_serialized_content: &str) -> bool { // Upgrade a document being opened to use fresh copies of all nodes if document_serialized_content.contains("node_output_index") { @@ -2572,6 +2579,11 @@ fn migrate_removed_catalog_definitions(node_id: &NodeId, node: &DocumentNode, ne mod tests { use super::*; + #[test] + fn the_flip_reset_markers_track_the_live_merge_internals() { + assert_eq!(FLIP_RESET_NODE_MARKERS, &[graphene_std::graphic::write_attribute::IDENTIFIER.as_str()]); + } + #[test] fn test_no_duplicate_node_replacements() { let mut hashmap = HashMap::::new();