Repository navigation
Conversation
Add a cross-parent reference and four same-parent reproducers for commands affecting nodes taken by another inserter. Co-Authored-By: Codex GPT-6 Astra <codex@openai.com>
|
Oof. That's a tricky one.
To make The behaviour is indeed inconsistent, but I think a user hitting this issue is actually quite unlikely, even aside from the steal-into-same-parent-sibling precondition. To run Also, note that there's one more issue with stealing elements from All of the above considered, I'm inclined to keep the inconsistent behaviour as-is for now. Long term, I think the solution may be to upgrade the overall inserters architecture so that each inserter remembers its parent inserter, and when it's stolen, does the handoff gracefully, informing its past parent so that it can remove it. But, that's a non-trivial change to the architecture – we need to mind performance, memory use and links, and also need to reconcile this idea with how raw elements keep track of their parents, including for subscription lifetime purposes. Another idea I considered for simplifying the tracking of nodes and their inserters is to write more data (e.g. links to current inserter and/or to current laminar element) into the raw JS DOM elements. This too could potentially simplify some code, including obviating the need for Either way, this re-architecture is definitely out of scope for v18. Let's keep this PR open, treating it as an issue. I suspect that we may see more such edge cases that need a similar solution – if such do pop up, maybe I'll create an actual issue to collect them. |
Adds reproducers for
children.command <--targeting a node that another inserter has taken.Current behavior:
RemoveandReplaceleave the stolen node untouched.Removedeletes the stolen node andReplacereplaces it in the destination’s region.Expected behavior:
Both commands should leave nodes outside their own region untouched, consistent with the existing cross-parent tests in
ChildrenCommandReceiverSpec.Tests only; no implementation changes. Against master, the cross-parent reference passes and four same-parent cases fail.
Run:
sbt 'testOnly *ChildrenCommandStolenNodeSpec'