Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ Element EffortIconButton()
PlaceholderFor(inputs.ConnectionState))
.AutomationId("ChatComposerInput")
.AutomationName(PlaceholderFor(inputs.ConnectionState))
.OnKeyDown((sender, args) =>
// Multiline TextBox consumes Enter before bubbling KeyDown. Handle
// composer shortcuts in preview so only Shift+Enter inserts a newline.
.OnPreviewKeyDown((sender, args) =>
{
if (slashDisplay.IsVisible)
{
Expand Down
11 changes: 11 additions & 0 deletions tests/OpenClaw.Tray.UITests/ReactorChatLayoutProofTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,17 @@ await ui.RunOnUIAsync(() =>
Assert.Empty(input.Text);
Assert.Empty(session.ViewModel.Draft);
});
// A second Enter must neither send again nor add a newline to the
// empty draft, including after the send has re-rendered the input.
await PressAsync(global::Windows.System.VirtualKey.Enter);
await ui.RunOnUIAsync(() =>
{
Assert.Single(provider.SentMessages);
Assert.Empty(input.Text);
Assert.Empty(session.ViewModel.Draft);
});
if (start == 5 && length == 0)
await CaptureAsync(surface, "Composer-keyboard-enter-sent");
}, interactiveKeyboard: true);
}

Expand Down
Loading