fix(journal): the timer's unit labels hide with their boxes

Reported as "1d 2h 51sh   m" — the running countdown drawing straight through
the d/h/m labels. The readout is authored across the same strip as the three
number boxes, so the strip has to be one thing or the other; I hid the boxes
and left their labels behind.

Retail's ShowEditableTimer @0x00495770 toggles SIX elements, not three:
m_pDaysEditBox AND m_pDaysStaticText, and the same for hours and minutes, plus
the readout inverse. Reading the swap as "hide the inputs" instead of "hide the
input ROWS" is what produced the overlap.

Also settles the Record question the same round raised. Nothing was broken:
indoors, retail's own gid_to_lcoord fails and nothing is recorded, and
UpdateLocation @0x004958F0 only ever formats coordinates already stored — there
is no "you are indoors" message in that function to port. The silence is
faithful, and it is now commented as such rather than left looking like a gap.

JournalPanelLiveBindTests is new and is the test that should have existed
first: it builds the panel from the real DATs, constructs the controllers, and
asserts every button actually receives an OnClick. Every other test so far
checked either the layout or the logic — none of them proved the controller
finds its elements in the real tree, which is where an id typo or a subtree
assumption produces a panel where nothing responds and nothing fails.

The temporary ACDREAM_PROBE_JOURNAL instrumentation is removed; the question it
was added for is answered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-21 18:29:58 +02:00
parent e35d9386e4
commit eadedaea90
3 changed files with 220 additions and 1 deletions

View file

@ -29,6 +29,9 @@ public sealed class JournalNotesPageControllerTests
private const uint TimerDaysFieldId = 0x10000576u;
private const uint TimerHoursFieldId = 0x10000578u;
private const uint TimerMinutesFieldId = 0x1000057Au;
private const uint TimerDaysLabelId = 0x10000577u;
private const uint TimerHoursLabelId = 0x10000579u;
private const uint TimerMinutesLabelId = 0x1000057Bu;
private const uint RunningTimerTextId = 0x1000057Cu;
private const uint StartButtonId = 0x1000057Du;
@ -64,6 +67,9 @@ public sealed class JournalNotesPageControllerTests
page.AddChild(Text(PageNumberId));
page.AddChild(Text(RunningTimerTextId));
page.AddChild(Text(TimerDaysLabelId));
page.AddChild(Text(TimerHoursLabelId));
page.AddChild(Text(TimerMinutesLabelId));
foreach (uint id in new[]
{
PreviousButtonId, NextButtonId, NewButtonId,
@ -152,6 +158,12 @@ public sealed class JournalNotesPageControllerTests
Assert.False(FieldOf(page, TimerMinutesFieldId).Visible);
Assert.True(UiElement.FindDescendant(page, RunningTimerTextId)!.Visible);
Assert.Equal("1h 0s", TextOf(page, RunningTimerTextId));
// The unit labels go with their boxes. Leaving them drew "d h m"
// through the readout: "1d 2h 51sh m".
Assert.False(UiElement.FindDescendant(page, TimerDaysLabelId)!.Visible);
Assert.False(UiElement.FindDescendant(page, TimerHoursLabelId)!.Visible);
Assert.False(UiElement.FindDescendant(page, TimerMinutesLabelId)!.Visible);
state.Dispose();
}
@ -195,6 +207,7 @@ public sealed class JournalNotesPageControllerTests
Click(page, StartButtonId);
Assert.True(FieldOf(page, TimerDaysFieldId).Visible);
Assert.True(UiElement.FindDescendant(page, TimerDaysLabelId)!.Visible);
Assert.Equal(string.Empty, TextOf(page, RunningTimerTextId));
state.Dispose();
}