feat(ui): port retail selected-stack quantity

Bind the authored stack count entry and horizontal slider to one Core split-quantity owner, preserve retail count-first naming and exact 1000-step rounding, refresh on stack changes, and consume the selected amount during merges. Conformance covers the production DAT fixture and retained pointer/focus paths.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-11 10:07:25 +02:00
parent dc1649c493
commit a20e5c68c7
19 changed files with 595 additions and 51 deletions

View file

@ -69,4 +69,29 @@ public class UiFieldTests
for (int i = 0; i < 150; i++) { input.InsertChar('x'); input.Submit(); }
Assert.True(input.HistoryCount <= 100);
}
[Fact]
public void CharacterFilter_rejectsDisallowedInput()
{
var input = new UiField { CharacterFilter = static c => char.IsAsciiDigit(c) };
input.InsertChar('4');
input.InsertChar('x');
input.InsertChar('2');
Assert.Equal("42", input.Text);
}
[Fact]
public void SelectAllOnFocus_survivesInitiatingMouseDown_andTypingReplacesValue()
{
var input = new UiField { SelectAllOnFocus = true, Selectable = true };
input.SetText("17");
input.OnEvent(new UiEvent(0u, input, UiEventType.FocusGained));
input.OnEvent(new UiEvent(0u, input, UiEventType.MouseDown, Data1: 2));
input.InsertChar('5');
Assert.Equal("5", input.Text);
}
}