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

Ctrl-Enter to Save & Send when editing a prompt #1812

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xl0
Copy link

@xl0 xl0 commented Jul 14, 2024

Cmd-Enter already works on Mac, this adds Ctrl-Enter which is customary on other platforms.
Closes #1798


🚀 This description was created by Ellipsis for commit 8c4e5de

Summary:

Added support for Ctrl-Enter to save and send a message while editing in components/messages/message.tsx.

Key points:

  • File Modified: components/messages/message.tsx
  • Function Modified: Message.handleKeyDown
  • Change: Added support for Ctrl-Enter to save and send a message while editing, in addition to the existing Cmd-Enter functionality on Mac.
  • Behavior: When editing a message, pressing Ctrl-Enter (or Cmd-Enter on Mac) will trigger handleSendEdit.

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 8c4e5de in 12 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. components/messages/message.tsx:101
  • Draft comment:
    The change correctly implements the Ctrl-Enter functionality for non-Mac platforms while maintaining the existing Cmd-Enter functionality for Mac. This resolves the issue as described.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The PR description indicates that the change is intended to allow Ctrl-Enter to trigger the 'Save & Send' action when editing a message on platforms other than Mac, where Cmd-Enter is already implemented. The change in the code adds a check for event.ctrlKey in addition to event.metaKey in the handleKeyDown function. This should enable the desired functionality across different platforms without affecting existing functionality on Mac.

The code change is minimal and directly addresses the issue described. It checks for either Cmd (Meta) or Ctrl key along with the Enter key, which is a common pattern for cross-platform keyboard shortcuts. There doesn't seem to be any logical, performance, or security issues with this specific change. The rest of the function remains unchanged, and the context provided by the surrounding code indicates that this change should integrate smoothly with the existing logic for handling edits.

Workflow ID: wflow_g2gcWbXm6lUWJnpY


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

Ctrl-Enter should "Save & Send" when editing a user message.
1 participant