acdream/tests/AcDream.App.Tests/UI/Layout/TooltipSkinLiveDatTests.cs
Erik d087b50aa3
All checks were successful
CI / linux-portable (push) Successful in 3m29s
CI / windows-gate (push) Successful in 6m14s
CI / release (push) Successful in 2m10s
fix(ui): tooltip wrap bound comes from the popup text child's authored P0x3D, and tooltip text left-aligns
Owner screenshots vs retail at the CA5 re-check caught both:

Wrap width: the popup skins' shared TEXT CHILD (0x10000396) authors
P0x3D=256 on all four skins — live-DAT probed, now pinned by an
installed-DAT test. Retail's InqSizewMargins UITS_MAX_WIDTH reads the
text element's 0x3D BEFORE the display-width fallback, so retail wraps
tooltip text at 256px; our measure pass used the display width because
TS-85's 'zero elements author P0x3D' sweep had only covered hover
TARGETS, never the popup skins. ApplyTooltipText now measures and
re-wraps at the text child's authored bound, falling back to the display
width only when none is authored.

Alignment: tooltip text rendered centered where retail hugs the left
edge. The skin authors no justification; retail's unauthored default is
Left, our importer's ElementInfo default is Center — the same
wrong-default class as #410's VJustify finding, now recorded there as the
horizontal sibling. Point-fixed in the presenter exactly as the chat
transcript already does; the client-wide default flip stays #410's scope.

The two-pass sizing test now models the real skin (max width on the text
child) and asserts left alignment. Full hermetic suite 15,332 passed / 0
failed; the new live-DAT pin passes against the installed DATs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 18:29:03 +02:00

45 lines
1.6 KiB
C#

using AcDream.App.UI.Layout;
using DatReaderWriter;
namespace AcDream.App.Tests.UI.Layout;
/// <summary>
/// CA5 re-check pin (2026-08-24): the popup skins' shared TEXT CHILD
/// (0x10000396) authors <c>P0x3D=256</c> — the wrap width retail's
/// <c>InqSizewMargins UITS_MAX_WIDTH</c> reads BEFORE its display-width
/// fallback. TS-85's earlier "zero elements author P0x3D" sweep covered
/// hover TARGETS only, never the popup skins; this pin closes that gap so
/// a DAT revision (or importer regression) that loses the bound fails
/// loudly instead of silently un-wrapping every tooltip.
/// </summary>
[Trait("Lane", "InstalledDat")]
public sealed class TooltipSkinLiveDatTests
{
private static string DatDirectory =>
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Documents", "Asheron's Call");
[InstalledDatFact]
public void EveryPopupSkinTextChildAuthorsTheRetailWrapBound()
{
using var dats = new DatCollection(
DatDirectory, DatReaderWriter.Options.DatAccessType.Read);
ElementInfo? tree = LayoutImporter.ImportInfos(dats, 0x21000041u);
Assert.NotNull(tree);
int textChildren = 0;
void Walk(ElementInfo e)
{
if (e.Id == 0x10000396u && e.Type == 12)
{
textChildren++;
Assert.Equal(256, e.MaxWidth);
}
foreach (var c in e.Children) Walk(c);
}
Walk(tree!);
Assert.True(textChildren >= 4,
$"expected the text child under all four popup skins, found {textChildren}");
}
}