Erik
|
f14296c75f
|
feat(ui): #17 ChatPanel input field + slash commands + reply-to-last-tell
ChatPanel gains an Enter-to-submit input field via the I.1
InputTextSubmit widget. Submitted text routes through ChatInputParser
to a SendChatCmd published on ctx.Commands; LiveCommandBus (I.3)
handles the wire send + ChatLog echo.
Recognised prefixes (ported from holtburger commands.rs):
/say msg or no prefix -> Say
/t Name msg or /tell -> Tell (first whitespace token = target)
/r msg -> Tell (target = LastIncomingTellSender)
/g msg -> General
/f msg -> Fellowship
/a msg -> Allegiance
/m msg -> Monarch
/p msg -> Patron
/v msg -> Vassals
/cv msg -> CoVassals
/lfg msg -> Lfg
/trade msg -> Trade
/role msg -> Roleplay
/society msg -> Society
/olthoi msg -> Olthoi
Edge cases: empty / whitespace / cmd-without-message / /r without
prior tell -> null (no-op). Unknown /xyz prefix -> Say with literal
text (matches holtburger's Talk(command) default arm).
ChatVM.LastIncomingTellSender populated only on incoming Tell entries;
discriminated by SenderGuid != 0 (OnSelfSent echoes always carry 0).
32 new tests:
- ChatInputParserTests: 22 covering every prefix + edge case
- ChatVMLastTellSenderTests: 6 covering capture + skip rules
- ChatPanelInputTests: 6 using FakePanelRenderer + recording
ICommandBus to assert publish behaviour
UI.Abstractions.Tests: 60 -> 92. Solution total: 934 green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-04-25 19:44:04 +02:00 |
|