fix(messaging): support multiline messages via shift-enter#466
Open
devag7 wants to merge 4 commits into
Open
Conversation
Contributor
Greptile SummaryThis PR updates LinkedIn message sending to handle multiline text correctly. It changes:
Confidence Score: 5/5This looks safe to merge.
Reviews (4): Last reviewed commit: "style: format test_scraping.py" | Re-trigger Greptile |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for sending multiline LinkedIn messages by inserting line breaks with Shift+Enter instead of typing raw newline characters.
Changes:
- Introduced a helper to type messages line-by-line and insert newlines via Shift+Enter.
- Updated
send_messageto use the newline-aware typing helper. - Added an async test ensuring multiline messages trigger Shift+Enter behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_scraping.py | Adds coverage to verify multiline message typing uses Shift+Enter between lines. |
| linkedin_mcp_server/scraping/extractor.py | Implements newline-aware message typing and switches send_message to use it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| async def _type_message_with_newlines(self, message: str) -> None: | ||
| """Type a message honoring newlines via Shift+Enter.""" | ||
| lines = message.split("\n") |
Comment on lines
+3153
to
+3164
| async def _type_message_with_newlines(self, message: str) -> None: | ||
| """Type a message honoring newlines via Shift+Enter.""" | ||
| lines = message.split("\n") | ||
| for i, line in enumerate(lines): | ||
| if line: | ||
| await self._page.keyboard.type(line, delay=15) | ||
| if i < len(lines) - 1: | ||
| await self._page.keyboard.down("Shift") | ||
| await self._page.keyboard.press("Enter") | ||
| await self._page.keyboard.up("Shift") | ||
| await asyncio.sleep(0.1) | ||
|
|
Comment on lines
+3160
to
+3162
| await self._page.keyboard.down("Shift") | ||
| await self._page.keyboard.press("Enter") | ||
| await self._page.keyboard.up("Shift") |
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 #441. Replaces standard keyboard typing with Shift+Enter logic for newlines so messages aren't prematurely sent.