acdream/tests/AcDream.App.Tests/UI/Layout
Erik 38855e7a7b feat(D.2b): DatWidgetFactory — Type→widget hybrid + meter slice extraction
Hybrid factory mapping ElementInfo.Type to a behavioral widget or the
UiDatElement generic fallback.  Type 7 (UIElement_Meter) → UiMeter with
back/front 3-slice ids populated from grandchild image elements; Type 12
(style prototypes / BaseElement stores) → null so the importer skips
them; all other types → UiDatElement.  Rect + anchors are set on every
returned widget via ElementReader.ToAnchors.

BuildMeter walks two levels of the element tree: the two Type-3 slice
containers ordered by ReadOrder (back behind, front on top), then within
each container the image children that carry a DirectState ("" key)
ordered by X for left-cap/center-tile/right-cap.  The expand-detail
overlay (present in the front container with only named ShowDetail/
HideDetail states and no "" entry) is excluded by the TryGetValue("")
filter automatically — no name-matching needed.

Fill/Label providers are intentionally NOT set here; Task 6
(VitalsController) binds them to live stat data.

5 TDD tests: Type7→UiMeter, UnknownType→UiDatElement, Type12→null,
rect+anchors propagation, and meter slice extraction with overlay exclusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 13:39:31 +02:00
..
DatWidgetFactoryTests.cs feat(D.2b): DatWidgetFactory — Type→widget hybrid + meter slice extraction 2026-06-15 13:39:31 +02:00
ElementReaderTests.cs refactor(D.2b): ElementReader review fixes — defensive Children copy + sentinel doc 2026-06-15 13:25:44 +02:00
UiDatElementTests.cs test(D.2b): UiDatElement — cover DrawMode passthrough + media fallbacks 2026-06-15 13:34:50 +02:00