fix(ui): OP5 re-check residuals R1/R2 (coordinator pass) — OP5 CLOSED

R1: UiRoot now delivers WM_CAPTURECHANGED (0x215 — retail's own Win32
event-id space) to the element losing pointer capture on BOTH release
and re-target; UiScrollbar terminates a mid-drag gesture there,
completing it (one DragCompleted flush persisting the user's last-seen
value) and unlatching IsDragging — a panel-close keybind mid-drag or a
second-button re-target can no longer latch the drag flag forever and
silently suppress every later settings flush. Normal MouseUp paths
no-op (the latch is already clear when capture releases).

R2: the scalar latch arms BEFORE the track-click jump applies, so the
jump's own ScalarChanged tick defers its flush to the MouseUp's single
DragCompleted — one flush per press gesture, never the
inline-then-completed double; the DragCompleted doc now states the real
contract (fires once per value-capable gesture incl. capture loss)
instead of the refuted never-on-jump claim.

Tests: capture-loss mid-drag (ends + completes once + stray-MouseUp
no-double), no-drag capture-change no-op, bare-track-click
single-completion with the latch observed armed during the jump tick.
Also reconciles the research doc's U4 row to its closure (the six
caption pairs, the BN zero-fold post-mortem) per the OP6 rework's flag.

Full Release suite: 13,128 passed / 4 skipped / 0 failed (one
documented #250-class allocation flake on first run, green in
isolation and on full-suite rerun).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-11 08:13:24 +02:00
parent 472525b99e
commit 67b0815c79
5 changed files with 142 additions and 10 deletions

View file

@ -68,6 +68,13 @@ public static class UiEventType
public const int MouseMove = 0x200;
public const int MouseDown = 0x201; // left button down
public const int MouseUp = 0x202; // left button up
/// <summary>WM_CAPTURECHANGED (0x215) — delivered by <see cref="UiRoot"/>
/// to the element LOSING pointer capture when capture is released or
/// re-targeted WITHOUT a MouseUp reaching that element (panel hidden by a
/// keybind mid-drag; a second button press re-targeting capture). A widget
/// holding gesture state keyed to capture (the scrollbar's drag latch)
/// must terminate the gesture here (OP5 re-check R1, 2026-08-11).</summary>
public const int CaptureChanged = 0x215;
public const int DoubleClickLeft = 0x203;
public const int RightDown = 0x204;
public const int RightUp = 0x205;