Make comments more compact in inbox (#4965)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-03-14 18:57:26 +04:00 committed by GitHub
parent b96b32a87a
commit 086c96a63c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View File

@ -38,6 +38,7 @@
export let attachmentImageSize: 'x-large' | undefined = undefined
export let showLinksPreview = true
export let videoPreload = true
export let compact = false
export let onClick: (() => void) | undefined = undefined
export let onReply: (() => void) | undefined = undefined
@ -70,6 +71,7 @@
attachmentImageSize,
showLinksPreview,
videoPreload,
compact,
onClick,
onReply
}}

View File

@ -15,7 +15,7 @@
<script lang="ts">
import activity, { ActivityReference } from '@hcengineering/activity'
import { createQuery, getClient } from '@hcengineering/presentation'
import { Action, Label } from '@hcengineering/ui'
import { Action, Label, ShowMore } from '@hcengineering/ui'
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
import { Account, Doc, Ref, getCurrentAccount } from '@hcengineering/core'
import { Person, type PersonAccount } from '@hcengineering/contact'
@ -42,6 +42,7 @@
export let excludedActions: string[] = []
export let hoverable = true
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
export let compact = false
export let onClick: (() => void) | undefined = undefined
export let onReply: (() => void) | undefined = undefined
@ -145,7 +146,9 @@
</span>
</svelte:fragment>
<svelte:fragment slot="content">
<ReferenceContent {value} />
<ShowMore limit={compact ? 80 : undefined}>
<ReferenceContent {value} />
</ShowMore>
</svelte:fragment>
</ActivityMessageTemplate>

View File

@ -49,6 +49,7 @@
export let attachmentImageSize: AttachmentImageSize = 'auto'
export let showLinksPreview = true
export let videoPreload = true
export let compact = false
export let onClick: (() => void) | undefined = undefined
export let onReply: (() => void) | undefined = undefined
@ -191,7 +192,7 @@
<svelte:fragment slot="content">
{#if !isEditing}
{#if withShowMore}
<ShowMore>
<ShowMore limit={compact ? 80 : undefined}>
<div class="clear-mins">
<MessageViewer message={value.message} />
<AttachmentDocList {value} {attachments} imageSize={attachmentImageSize} {videoPreload} />

View File

@ -142,6 +142,7 @@
hoverable={false}
{withFlatActions}
videoPreload={false}
compact
onReply={() => {
handleReply(displayMessage)
}}

View File

@ -26,7 +26,7 @@
import { IntlString, translate } from '@hcengineering/platform'
import { createQuery, getClient, MessageViewer } from '@hcengineering/presentation'
import notification, { CommonInboxNotification } from '@hcengineering/notification'
import { ActionIcon, IconMoreH, Label, showPopup } from '@hcengineering/ui'
import { ActionIcon, IconMoreH, Label, ShowMore, showPopup } from '@hcengineering/ui'
import { getDocLinkTitle, Menu } from '@hcengineering/view-resources'
import { ActivityDocLink } from '@hcengineering/activity-resources'
import view from '@hcengineering/view'
@ -139,7 +139,9 @@
<div class="flex-row-center">
<div class="customContent">
<MessageViewer message={content} />
<ShowMore limit={80}>
<MessageViewer message={content} />
</ShowMore>
</div>
</div>
</div>