fix(ui): OP2 rework — dormant UiDatElement subclasses, fixed Panel/CheckboxBitfield64 mechanism

OP2 (df9c7a35) was double-REJECTed: an unconditional Type-8/Type-5 factory
mapping silently re-classed 15 elements across 7 shipped panels (vendor
backdrop lost its fill, character/spellbook roots stopped passing clicks
through, combat gained a phantom import-time tab takeover, ten ListBoxes
gained a spurious hit-testable viewport) because the stale 27 pre-existing
fixtures never exercised the new fields — and the mechanism itself cited a
nonexistent "UIElement_TabControl" class, inverted UiCheckboxBitfield64's
checked-state predicate, and synthesized fake per-row geometry instead of
using the widget's own authored template.

Shape change: UiTabPanel (renamed from UiTabControl) and UiTemplateListBox
now derive from UiDatElement (unsealed) and stay DORMANT by default — an
imported Type-8/Type-5 element gets authored-media drawing, ClickThrough
generic-decoration default, and IUiDatStateful propagation identical to the
pre-OP2 UiDatElement fallback, with zero import-time side effects. The
factory's Type-8/Type-5 arms are unconditional again (no more guard whose
premise the blast-radius sweep proved false), because dormancy makes an
unactivated instance behaviorally indistinguishable from the old fallback.
UiTabPanel.ActivateTabBehavior() and UiTemplateListBox's lazy viewport
creation are the explicit, controller-driven opt-ins Campaign OP slice OP3+
will call; today nothing does, so the four pre-existing shipped Type-8
hosts (character/spellbook/vendor/combat) and ten pre-existing Type-5
ListBoxes keep their pre-OP2 behavior exactly. Filed AD-73 for this
dormant-vs-retail's-unconditional-activation adaptation.

Mechanism fixes (docs/research/2026-08-11-op2-review-mechanism.md):
- UiTabPanel cites UIElement_Panel (Type 8 is UIElement_Panel; no
  UIElement_TabControl exists in the PDB), resolves buttons/pages via a
  GetChildRecursive-equivalent descendant search (not direct-children-only),
  performs no switch when no entry authors 0x32 (deleted the _tabs[0]
  fallback), and surfaces unresolved tab-table entries via UnresolvedEntries
  + a diagnostic line instead of a silent no-op.
- ElementReader.ReadTabTable skips entries missing 0x30/0x31, matching
  retail's SetupTabPageHash @0x0046C2E0 entry filter.
- UiCheckboxBitfield64 now builds every row from its OWN authored template
  (property 0x64 -> {0x2100002B, 0x10000521}) via AddItemFromTemplateList,
  deleting the synthesized ElementInfo + invented RowHeight=14 — matching
  retail's CreateChildren @0x00485DF0, which is itself a UIElement_ListBox
  call. IsSet is now retail's ANY-bit-set predicate (Refresh @0x004859C0),
  not all-bits-set. TS-72 retired: the click-toggle bit math is now fully
  decomp-confirmed (SetBitsOnOrOff via ListenToElementMessage @0x00485AE0).

Regenerated all 32 UI fixtures against real DAT (ACDREAM_REGENERATE_UI_FIXTURES=1)
and committed them — 27 pre-existing fixtures now carry Outline/OutlineColor/
TabTable/TemplateList/ScrollbarElementId; the 5 Options fixtures were already
current. Updated EffectsUiControllerTests' now-correct UiTemplateListBox
class-identity assertion. Added: 6 built-widget behavior pins for all five
pre-existing Type-8 elements + a representative Type-5 element the dormancy
model protects (OP2ReworkBlastRadiusConformanceTests.cs); 5 reader-level
tests driving ReadTabTable/ReadTemplateList/the 0x72 reader from raw
property bags (ElementReaderTests.cs); a multi-bit-mask UiCheckboxBitfield64
test proving the any-bit predicate (the prior single-bit test couldn't
distinguish it from all-bits); an activation-idempotency test and a
before-activation click-is-inert test for UiTabPanel.

Full Release suite: 12,868 passed / 4 skipped / 0 failed (baseline 12,853/4/0
post-OP1-fixes; +15 net new tests, zero regressions).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-11 01:06:31 +02:00
parent 8a05fda445
commit b236a44279
40 changed files with 6249 additions and 1145 deletions

View file

@ -149,6 +149,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {},
"StateCursors": {},
"DefaultStateName": "",
@ -278,6 +280,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687323,
@ -324,6 +328,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687166,
@ -332,7 +338,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268435978,
@ -371,6 +380,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687166,
@ -379,7 +390,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268435979,
@ -418,6 +432,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687165,
@ -426,7 +442,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436145,
@ -465,6 +484,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687161,
@ -473,7 +494,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436146,
@ -512,6 +536,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687162,
@ -520,7 +546,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436147,
@ -559,6 +588,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687163,
@ -567,7 +598,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436148,
@ -606,6 +640,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687164,
@ -614,7 +650,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436149,
@ -653,6 +692,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"": {
"Item1": 100687165,
@ -661,7 +702,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436271,
@ -697,6 +741,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {},
"StateCursors": {},
"DefaultStateName": "",
@ -1223,6 +1269,8 @@
"Z": 1,
"W": 1
},
"Outline": false,
"OutlineColor": null,
"StateMedia": {},
"StateCursors": {},
"DefaultStateName": "Normal",
@ -1317,6 +1365,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682902,
@ -1337,7 +1387,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436175,
@ -1429,6 +1482,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682905,
@ -1449,7 +1504,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436176,
@ -1541,6 +1599,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682908,
@ -1561,9 +1621,15 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}
]
],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 25,
@ -2087,6 +2153,8 @@
"Z": 1,
"W": 1
},
"Outline": false,
"OutlineColor": null,
"StateMedia": {},
"StateCursors": {},
"DefaultStateName": "Normal",
@ -2181,6 +2249,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682902,
@ -2201,7 +2271,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436175,
@ -2293,6 +2366,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682905,
@ -2313,7 +2388,10 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 268436176,
@ -2405,6 +2483,8 @@
"HJustify": 1,
"VJustify": 1,
"FontColor": null,
"Outline": false,
"OutlineColor": null,
"StateMedia": {
"Normal": {
"Item1": 100682908,
@ -2425,11 +2505,20 @@
},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}
]
],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}
]
],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
},
{
"Id": 62,
@ -3307,12 +3396,28 @@
"Z": 0.8,
"W": 1
},
"Outline": true,
"OutlineColor": {
"X": 0.06666667,
"Y": 0.05882353,
"Z": 0.02745098,
"W": 1
},
"StateMedia": {},
"StateCursors": {},
"DefaultStateName": "",
"Children": []
"Children": [],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}
]
],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}
]
],
"TabTable": [],
"TemplateList": [],
"ScrollbarElementId": 0
}