Repository navigation
Agents window: Shift+Enter inserts a new line in feedback comments - #350921
Draft
Alexandru Dima (alexdima) wants to merge 1 commit into
Draft
Alexandru Dima (alexdima) wants to merge 1 commit into
Alexandru Dima (alexdima) wants to merge 1 commit into
Conversation
Shift+Enter, and Enter during IME composition, no longer submit the inline feedback input; the textarea inserts the new line. Comments written by the user render with markdown line breaks so the lines show on the card. Agent-authored comments render as before. Fixes #347298 🤖 Authored with GitHub Copilot on behalf of @alexdima. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes enabling multiline feedback comments.
No open issues 🎉
What changed in this PR
Fixes #347298 by allowing multiline feedback comments in the Agents window’s Changes diff editor and preserving their line breaks on comment cards.
Changes:
- Lets Shift+Enter insert a newline and composing Enter commit input without submitting.
- Preserves line breaks in user-authored comments while leaving agent-authored rendering unchanged.
- Adds regression tests for keyboard handling and multiline rendering.
No actionable findings remain.
| File | Description |
|---|---|
src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackEditorWidget.test.ts |
Tests that multiline user comments retain visible line breaks. |
src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackEditorInputContribution.test.ts |
Tests Shift+Enter passthrough and Enter submission. |
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorWidget.ts |
Enables preserved line breaks for user-authored markdown. |
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorInputContribution.ts |
Prevents submission on Shift+Enter and composing Enter. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #347298
Problem
In the Agents window, the inline Add Comment input in the Changes diff editor sends the comment when you press Shift+Enter, so you can't write a multi-line comment. There was also a second problem: a comment that did contain a newline showed as one line on its card, because markdown folds a single line break into the same paragraph.
Change
agentFeedbackEditorInputContribution.ts: the textarea's keydown handler now lets Shift+Enter through, so the textarea inserts the new line. Enter while an IME is composing is let through too, so it commits the IME text instead of submitting half-composed text. Enter still adds the comment and Alt+Enter keeps its existing behavior.agentFeedbackEditorWidget.ts: comments the user wrote render with{ gfm: true, breaks: true }, the same option chat uses for request text, so their line breaks show on the card. Agent-authored comments render exactly as before.Each part has its own regression test.
Before / After
Same scenario: type
line one, press Shift+Enter, typeline two, press Enter.line oneand closes the input (step S4 fails).line oneandline twoon separate lines (S1–S5 pass).347298-before-after-side-by-side.mp4
How I tested
scripts/test.sh --grep "Shift\+Enter keeps typing|line breaks of a multi-line"with the two source files reverted tomainscripts/test.sh --grep AgentFeedbackpnpm run oxlinton the 4 changed filespnpm run typecheck-client--devbuild of this branchThe scenario checks DOM state, not screenshots: S4 reads the textarea value and visibility after Shift+Enter, and S5 reads the rendered card text.
Before / after
Before
347298-before-insiders.mp4
After
347298-after-dev.mp4
🤖 Authored with GitHub Copilot on behalf of Alexandru Dima (@alexdima).