Signal-Desktop
Signal-Desktop copied to clipboard
Add an option in chat preferences to disable enter key sends
First time contributor checklist:
- [X] I have read the README and Contributor Guidelines
- [X] I have signed the Contributor Licence Agreement
Contributor checklist:
- [X] My contribution is not related to translations.
- [X] My commits are in nice logical chunks with good commit messages
- [x] My changes are rebased on the latest
main
branch - [x] A
yarn ready
run passes successfully (more about tests here) - [x] My changes are ready to be shipped to users
Description
Changes Overview
These changes address the feature request made here. My changes include/will include:
- The send button will be visible when text has been entered. This models the behavior after the android app so it feels the same. An alternative approach would be to always have it showing, which I can do if that is preferred.
- There will be a new option in the Preferences -> Chats section that is the same as the android app: "Enter key sends". To avoid confusing any existing users this option will be ON by default to replicate the existing behavior. Turning it off will cause the only way to send a message to be via Ctrl/Command + Enter or with the Send button that will now be visible. If there are other ways to send a message let me know and I can test to ensure I don't break them.
- Fix the send button margin issue using the requested approach in https://github.com/signalapp/Signal-Desktop/pull/6219.
Testing Approach
- I am manually testing sending messages using the collapsed view, expanded view, and with both the new option on and off.
- I have not written any new tests as I could not find a similar example test to base it off of. If someone can point out a test that either is based on a settings value (for testing the new preference value) or a test for testing that keypresses function properly I am happy to implement some tests.
- I have tested on MacOS (Ventura 13.0.1)
For the UI:
Doesn't it need an explanation in the settings that "Ctrl-Enter" will send the message when enabled?
An other UX way to go, would be that the new setting is to "Keep composer mode enabled" or "Composer mode always enabled" which would have the same effect.
I need this, and many more do: https://community.signalusers.org/t/options-to-change-behavior-of-pressing-the-enter-key/8753
I sincerely apologize, but I do not have the time to revisit this and resolve all the merge conflicts. If someone else wants to utilize the code and open a PR with the fixes you are welcome to, but I am going to close this PR since I will not be able to complete it at this time.