From 468e092bffcfeba500c22b16d47452e17852a2e3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 20:45:05 +0000 Subject: [PATCH] #10113: layer ids are unique across documents; the test types in the first one's newest layer Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GbuSKAS2k5248LGFEapMUR --- crates/engine/src/cmd/type_cmds/tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/type_cmds/tests.rs b/crates/engine/src/cmd/type_cmds/tests.rs index 2f779df3c48..256a02e6635 100644 --- a/crates/engine/src/cmd/type_cmds/tests.rs +++ b/crates/engine/src/cmd/type_cmds/tests.rs @@ -862,15 +862,16 @@ fn typing_without_recording_keeps_the_journal_as_it_ran() { } /// CodeRabbit on #10730: typing in a type layer of another document, switched to as a tab is -/// (no step), after a recorded `type.create` is no part of that step, even with the same layer id. +/// (no step), after a recorded `type.create` is no part of that step, though that layer is the +/// newest of its own document. #[test] fn typing_in_another_document_is_not_folded_into_the_layer_made_in_the_first() { let mut s = session(); let other = s.execute("type.create", json!({"x": 10, "y": 40, "text": "Old", "size": 24})).unwrap()["layer"].as_u64().unwrap(); s.execute("file.new", json!({"width": 200, "height": 100, "background": "transparent"})).unwrap(); s.execute("actions.record", json!({"name": "Two"})).unwrap(); - let made = s.execute("type.create", json!({"x": 20, "y": 50, "text": "", "size": 24})).unwrap()["layer"].as_u64().unwrap(); - assert_eq!(made, other, "the setup gives both layers one id"); + s.execute("type.create", json!({"x": 20, "y": 50, "text": "", "size": 24})).unwrap(); + // Back in the first document, its own type layer is its newest layer. assert!(s.set_active(0)); type_in(&mut s, other, 3, "!", "s4"); s.execute("actions.stop", json!({})).unwrap();