made submit-on-enter a user setting, only affects chats tho

This commit is contained in:
Henry Jameson 2026-07-30 17:24:08 +03:00
commit 6c92cbc1d1
5 changed files with 19 additions and 3 deletions

View file

@ -106,8 +106,8 @@
:disable-submit="isConversation ? !!replyStatus : (errorLoadingChat || !chat)" :disable-submit="isConversation ? !!replyStatus : (errorLoadingChat || !chat)"
:optimistic-posting="!isConversation" :optimistic-posting="!isConversation"
:submit-on-enter="!mobileLayout" chat-view
:preserve-focus="!mobileLayout" preserve-focus
:auto-focus="!mobileLayout" :auto-focus="!mobileLayout"
:placeholder="formPlaceholder" :placeholder="formPlaceholder"
:file-limit="isConversation ? null : 1" :file-limit="isConversation ? null : 1"

View file

@ -98,13 +98,13 @@ const PostStatusForm = {
draftId: String, // ID of the draft to be used draftId: String, // ID of the draft to be used
// Chats stuff // Chats stuff
chatView: Boolean, // Used for the "submit on enter" user setting
maxHeight: Number, maxHeight: Number,
placeholder: String, placeholder: String,
postHandler: Function, // Used to override poster to use chats one instead of status one postHandler: Function, // Used to override poster to use chats one instead of status one
preserveFocus: Boolean, // Keep focus on form after posting preserveFocus: Boolean, // Keep focus on form after posting
autoFocus: Boolean, // Steal focus when form is opened autoFocus: Boolean, // Steal focus when form is opened
fileLimit: Number, // Chats only support 1 attachment :( fileLimit: Number, // Chats only support 1 attachment :(
submitOnEnter: Boolean,
emojiPickerPlacement: String, emojiPickerPlacement: String,
optimisticPosting: Boolean, // Don't wait for confirmation that post is done optimisticPosting: Boolean, // Don't wait for confirmation that post is done
@ -562,6 +562,9 @@ const PostStatusForm = {
useMergedConfigStore().mergedConfig.hideScopeNotice useMergedConfigStore().mergedConfig.hideScopeNotice
) )
}, },
submitOnEnter() {
return this.chatView && this.mergedConfig.chatSubmitOnEnter
},
// Global stuff // Global stuff
currentUser() { currentUser() {

View file

@ -83,6 +83,13 @@
{{ $t('settings.subject_line_behavior') }} {{ $t('settings.subject_line_behavior') }}
</ChoiceSetting> </ChoiceSetting>
</li> </li>
<li>
<BooleanSetting
path="chatSubmitOnEnter"
>
{{ $t('settings.submit_on_enter_in_chats') }}
</BooleanSetting>
</li>
</ul> </ul>
<h3 v-if="expertLevel > 0"> <h3 v-if="expertLevel > 0">
{{ $t('settings.attachments') }} {{ $t('settings.attachments') }}

View file

@ -780,6 +780,7 @@
"subject_line_email": "Like email: \"re: subject\"", "subject_line_email": "Like email: \"re: subject\"",
"subject_line_mastodon": "Like mastodon: copy as is", "subject_line_mastodon": "Like mastodon: copy as is",
"subject_line_noop": "Do not copy", "subject_line_noop": "Do not copy",
"submit_on_enter_in_chats": "Send message on Enter in chats",
"force_theme_recompilation_debug": "Disable theme cahe, force recompile on each boot", "force_theme_recompilation_debug": "Disable theme cahe, force recompile on each boot",
"conversation_display": "Conversation display style", "conversation_display": "Conversation display style",
"conversation_display_tree": "Tree-style", "conversation_display_tree": "Tree-style",

View file

@ -673,6 +673,11 @@ export const LOCAL_DEFAULT_CONFIG_DEFINITIONS = {
type: 'string', type: 'string',
default: null, default: null,
}, },
chatSubmitOnEnter: {
description: 'Post status on enter key in chats and chat view',
type: 'boolean',
default: false,
},
themeDebug: { themeDebug: {
description: description:
'Debug mode that uses computed backgrounds instead of real ones to debug contrast functions', 'Debug mode that uses computed backgrounds instead of real ones to debug contrast functions',