Skip to content
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

🍎 fix: Update "Enter to send" behavior for Mac users #4539

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Oct 24, 2024

Closes #4516

Summary

I implemented changes to improve the "Enter to send" functionality, ensuring consistent behavior across different operating systems, particularly for Mac users. These updates affect both the user interface language files and the underlying logic in the useTextarea hook.

  • Updated language files (Br.ts, Eng.ts, Jp.ts, Zh.ts) to include "⌘ + Enter" alongside "Ctrl + Enter" in the user interface text, providing clear instructions for Mac users.
  • Modified the useTextarea hook to recognize both Ctrl and Command (Meta) key combinations with Enter for sending messages when the "Enter to send" feature is disabled.
  • Ensured consistency across different language versions of the application, improving the user experience for non-English speakers.
  • Addressed a potential usability issue where Mac users might have been unaware of the correct key combination to send messages when "Enter to send" was disabled.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

To test these changes:

  1. Run the application on both Windows/Linux and Mac systems.
  2. Navigate to the chat interface and toggle the "Enter to send" setting off.
  3. Attempt to send messages using Enter, Ctrl+Enter, and Cmd+Enter (on Mac).
  4. Verify that the behavior matches the updated language descriptions.
  5. Check all supported languages to ensure the updated text is displayed correctly.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Update the language files for the "Enter to send" behavior in the chat interface. The changes include adding support for the "Ctrl + Enter" / "⌘ + Enter" key combination on Mac to send messages when the feature is enabled. This ensures consistent behavior across different language versions.

Affected files:
- Br.ts
- Eng.ts
- Jp.ts
- Zh.ts
@danny-avila danny-avila merged commit 840851c into main Oct 24, 2024
2 checks passed
@danny-avila danny-avila deleted the fix/cmd-enter-send branch October 24, 2024 13:49
owengo pushed a commit to openwengo/LibreChat that referenced this pull request Oct 25, 2024
* fix: Update useTextarea to handle Ctrl+Enter on Mac

* fix: Update language files for message sending behavior
danny-avila added a commit that referenced this pull request Oct 27, 2024
* fix: Update useTextarea to handle Ctrl+Enter on Mac

* fix: Update language files for message sending behavior
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]: Ctrl+Enter to send does not translate to Cmd+Enter on Mac
1 participant