-
Notifications
You must be signed in to change notification settings - Fork 78
allow for new lines in prompt bar. #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds multiline prompt entry support in the prompt bar (Issue #157), and updates message rendering to preserve user-entered line breaks.
Changes:
- Replace the prompt
<input>with a<textarea>and add Enter-to-submit / Shift+Enter-for-newline behavior. - Update conversation message CSS to preserve newlines and wrap long words.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| resources/ts/components/ConversationPromptInput.tsx | Switches to textarea and adds keyboard handling for multiline prompts/submission. |
| resources/ts/components/ConversationMessage.module.css | Adjusts whitespace/wrapping to display newlines in messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (currentPrompt.trim() !== "") { | ||
| setSubmittedPrompt(currentPrompt); | ||
| } | ||
| } | ||
| }, | ||
| [currentPrompt, setSubmittedPrompt], |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onKeyDown submits on Enter, but it bypasses the form onSubmit logic. This regresses the previous behavior where pressing Enter on an empty prompt would still invoke onSubmit (setting setSubmittedPrompt(null)), and it also duplicates submission logic in two places. Consider triggering the form submission from the key handler (e.g., via event.currentTarget.form?.requestSubmit() after preventDefault()), so all submission paths go through onSubmit and stay consistent.
| if (currentPrompt.trim() !== "") { | |
| setSubmittedPrompt(currentPrompt); | |
| } | |
| } | |
| }, | |
| [currentPrompt, setSubmittedPrompt], | |
| event.currentTarget.form?.requestSubmit(); | |
| } | |
| }, | |
| [], |
| if (event.key === "Enter" && !event.shiftKey) { | ||
| event.preventDefault(); | ||
| if (currentPrompt.trim() !== "") { | ||
| setSubmittedPrompt(currentPrompt); | ||
| } |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding the Enter key down will fire repeated keydown events and can submit the same prompt multiple times (triggering multiple setSubmittedPrompt calls / version increments). Add a guard such as ignoring event.repeat (or otherwise debouncing) for the Enter-to-submit path.
| white-space: pre-wrap; | ||
| overflow-wrap: break-word; |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying white-space: pre-wrap at the .conversationMessage container level affects all descendants (author label, thoughts, and the react-markdown output). This changes Markdown rendering semantics by turning soft line breaks inside paragraphs into hard line breaks, which can noticeably degrade formatting for AI responses. If the goal is only to preserve user-entered newlines, consider scoping this style to just the user message content (or rendering user prompts as plain text with pre-wrap) while leaving Markdown output with normal whitespace handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we already have onSubmit, so we should use that. Submitting on "enter" key pressed will not work in all the possible scenarios and edge cases (mobile etc).
The issue was there was no vertical scroll in the messages column, word break rules will not change a lot how the prompt screen behaves.
solves issue