3589578: Fix delta not set correctly for nested layouts

insertIntoRegion() unconditionally spliced newly inserted components at index 0 of the entire paragraphs reference field instead of positioning them relative to their parent section. Since a paragraph's delta is just its index in that flat field, this gave every "add into an empty region" insertion delta 0, wrong for any region except the very first at the root level, and broken by definition for anything nested.

Insert the new component immediately after the last existing child in the target region, or after the parent component if the region is still empty, mirroring how insertSiblingComponent() already positions before/after inserts.

Add a kernel test that reproduces the reported symptom (inserting into a nested layout's region) and asserts the correct delta.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Closes #3589578

Merge request reports

Loading
Loading