-
Notifications
You must be signed in to change notification settings - Fork 2
Bug/97623 empty message fix #198
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
This PR fixes an issue where message bubbles containing only whitespace or escape sequences were being rendered as empty bubbles. The fix extracts the escape sequence detection logic into a reusable utility function and updates the message matching logic to properly handle these cases.
Key Changes:
- Introduced a utility function to detect strings containing only escape sequences/whitespace
- Updated message matching logic to filter out escape-sequence-only messages when streaming collation is disabled
- Added a test case demonstrating the fix for messages with only newlines and spaces
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils.ts | Added isOnlyEscapeSequence utility function to detect whitespace-only strings |
| src/matcher.ts | Updated message validation to use the new utility and removed redundant markdown check |
| test/demo.tsx | Added test case for whitespace-only message bubble scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vj-venkatesan
left a comment
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.
Regex looks good. Although I don't understand why the empty bubble shows up when your text is " \n\n"
This PR fixes the rendering of empty message bubbles
Success Criteria:
Te test: