Repository navigation
fix(chat): let Shift+Enter insert a composer newline - #1537
Conversation
Let the WinUI TextBox handle Shift+Enter newline insertion by enabling returns and only sending on unmodified Enter. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 6, 2026, 11:08 AM ET / 15:08 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch lets the native Windows chat input insert Shift+Enter newlines and adds opt-in keyboard tests for caret placement, selection replacement, draft synchronization, and Enter-to-send. Merge readiness⛔ Blocked before merge - 2 items remain The PR remains useful: main and the latest release retain the reported manual newline path. The earlier caret assertion is corrected and integration conflicts are resolved, but keyboard acceptance remains unverified. No new actionable source defect was found. Likely related people: bkudiess, shanselman, and karkarl are routing candidates based on prior merged composer work (medium confidence). Priority: P2 Review scores
Verification
How this fits togetherThe Companion chat composer turns keyboard input into a draft and submits that draft to the selected conversation. Its native text box also routes Enter through slash-command selection or message submission. flowchart TD
A[Keyboard input] --> B[Native chat composer]
B --> C[Slash menu decision]
C --> D[Command selection]
C --> E[Newline or send decision]
E --> F[Updated draft and caret]
E --> G[Selected conversation submission]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep native newline ownership in the text box while establishing that message submission, slash selection, and IME commit behavior remain intact. Do we have a high-confidence way to reproduce the issue? Yes, source inspection supports the linked issue's narrow reproduction: type hello world and press Shift+Enter. Main still updates the queued draft before placing the caret against the old text; this review did not execute Windows input. Is this the best way to solve the issue? Yes, native newline insertion is a focused repair that removes the stale-text caret assignment. Its suitability for landing still depends on actual Enter, slash-menu, and IME behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4895ed50e39e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Scoped maintainer triage verdictHOLD_FOR_AUTHOR. Take confidence: 35%. Recommendation confidence: 98%. Reviewed head: Basis and remaining gatesThe added regression directly assigns SelectedText rather than injecting Shift+Enter, then expects normalized caret prefix length 5 for hello followed by an inserted newline. That places the caret before the newline; the expected post-insertion position is 6. Correct the assertion and prove actual keyboard input, selection replacement, IME and ordinary Enter-send behavior. Diagnose the separate hosted UI inactivity/testhost failure against exact base; do not assume either that the glyph/composer patch caused it or that it is a proven baseline flake. To reach 90%+ take confidencekarkarl: test real Shift+Enter rather than SelectedText replacement; assert caret after newline, not before it. Diagnose separate watchdog. Floor + UI keyboard/selection/IME and ordinary Enter-send. Here, Floor means final-head Quoted execution results are author/maintainer receipts reviewed during the scoped triage, not tests rerun by this posting session. Missing or stale-head proof is not a pass. A dedicated child session is preparing a read-only revalidation/closeout plan; no implementation, destructive execution, CI rerun or merge is authorized by this verdict. |
Replace the proxy caret oracle with opt-in native keyboard coverage and observable sends. Keep a separately named programmatic reconciliation smoke and document isolated-host proof requirements. Co-authored-by: Copilot App <[email protected]>
Preserve both native-keyboard send recording and upstream pending-message queue behavior in the proof provider. Verify both recorded sends in the existing queue lifecycle regression. Co-authored-by: Copilot App <[email protected]>
|
Conflict-resolution closeout for head Merged base Hosted CI: Build and Test run 37484123608 passed on this head, including UI/functional/accessibility, Tray/setup/integration, and CI Gate. The Core and CLI job was skipped by workflow selection; this is not evidence that every suite ran. Local validation on the merge head:
Not verified / blocked: local full-suite closeout is not green. Native keyboard/IME proof remains blocked as previously documented; the opt-in cases were not exercised by hosted CI. Local logs/TRX are under While local closeout was running, GitHub records that karkarl merged this PR at |
Fixes #1492
What Problem This Solves
Fixes the chat composer caret resetting when inserting a newline with Shift+Enter. The review follow-up also corrects a regression test that checked the position before the newline without exercising keyboard input.
User Impact
The intended behavior is native Shift+Enter insertion with the caret on the new line, while ordinary Enter sends. The follow-up changes tests and documentation only. Current-head interactive keyboard behavior remains unverified on this host; ready for review does not mean ready to merge.
Why This Change Was Made
The original change enables native returns instead of manually rewriting the draft and caret. Follow-up commit
25383cab177240fc02e98ac8b068d5fcca6a0b96addresses both confirmed Hanselman review findings:xto verify continued typing at the correct position.No speculative production
PreviewKeyDownrewrite was made. Native Enter routing, slash-menu handling, and IME composition need actual keyboard proof before such a change is justified.Evidence
Final source tree:
25383cab177240fc02e98ac8b068d5fcca6a0b96. Full build passed. Final complete Shared suite passed with serialized xUnit execution; Tray suite passed. The noninteractive composer smoke passed and the keyboard theory explicitly skipped without opt-in.The opted-in keyboard run was attempted, but all five cases failed before injection because Windows refused foreground activation, including after a bounded
SetForegroundWindowretry. This is a proof-host blocker, not a keyboard pass or evidence of a composer failure. No screenshot was produced. Crabbox is not installed, so no remote provider, lease, or run was created.Rubber-duck review found no blocking source defect. Its minor keyboard-state thread-affinity finding was fixed by checking focus and injecting within the UI-thread callback. Structured autoreview was attempted with
python .\.agents\skills\autoreview\scripts\autoreview --mode commit --commit 25383cab177240fc02e98ac8b068d5fcca6a0b96; the bounded commit bundle was accepted, but the Codex engine exited 1 without a structured result. No clean structured-autoreview result is claimed.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: chat composer keyboard behavior changed. Still required; foreground activation was unavailable on this host.Validation
All runs set
OPENCLAW_REPO_ROOTto this worktree andOPENCLAW_TRAY_DATA_DIRto an isolated test directory. Test projects were built first to prevent fresh-worktree no-op results. Final closeout, using the source tree committed as25383cab:.\build.ps1: passed, all projects, nativewin-arm64build on this Windows host.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'trx;LogFileName=shared-verified.trx' --results-directory .\TestResults\ComposerKeyboard -- xUnit.MaxParallelThreads=1: passed, 4,114 passed, 33 skipped, 0 failed, 4,147 total.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'trx;LogFileName=tray-verified.trx' --results-directory .\TestResults\ComposerKeyboard: passed, 3,154 passed, 0 skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64 --filter 'FullyQualifiedName~ComposerInput_' --logger 'trx;LogFileName=composer-final.trx' --results-directory .\TestResults\ComposerKeyboard: passed smoke / keyboard skipped, 1 passed, 1 skipped, 0 failed. The skipped theory is not keyboard proof.OPENCLAW_RUN_KEYBOARD_PROOF=1,.\scripts\run-proof-tests.ps1 -Project 'tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj' -Filter 'Category=NativeKeyboard' -ResultName 'composer-keyboard' -RuntimeIdentifier win-x64: blocked/failed, 5 failed, 0 passed, 0 skipped, all at foreground activation before input. Seedocs/TEST_COVERAGE.mdfor host and capture requirements.Default-parallel Shared runs first passed, then failed twice on the untouched
MarkdownParserFuzzTests.Build_ManyListItems_ScalingCurvewall-clock assertion (30k items: 815 ms and 684 ms against a 500 ms limit). The isolated failing test passed withdotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter FullyQualifiedName~Build_ManyListItems_ScalingCurve --logger 'console;verbosity=normal'. The complete Shared suite then passed twice withxUnit.MaxParallelThreads=1, including the final full build/Shared/Tray closeout. No assertion, threshold, or test source was weakened to obtain that result.The earlier hosted CI run failed on a five-minute UI inactivity abort. Its tested synthetic merge was
e6ba041, with exact base19d317eand PR head944d3e9e. That failure has not been attributed to this patch or established as baseline flakiness. New-head CI results remain a separate merge gate.Real Behavior Proof
win-x64; isolated tray data.25383cab177240fc02e98ac8b068d5fcca6a0b96.ComposerInput_ProgrammaticEditPreservesNativeSelectionAfterRenderpasses against the mounted production composer, checkinghello\n world, synchronized draft, control identity, and unchanged immediate native selection after rendering.Windows did not allow the keyboard proof window to become foreground.before sending any keys.Yes/No/N/A): N/A. Local TRX/logs are retained underTestResults\ComposerKeyboard; no uploaded screenshot or artifact link is claimed.Security Impact
Yes/No): No production change.Yes/No): No.Yes/No): No.Yes/No): Yes, test-only opt-inSendInputhelper; no production command or MCP surface.Yes/No): No.Yes, explain the risk and mitigation: keyboard proof can affect desktop input and therefore requires an isolated interactive desktop with no concurrent user/computer-use input. The helper checks foreground/focus ownership and modifier state, fails closed on denial, and releases injected keys after partial injection failure.Compatibility and Migration
Yes/No): Yes, no new production API or storage contract.Yes/No): Yes, test-onlyOPENCLAW_RUN_KEYBOARD_PROOF=1opt-in.Yes/No): No.Review Conversations
No inline review threads were present. This appended follow-up records the response to the two confirmed caret/keyboard-coverage findings. Actual keyboard acceptance and the unverified native Enter-routing concern remain explicitly open for interactive proof.
Original author description and validation, preserved as historical evidence for 944d3e9 (superseded by the follow-up above)
Fixes #1492
Summary
AcceptsReturn.Required proof pools
windows-winui-interactive: chat composer keyboard behavior changed.Validation
.\build.ps1: passed. All builds succeeded.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: passed. Failed: 0, Passed: 4115, Skipped: 32, Total: 4147, Duration: 52 s.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: passed. Failed: 0, Passed: 3154, Skipped: 0, Total: 3154, Duration: 1 h 51 m..\scripts\run-proof-tests.ps1 -Project 'tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj' -Filter 'FullyQualifiedName~ComposerInput_AcceptsNativeReturnAtCaretWithoutSelectionResetToStart' -ResultName 'shift-enter-composer' -RuntimeIdentifier win-x64: passed. Total tests: 1, Passed: 1.Real behavior proof
ComposerInput_AcceptsNativeReturnAtCaretWithoutSelectionResetToStartverifies the production composer input accepts native returns, inserts a newline at the caret, and does not reset selection to position 0 after Reactor settles.