Skip to content

Conversation

@rahulb18
Copy link
Contributor

Summary

Fixes line break preservation in the DocsGPT chat widget to properly display multi-line messages.

Changes

  • Added white-space: pre-wrap to the Message component in DocsGPTWidget
  • Ensures that when users press Shift+Enter to create new lines, those line breaks are preserved and displayed in the message bubbles
  • Improves overall message formatting and readability

Problem

Previously, when users typed multi-line messages using Shift+Enter in the chat widget, the line breaks were not displayed in the sent messages. All lines appeared concatenated on a single line.

Solution

Added CSS white-space: pre-wrap property to the Message styled component, which preserves whitespace and line breaks while still allowing text to wrap.

Test Plan

  • Shift+Enter creates new line in widget input (already working)
  • Enter alone sends the message (already working)
  • Multi-line messages display with proper line breaks
  • Message formatting shows proper spacing between lines
  • Tested on http://localhost:3001

Fixes #2159

- Added autoFocus to useEffect dependency array in MessageInput
- Added key prop to MessageInput to force remount on conversation reset
- Implemented refocus after message submission
- Removed duplicate input clearing logic in handleKeyDown

Fixes arc53#2177
- Added white-space: pre-wrap to Message component styling
- Ensures line breaks from Shift+Enter are properly displayed
- Improves message formatting with proper spacing

Fixes arc53#2159
@vercel
Copy link

vercel bot commented Dec 16, 2025

@rahulb18 is attempting to deploy a commit to the Arc53 Team on Vercel.

A member of the Team first needs to authorize it.

@ManishMadan2882
Copy link
Collaborator

@rahulb18 The issue was related to the react widget only, was already addressed by another contributor, Thanks for time but this PR needs to be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Improve DocsGPT Chat Widget

2 participants