Skip to content

feat(desktop): add enter-to-send functionality in messaging#4793

Merged
jamesarich merged 1 commit intomainfrom
fix/enter-to-send
Mar 14, 2026
Merged

feat(desktop): add enter-to-send functionality in messaging#4793
jamesarich merged 1 commit intomainfrom
fix/enter-to-send

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

This commit introduces a desktop-friendly keyboard shortcut for sending messages. Users can now press Enter to send a message and Shift + Enter to insert a newline.

Specific changes include:

  • Implemented onPreviewKeyEvent on the MessageInput component in DesktopMessageContent.kt.
  • Added logic to validate message length against MESSAGE_CHARACTER_LIMIT_BYTES before sending via Enter.
  • Ensured messages are only sent if the connection is active and the trimmed message is not empty.
  • Configured the event handler to consume the Enter key (preventing newlines) when the user attempts to send, while allowing standard newline behavior when Shift is pressed.

This commit introduces a desktop-friendly keyboard shortcut for sending messages. Users can now press `Enter` to send a message and `Shift + Enter` to insert a newline.

Specific changes include:
- Implemented `onPreviewKeyEvent` on the `MessageInput` component in `DesktopMessageContent.kt`.
- Added logic to validate message length against `MESSAGE_CHARACTER_LIMIT_BYTES` before sending via `Enter`.
- Ensured messages are only sent if the connection is active and the trimmed message is not empty.
- Configured the event handler to consume the `Enter` key (preventing newlines) when the user attempts to send, while allowing standard newline behavior when `Shift` is pressed.

Signed-off-by: James Rich <[email protected]>
@github-actions github-actions bot added the bugfix PR tag label Mar 14, 2026
@jamesarich jamesarich enabled auto-merge March 14, 2026 13:23
@jamesarich jamesarich added this pull request to the merge queue Mar 14, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 14, 2026
@jamesarich jamesarich merged commit acf7aea into main Mar 14, 2026
6 checks passed
@jamesarich jamesarich deleted the fix/enter-to-send branch March 14, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant