Refactor node migration to be less susceptible to forgetting outdated strings (#2853)
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled

* migration: make document migration use ProtoNodeIdentifier

* migration: NodeReplacement struct for better formatting

* migration: test for duplicates and fix them
This commit is contained in:
Firestar99 2025-07-11 02:40:54 +02:00 committed by GitHub
parent 912e6f61a9
commit 4c75ddf936
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 459 additions and 148 deletions

View file

@ -490,7 +490,7 @@ async fn to_artboard<Data: Into<GraphicGroupTable> + 'n>(
}
#[node_macro::node(category(""))]
async fn append_artboard(_ctx: impl Ctx, mut artboards: ArtboardGroupTable, artboard: Artboard, node_path: Vec<NodeId>) -> ArtboardGroupTable {
pub async fn append_artboard(_ctx: impl Ctx, mut artboards: ArtboardGroupTable, artboard: Artboard, node_path: Vec<NodeId>) -> ArtboardGroupTable {
// Get the penultimate element of the node path, or None if the path is too short.
// This is used to get the ID of the user-facing "Artboard" node (which encapsulates this internal "Append Artboard" node).
let encapsulating_node_id = node_path.get(node_path.len().wrapping_sub(2)).copied();