fix(ui,runtime): OP4 re-review residuals R1-R4 (coordinator pass) — OP4 CLOSED

R1: the timestamp prefix moves from ChatLog.Append (which stamped the
stored BODY, rendering 'Alice says, "13:05:09 hi"') to ChatVM's display
composition — FormatTimestampPrefix(entry.Received) prepends the COMPOSED
line, matching retail's separate-leading-string model (fprintf("%ls%ls",
ts, text) @0x00563e5b; AddTextToScroll receives composed lines). The
prefix renders entry.Received in LOCAL time (retail strftime), invariant
literal colons. The ten defect-pinning test cases across
ChatLogTests/RuntimeCommunicationStateTests are rewritten to pin the
corrected contract (stored bodies stay clean; the composed line carries
the stamp outside the quotes — ChatVMTests).

R2: open option-bearing panels converge on every PlayerDescription seed:
OptionPage.ReloadFromLive (per-row live re-read + gating re-eval, NO
AfterApply flush — the seed just cleared the dirty module),
OptionsPanelController.OnServerOptionsSeeded (active page),
CombatUiController.OnServerOptionsSeeded (SyncControls), wired through
RuntimeSettingsController.ServerOptionsSeeded from the same factory hook
LockUI already uses. Retail cannot reach this state (its panels close
across login); the adaptation exists because retained panels survive the
session boundary — documented at the seam.

R3: tests drive the refresh widget push (model AND checkbox converge) and
ReloadFromLive's no-flush contract. R4: AP-196 addendum names the
headless AutoRepeatAttack false->true effective-default flip and the
characterOptions escape hatch.

Full Release suite: 13,083 passed / 4 skipped / 0 failed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-11 06:36:14 +02:00
parent e71e5a9614
commit ac0304dcf0
13 changed files with 216 additions and 114 deletions

View file

@ -372,4 +372,63 @@ public sealed class OptionPageModelTests
Assert.Equal(1, notifyCount);
}
// ── OP4 re-review R3: SaveCurrentValue's live re-read pushes the WIDGET
// too (the refresh delegate), so a re-seed converges both the row's
// model state AND the visible checkbox. ──────────────────────────────
[Fact]
public void SaveCurrentValue_ReReadsLiveSource_AndPushesTheWidgetRefresh()
{
bool live = false;
bool widgetChecked = true; // deliberately out of sync with live
var row = new BoolOptionRow(
initial: true,
defaultValue: false,
read: () => live,
refresh: value => widgetChecked = value);
live = false;
row.SaveCurrentValue();
// Model AND widget both converge on the live source.
Assert.False(row.Current);
Assert.False(row.Changed);
Assert.False(widgetChecked);
live = true;
row.SaveCurrentValue();
Assert.True(row.Current);
Assert.True(widgetChecked);
}
// ── OP4 re-review R2: ReloadFromLive = per-row live re-read + gating
// re-eval, WITHOUT Apply's AfterApply flush (a seed just cleared the
// dirty module — a flush publication here would be spurious). ────────
[Fact]
public void ReloadFromLive_ReReadsRows_WithoutFiringAfterApply()
{
bool live = false;
bool widgetChecked = false;
int flushCount = 0;
int gatingCount = 0;
var page = new OptionPage { AfterApply = () => flushCount++ };
var row = new BoolOptionRow(
initial: false,
defaultValue: false,
read: () => live,
refresh: value => widgetChecked = value);
page.Register(row);
page.OnOptionChanged = () => gatingCount++;
live = true;
page.ReloadFromLive();
Assert.True(row.Current);
Assert.True(widgetChecked);
Assert.False(row.Changed); // (current, saved) both re-read — no phantom dirt
Assert.Equal(0, flushCount); // NO AfterApply publication on a seed
Assert.Equal(1, gatingCount); // Apply/Reset ghosting re-evaluated
}
}