fix(ui): talk button keeps authored 46x17; white authored captions + font for talk/Send

Owner report (2026-08-24, post gate-pass): the chat channel button was
bigger than retail and both its caption and the Send caption were warm
gold instead of retail's near-white.

Size: retail never resizes the talk button — HandleSelection
@0x004cd540 only swaps the caption string; the authored 46x17 element
stands, and the authored SHORT captions ('Gen', 'Fell', ...) fit it —
that is why retail abbreviates. Our content-widening reflow (grow the
button to its label, shift the input) was a compensation for the
now-retired invented long captions, measured with the wrong font on
top. Deleted; the authored row layout stands.

Color + font: the button caption child (0x10000015) and the Send
button (0x10000019) both author pure white text with their OWN FontDid
0x40000002 (live-DAT probed) — different from the transcript font,
which is the other half of why 'Chat' fits 46px. UiMenu gains a
ButtonDatFont for the caption (popup rows keep the menu font);
the controller reads both elements' authored FontColor/FontDid instead
of the invented (1,.92,.72) constants.

The old widening pin is rewritten to the retail contract; a new
conformance test pins authored width, white captions, and the authored
font DID being requested for both buttons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-24 20:43:46 +02:00
parent c12a95b6e8
commit 67e963524b
4 changed files with 106 additions and 33 deletions

View file

@ -368,8 +368,15 @@ public class ChatLayoutConformanceTests
Assert.Equal(605f, inputBar.Width);
}
/// <summary>
/// 2026-08-24 rewrite: this test used to pin the content-widening
/// reflow (button grown past 46px for the invented long captions).
/// Retail never resizes the talk button — the authored 46x17 stands
/// through selection changes AND layout passes, and the input keeps its
/// authored start (owner-reported "button too big" delta).
/// </summary>
[Fact]
public void ChatFixture_ChannelCaptionWidth_SurvivesImportedLayoutPass()
public void ChatFixture_ChannelButton_KeepsAuthoredWidthThroughLayoutPass()
{
var infos = FixtureLoader.LoadChatInfos();
var layout = LayoutImporter.Build(infos, NoTex, null);
@ -384,13 +391,12 @@ public class ChatLayoutConformanceTests
NoTex);
Assert.NotNull(controller);
controller!.Menu.OnSelect!.Invoke(ChatChannelKind.General);
float fittedWidth = controller.Menu.Width;
float inputLeft = controller!.Input.Left;
controller.Menu.OnSelect!.Invoke(ChatChannelKind.General);
controller.Menu.ApplyAnchor(controller.Menu.Parent!.Width, controller.Menu.Parent.Height);
Assert.True(fittedWidth > 46f);
Assert.Equal(fittedWidth, controller.Menu.Width);
Assert.Equal(controller.Menu.Left + fittedWidth, controller.Input.Left);
Assert.Equal(46f, controller.Menu.Width);
Assert.Equal(inputLeft, controller.Input.Left);
}
[Fact]
@ -734,4 +740,41 @@ public class ChatLayoutConformanceTests
ApplyLayoutPassLocal(child);
}
}
/// <summary>
/// 2026-08-24 owner report ("chat button too big; caption should be
/// whiter — same for Send"): retail keeps the AUTHORED 46x17 talk
/// button (HandleSelection @0x004cd540 never resizes it — the authored
/// SHORT captions fit, which is why retail abbreviates), and both the
/// button caption child (0x10000015) and the Send button (0x10000019)
/// author PURE WHITE text with their own FontDid 0x40000002. The
/// previous content-widening reflow and invented warm-gold labels are
/// retired.
/// </summary>
[Fact]
public void TalkButtonAndSend_KeepAuthoredSizeFontAndWhiteCaptions()
{
var infos = FixtureLoader.LoadChatInfos();
ImportedLayout layout = LayoutImporter.Build(infos, NoTex, null);
var requestedFonts = new List<uint>();
var controller = ChatWindowController.Bind(
infos, layout, new ChatVM(new ChatLog()), () => NullCommandBus.Instance,
new ChatWindowState(), null, null, NoTex,
resolveFont: did => { requestedFonts.Add(did); return null; });
Assert.NotNull(controller);
UiMenu menu = Assert.IsType<UiMenu>(layout.FindElement(0x10000014u));
// Authored 46x17 stands — no content widening.
Assert.Equal(46f, menu.Width);
menu.OnSelect!.Invoke(ChatChannelKind.General);
Assert.Equal(46f, menu.Width);
// Authored caption color: pure white.
Assert.Equal(new System.Numerics.Vector4(1f, 1f, 1f, 1f), menu.TextColor);
var send = Assert.IsType<UiButton>(layout.FindElement(0x10000019u));
Assert.Equal(new System.Numerics.Vector4(1f, 1f, 1f, 1f), send.LabelColor);
// Both caption fonts were requested from the authored FontDid.
Assert.Contains(0x40000002u, requestedFonts);
}
}