Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add option to send/edit a message with Ctrl + Enter / Command + Enter #5160

Merged
merged 4 commits into from
Nov 20, 2020

Conversation

czeidler
Copy link
Contributor

@czeidler czeidler commented Aug 30, 2020

Fixes element-hq/element-web#5006

When editing multi-line text this option helps to prevent accidentally
sending a message too early. With this option, Enter just inserts a new
line.

For example, composing programming code in a dev chat becomes much
easier when Enter just inserts a new line instead of sending the
message.

Signed-off-by: Clemens Zeidler clemens.zeidler@gmail.com

@t3chguy
Copy link
Member

t3chguy commented Aug 30, 2020

#1966 was a pull request which did this and was basically shut due to lack of product review.

Fixes element-hq/element-web#5006

Don't edit i18n files other than en_EN otherwise your PR will create a conflict in Weblate.

@t3chguy t3chguy requested a review from a team August 30, 2020 09:55
src/settings/Settings.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@nadonomy nadonomy left a comment

Choose a reason for hiding this comment

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

@czeidler can you post a screenshot of settings and/or link to an ad hoc build to aid review please? Thanks!

@czeidler
Copy link
Contributor Author

czeidler commented Sep 8, 2020

Here is a screenshot of the settings menu. Please also have a look at my previous question, i.e. can/should the label platform dependent?

Screenshot_20200908_202558

When editing multi-line text this option helps to prevent accidentally
sending a message too early. With this option, Enter just inserts a new
line.

For example, composing programming code in a dev chat becomes much
easier when Enter just inserts a new line instead of sending the
message.

Signed-off-by: Clemens Zeidler <clemens.zeidler@gmail.com>
@t3chguy
Copy link
Member

t3chguy commented Sep 9, 2020

Can you update the screenshot. Also please avoid force pushing once a review has already been made.

@t3chguy t3chguy self-requested a review September 9, 2020 08:41
@czeidler
Copy link
Contributor Author

czeidler commented Sep 9, 2020

Here is the updated screenshot:

Screenshot_20200909_205412

@t3chguy t3chguy requested a review from nadonomy October 6, 2020 08:44
@t3chguy t3chguy added the Z-Community-PR Issue is solved by a community member's PR label Oct 7, 2020
@Artiom-M

This comment has been minimized.

@jryans

This comment has been minimized.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

LGTM otherwise, just small styling nit

src/components/views/rooms/SendMessageComposer.js Outdated Show resolved Hide resolved
Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com>
@t3chguy
Copy link
Member

t3chguy commented Nov 20, 2020

Thanks!

@t3chguy t3chguy merged commit 5ee21d4 into matrix-org:develop Nov 20, 2020
@n-peugnet
Copy link

Will it be possible to set this setting to true for everyone in config.json on a self-hosted version of element ? Or should I search/open an issue for this ?

@t3chguy
Copy link
Member

t3chguy commented Nov 24, 2020

Yes. All setting defaults can be changed in the config. https://github.com/vector-im/element-web/blob/develop/docs/config.md

@n-peugnet
Copy link

Okay, I thought only the settings listed in UiFeatures could be set in settingDefaults.

So for my use case I can add :

"settingDefaults": {
    "MessageComposerInput.ctrlEnterToSend": true
}

in my config.json.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make it possible to configure 'enter' to insert line break rather than send message
6 participants