Skip to content

fix(messaging): support multiline messages via shift-enter#466

Open
devag7 wants to merge 4 commits into
stickerdaniel:mainfrom
devag7:fix/441-multiline-message-splitting
Open

fix(messaging): support multiline messages via shift-enter#466
devag7 wants to merge 4 commits into
stickerdaniel:mainfrom
devag7:fix/441-multiline-message-splitting

Conversation

@devag7
Copy link
Copy Markdown

@devag7 devag7 commented May 26, 2026

Fixes #441. Replaces standard keyboard typing with Shift+Enter logic for newlines so messages aren't prematurely sent.

Copilot AI review requested due to automatic review settings May 26, 2026 20:52
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR updates LinkedIn message sending to handle multiline text correctly. It changes:

  • Adds a helper that normalizes CRLF and CR line endings before typing.
  • Types each message line separately and inserts line breaks with Shift+Enter.
  • Keeps the existing send flow and confirmation checks in place.
  • Adds tests for multiline messages and Windows-style line endings.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (4): Last reviewed commit: "style: format test_scraping.py" | Re-trigger Greptile

Comment thread linkedin_mcp_server/scraping/extractor.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_message to 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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Multi-paragraph message sending resolves to multi-message

2 participants