Repository navigation
Description
Version: OpenClaw Companion 2026.9.4 (3c43751), Windows x64. Code path unchanged on main @ a2c4647. Gateway 2026.9.5.
Steps
- Open chat in the companion app.
- Type
hello world, leave the caret at the end. - Press Shift+Enter.
Expected
A newline is inserted at the caret and the caret moves to the new line (as in the web Control UI).
Actual
The caret jumps to position 0, above/before the existing text.
Analysis (from reading the source; not debugged live)
src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs (~L480–566) uses AcceptsReturn(false) and handles Shift+Enter manually in OnKeyDown: it sets args.Handled = true, calls vm.SetDraft(current[..start] + "\n" + current[end..]), then sets textBox.SelectionStart = start + 1.
ChatComposerViewModel.SetDraft is enqueued via Mutate/EnqueueMutation, so the selection is set against the stale text. When the queued draft re-renders, TextBox.Text is replaced wholesale and WinUI resets the selection to 0. WinUI's \n → \r normalization may also make the read-back text never equal the draft, causing an extra re-sync.
Introduced with the chat composer rewrite (#1055 / #1098).
Suggested fix
Use AcceptsReturn(true) and only intercept unmodified Enter (set Handled, call Send()), letting the TextBox insert newlines natively. Alternatively, defer caret placement until after the draft commits and compare drafts with normalized line endings.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Sep 23, 2026
Codex review: this still needs some work. Reviewed September 28, 2026, 3:19 PM ET / 19:19 UTC.
Summary
Keep this issue open for a focused native chat repair. Current main and the latest release still place the caret immediately after requesting a draft change, before the rendered TextBox receives that change. The prior Codex review identified the same ordering problem, and no open PR was found that owns this fix.
Reproducibility: yes. the current source gives a high-confidence path: type text in the native composer, place the caret at the end, and press Shift+Enter. This read-only review did not execute WinUI or independently observe the exact reported jump to position zero.
Next step
The defect has a narrow source-established boundary and native UI test seam. Automatic implementation is already reported as queued, and no open PR was found; avoid dispatching a duplicate worker.
Review details
Best possible solution:
Let the native TextBox insert the newline and move its caret, while preserving Enter-to-send and slash-menu keyboard behavior; verify the result after rendering in a native UI regression.
Do we have a high-confidence way to reproduce the issue?
Yes, the current source gives a high-confidence path: type text in the native composer, place the caret at the end, and press Shift+Enter. This read-only review did not execute WinUI or independently observe the exact reported jump to position zero.
Is this the best way to solve the issue?
Yes, native newline insertion is the narrowest promising fix for caret ownership. A failing native regression should first establish the observed behavior, then verify the caret and draft after rendering.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning medium; reviewed against dba81213371c.
Label changes
Label changes:
No label changes.
Label justifications:
P2: Multiline composition is disrupted, while ordinary message sending is not shown to be blocked.impact:ux-friction: Shift+Enter makes caret placement confusing during a user-facing chat workflow.Evidence reviewed
Acceptance criteria:
What I checked:
src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs:550, dba81213371c)src/OpenClaw.Tray.WinUI/Chat/ChatComposerViewModel.cs:338, dba81213371c)tests/OpenClaw.Tray.UITests/ReactorChatLayoutProofTests.cs:113, dba81213371c)docs/ARCHITECTURE.md:403, dba81213371c)src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs, 686afdc8d4a2)src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs:494, 3c43751b2bac)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.clawsweeper commentedon Sep 28, 2026
🦞🔧
ClawSweeper is automatically building a fix for this issue.
The issue review finished and no active implementation pull request was found.
Automatic implementation progress:
clawsweeper:manual-onlyorclawsweeper:human-review.