From ad7421fbed721bd978bf11600797d32fbf476eb9 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Wed, 19 Aug 2026 11:43:38 +0200 Subject: [PATCH] feat(chat): the sample the timestamp column measures against Eights rather than zeroes. In most faces 8 is the widest digit, and a column measured from 00:00 gets undercut by a 10:38 -- which would shove the name column right on exactly that row, the misalignment the column exists to remove. Two samples because the twelve-hour form is wider. That difference is why Use24HourClock has to enter the layout fingerprint: switching it moves every wrap position after the stamp, and the height cache never knew. --- HellionChat/Ui/Components/TimestampColumn.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 HellionChat/Ui/Components/TimestampColumn.cs diff --git a/HellionChat/Ui/Components/TimestampColumn.cs b/HellionChat/Ui/Components/TimestampColumn.cs new file mode 100644 index 0000000..66631d7 --- /dev/null +++ b/HellionChat/Ui/Components/TimestampColumn.cs @@ -0,0 +1,17 @@ +namespace HellionChat.Ui.Components; + +// TEST-MIRROR: Ui/TimestampColumnTests.cs +// +// The timestamp sits in a column of fixed width so the sender names below each +// other actually line up. The mockup asks for tabular figures; ImGui exposes no +// font features, and whether the bundled face even has equal-width digits is +// unverified. So the width comes from measuring the widest shape the format can +// produce, once per layout change rather than per row. +// +// Eights, not zeroes: in most faces 8 is the widest digit. A column measured +// from 00:00 would be undercut by a 10:38 and shove the name column right on +// that one row -- exactly the misalignment this exists to remove. +internal static class TimestampColumn +{ + internal static string SampleFor(bool use24Hour) => use24Hour ? "88:88" : "88:88 PM"; +}