diff --git a/src/api/user.js b/src/api/user.js index 70929b162..17e13195d 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -207,7 +207,7 @@ export const postStatus = ({ idempotencyKey, }) => { const form = new FormData() - const pollOptions = poll?.options || [] + const pollOptions = poll.options || [] form.append('status', status) form.append('source', 'Pleroma FE') diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js index a71014078..580cb183f 100644 --- a/src/components/chat_message/chat_message.js +++ b/src/components/chat_message/chat_message.js @@ -1,8 +1,8 @@ +import { find } from 'lodash' import { mapState as mapPiniaState } from 'pinia' import { mapState } from 'vuex' import Attachment from 'src/components/attachment/attachment.vue' -import MentionLink from 'src/components/mention_link/mention_link.vue' import ChatMessageDate from 'src/components/chat_message_date/chat_message_date.vue' import Gallery from 'src/components/gallery/gallery.vue' import LinkPreview from 'src/components/link-preview/link-preview.vue' @@ -10,7 +10,6 @@ import Popover from 'src/components/popover/popover.vue' import StatusActionButtons from 'src/components/status_action_buttons/status_action_buttons.vue' import StatusBody from 'src/components/status_body/status_body.vue' import StatusContent from 'src/components/status_content/status_content.vue' -import StatusPopover from 'src/components/status_popover/status_popover.vue' import UserAvatar from 'src/components/user_avatar/user_avatar.vue' import UserPopover from 'src/components/user_popover/user_popover.vue' @@ -23,10 +22,9 @@ import { faCircleNotch, faEllipsisH, faTimes, - faReply, } from '@fortawesome/free-solid-svg-icons' -library.add(faTimes, faEllipsisH, faCircleNotch, faReply) +library.add(faTimes, faEllipsisH, faCircleNotch) const ChatMessage = { name: 'ChatMessage', @@ -37,8 +35,6 @@ const ChatMessage = { 'chatItem', 'previousItem', 'hoveredMessageChain', - 'focused', - 'repliedTo', ], emits: ['hover', 'replyRequested'], components: { @@ -52,8 +48,6 @@ const ChatMessage = { LinkPreview, ChatMessageDate, UserPopover, - StatusPopover, - MentionLink, }, computed: { // Returns HH:MM (hours and minutes) in local time. @@ -95,25 +89,6 @@ const ChatMessage = { this.chatItem.data.in_reply_to_status_id ] }, - replyToName() { - if (this.message.in_reply_to_screen_name) { - return this.message.in_reply_to_screen_name - } else { - const user = this.$store.getters.findUser( - this.status.in_reply_to_user_id, - ) - return user && user.screen_name_ui - } - }, - replyProfileLink() { - if (this.isCustomReply) { - const user = this.$store.getters.findUser( - this.message.in_reply_to_user_id, - ) - // FIXME Why user not found sometimes??? - return user ? user.statusnet_profile_url : 'NOT_FOUND' - } - }, messageForStatusContent() { return { summary: '', @@ -126,14 +101,6 @@ const ChatMessage = { hasAttachment() { return this.message.attachments.length > 0 }, - classnames() { - return { - '-outgoing': this.isCurrentUser, - '-incoming': !this.isCurrentUser, - '-pending': this.message.pending, - '-focused': this.focused, - } - }, ...mapPiniaState(useInterfaceStore, { betterShadow: (store) => store.browserSupport.cssFilter, }), diff --git a/src/components/chat_message/chat_message.scss b/src/components/chat_message/chat_message.scss index 0d5db41b2..34382c42d 100644 --- a/src/components/chat_message/chat_message.scss +++ b/src/components/chat_message/chat_message.scss @@ -17,7 +17,7 @@ position: absolute; top: -0.8em; right: 0.4rem; - z-index: 1; + z-index: 10; .quick-action-buttons { justify-items: end; @@ -39,16 +39,23 @@ } .reply-to-header { - display: flex; - gap: 0.5rem; - align-items: center; - padding: 0.125em 0; + white-space: nowrap; width: 100%; - } + display: flex; + align-items: baseline; + gap: 0.5em; - .avatar-spacer { - flex: 0 0 2.2rem; - width: 2.2rem; + .reply-label { + display: inline-block; + line-height: 1; + } + + .reply-body { + line-height: 1; + display: inline-block; + overflow-x: hidden; + text-overflow: ellipsis; + } } .popover { @@ -66,7 +73,8 @@ } .avatar-wrapper { - margin-right: 0.5em; + margin-right: 0.72em; + width: 32px; } .link-preview, @@ -116,70 +124,27 @@ } } - .message-bubble-wrapper { - display: flex; - } - .chat-message-inner { display: flex; flex-direction: column; align-items: flex-start; + max-width: 80%; + min-width: 10em; + width: 100%; } - .reply-indicator { + .-outgoing { display: flex; - place-items: center; - place-content: center; - padding: 0.25em; - margin: var(--roundness) 0; - background: var(--border); - border-radius: var(--roundness); - border: 1px solid var(--border); - } + flex-flow: row wrap; + place-content: end flex-end; - .end-spacer { - flex: 1 1 0; - min-width: calc(2.2em + 0.5em + 2em); - } - - &.-incoming { - .reply-indicator { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - } - - .reply-to-popover { - white-space: nowrap; - } - - .reply-label { - white-space: nowrap; - } - - &.-outgoing { - &, - .message-bubble-wrapper, - .chat-message{ - flex-direction: row-reverse; + .chat-message-inner { + align-items: flex-end; } .reply-to-header { justify-content: end; } - - .reply-indicator { - border-bottom-right-radius: 0; - border-top-right-radius: 0; - - .icon { - transform: scaleX(-1); - } - } - - .chat-message-inner { - align-items: flex-end; - } } .chat-message-inner.with-media { diff --git a/src/components/chat_message/chat_message.style.js b/src/components/chat_message/chat_message.style.js index 67f0ae6c1..f7632bc6f 100644 --- a/src/components/chat_message/chat_message.style.js +++ b/src/components/chat_message/chat_message.style.js @@ -4,9 +4,6 @@ export default { variants: { outgoing: '.outgoing', }, - states: { - focused: '.-focused', - }, validInnerComponents: ['Text', 'Icon', 'Border', 'PollGraph'], defaultRules: [ { @@ -21,11 +18,5 @@ export default { background: '--bg, 5', }, }, - { - state: ['focused'], - directives: { - background: '--inheritedBackground, 10', - }, - }, ], } diff --git a/src/components/chat_message/chat_message.vue b/src/components/chat_message/chat_message.vue index 234d20cb2..91ad9a4eb 100644 --- a/src/components/chat_message/chat_message.vue +++ b/src/components/chat_message/chat_message.vue @@ -2,64 +2,13 @@
- - - -
-
-
+ + + + {{ $t('status.reply_to') }} + + + + +
-
- -
+
+ - -