feat(ui): D.2b-B — sub-window mount (inheritor attaches base subtree)

LayoutImporter.Resolve now captures the resolved base element's children
and, for a pure-container leaf (no own children + no own media) inheriting
from a base WITH content, attaches that subtree. This pulls the nested
gmInventoryUI panels' content (paperdoll/backpack/3D-items) in through the
existing BaseElement+BaseLayoutId path. ShouldMountBaseChildren is a pure,
unit-tested predicate; it's inert for media-bearing inheritors and childless
style prototypes, so vitals/chat/toolbar are unaffected (existing importer
tests still green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-20 22:36:20 +02:00
parent 4fd4b09f3f
commit 85098f535d
2 changed files with 42 additions and 2 deletions

View file

@ -0,0 +1,22 @@
using AcDream.App.UI.Layout;
namespace AcDream.App.Tests.UI;
public class LayoutImporterMountTests
{
[Fact]
public void Mounts_ChildlessMediaLessInheritor_WithContentfulBase()
=> Assert.True(LayoutImporter.ShouldMountBaseChildren(derivedChildCount: 0, derivedMediaCount: 0, baseChildCount: 5));
[Fact]
public void DoesNotMount_WhenDerivedHasOwnMedia() // close button / title
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(0, 1, 5));
[Fact]
public void DoesNotMount_WhenDerivedHasOwnChildren()
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(2, 0, 5));
[Fact]
public void DoesNotMount_WhenBaseIsChildless() // vitals/chat/toolbar style prototypes
=> Assert.False(LayoutImporter.ShouldMountBaseChildren(0, 0, 0));
}