Merge branch 'chat-refactor' into shigusegubu-themes3

This commit is contained in:
Henry Jameson 2026-07-30 17:29:34 +03:00
commit 9f15f4fa42
13 changed files with 51 additions and 11 deletions

View file

@ -186,7 +186,7 @@ export default {
return useShoutStore().joined
},
isChats() {
return this.$route.name === 'chat' || this.$route.name === 'chats'
return this.$route.name === 'chat' || this.$route.name === 'chats' || this.$route.name === 'conversation2'
},
isListEdit() {
return this.$route.name === 'lists-edit'
@ -205,7 +205,7 @@ export default {
)
},
hideShoutbox() {
return useMergedConfigStore().mergedConfig.hideShoutbox
return this.isChats || useMergedConfigStore().mergedConfig.hideShoutbox
},
reverseLayout() {
const { thirdColumnMode, sidebarRight: reverseSetting } =

View file

@ -60,7 +60,7 @@ const ChatListItem = {
name: 'chat',
params: {
username: this.currentUser.screen_name,
recipient_id: this.chat.account.id,
chatUserId: this.chat.account.id,
},
})
}

View file

@ -12,7 +12,7 @@
}
.attachments {
min-width: 30em;
min-width: 10em;
}
.quoted-post {

View file

@ -108,6 +108,7 @@
fixed-pinned
use-default-buttons
hide-labels
in-chat-view
@toggle-replying="$emit('replyRequested', message)"
/>
<div

View file

@ -1,7 +1,5 @@
.chat-view {
display: flex;
margin-bottom: -1em;
margin-top: -1em;
.chat-list-wrapper {
display: flex;

View file

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

View file

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

View file

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

View file

@ -18,6 +18,7 @@ import {
faChevronDown,
faChevronRight,
faComments,
faList,
faExternalLinkAlt,
faEye,
faEyeSlash,
@ -58,6 +59,7 @@ library.add(
faPencil,
faShareAlt,
faComments,
faList,
faExternalLinkAlt,
faHistory,
)

View file

@ -222,13 +222,30 @@ export const BUTTONS = [
// =========
// OPEN IN CHAT VIEW
// =========
name: 'edit',
name: 'chat_view',
icon: 'comments',
label: 'status.open_in_chat_view',
if({ chatView }) {
return !chatView
},
action({ router, status }) {
router.push({ name: 'conversation2', params: { statusId: status.id } })
},
},
{
// =========
// OPEN IN THREAD VIEW
// =========
name: 'thread_view',
icon: 'list',
label: 'status.open_in_thread_view',
if({ chatView }) {
return chatView
},
action({ router, status }) {
router.push({ name: 'conversation', params: { id: status.id } })
},
},
{
// =========
// DELETE

View file

@ -39,6 +39,10 @@ const StatusActionButtons = {
type: Boolean,
default: false,
},
inChatView: {
type: Boolean,
default: false,
},
},
emits: ['toggleReplying', 'onSuccess', 'onError'],
data() {
@ -98,6 +102,7 @@ const StatusActionButtons = {
router: this.$router,
currentUser: this.currentUser,
loggedIn: !!this.currentUser,
chatView: !!this.inChatView,
}
},
triggerAttrs() {

View file

@ -780,6 +780,7 @@
"subject_line_email": "Like email: \"re: subject\"",
"subject_line_mastodon": "Like mastodon: copy as is",
"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",
"conversation_display": "Conversation display style",
"conversation_display_tree": "Tree-style",
@ -1648,6 +1649,7 @@
"edit": "Edit status",
"edited_at": "(last edited {time})",
"open_in_chat_view": "Open in chat view",
"open_in_thread_view": "Open in thread view",
"pin": "Pin on profile",
"unpin": "Unpin from profile",
"pinned": "Pinned",

View file

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