diff --git a/src/components/Main/MainView/MessageElement/MessageQuoteListItem.vue b/src/components/Main/MainView/MessageElement/MessageQuoteListItem.vue index 92f1e5c81..d12e904a3 100644 --- a/src/components/Main/MainView/MessageElement/MessageQuoteListItem.vue +++ b/src/components/Main/MainView/MessageElement/MessageQuoteListItem.vue @@ -11,7 +11,25 @@ :user-id="message.userId" />
- +
+ +
+
@@ -24,12 +42,16 @@ import UserIcon from '/@/components/UI/UserIcon.vue' import MessageQuoteListItemHeader from './MessageQuoteListItemHeader.vue' import MessageQuoteListItemFooter from './MessageQuoteListItemFooter.vue' -import { computed } from 'vue' +import { computed, ref } from 'vue' import type { MessageId, ChannelId, DMChannelId } from '/@/types/entity-ids' import { useMessagesView } from '/@/store/domain/messagesView' import { useMessagesStore } from '/@/store/entities/messages' import { useChannelsStore } from '/@/store/entities/channels' import MarkdownContent from '/@/components/UI/MarkdownContent.vue' +import useToggle from '/@/composables/utils/useToggle' +import FoldButton from '/@/components/UI/FoldButton.vue' +import { randomString } from '/@/lib/basic/randomString' +import useBoxSize from '/@/composables/dom/useBoxSize' const props = defineProps<{ parentMessageChannelId: ChannelId | DMChannelId @@ -52,6 +74,17 @@ const shouldShow = computed( const content = computed( () => renderedContentMap.value.get(props.messageId) ?? '' ) + +const MAX_HEIGHT = 200 + +const contentRef = ref(null) +const { height } = useBoxSize(contentRef) +const oversized = computed( + () => height.value !== undefined && height.value >= MAX_HEIGHT +) + +const markdownId = randomString() +const { value: isFold, toggle: toggleFold } = useToggle(true)