Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/components/LeftSidebar/ConversationsList/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
</NcActionButton>
</template>
<template v-else-if="submenu === 'notifications'">
<NcActionButton :aria-label="t('spreed', 'Back')"
<NcActionButton
key="action-back"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this refresh good enough even when its reused inside a parent that has a different key? Just asking for my understanding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if parent has a different key, it should re-render parent and everything underneath

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this refresh good enough even when its reused inside a parent that has a different key? Just asking for my understanding

Key doesn't trigger re-rendring, but re-order/re-mount.

And Vue doesn't support parent remounting without children remounting.

So changing the parent key completely destroys and re-creates children. Not just re-render.

:aria-label="t('spreed', 'Back')"
@click.stop="submenu = null">
<template #icon>
<IconArrowLeft class="bidirectional-icon" :size="16" />
Expand All @@ -154,7 +156,9 @@
<template v-if="showCallNotificationSettings">
<NcActionSeparator />

<NcActionButton type="checkbox"
<NcActionButton
key="notification-calls"
type="checkbox"
:model-value="notificationCalls"
@click="setNotificationCalls(!notificationCalls)">
<template #icon>
Expand All @@ -167,7 +171,9 @@
<template v-if="supportImportantConversations || supportSensitiveConversations">
<NcActionSeparator />

<NcActionButton v-if="supportImportantConversations"
<NcActionButton
v-if="supportImportantConversations"
key="toggle-important"
type="checkbox"
:description="labelImportantHint"
:model-value="item.isImportant"
Expand All @@ -177,7 +183,9 @@
</template>
{{ t('spreed', 'Important conversation') }}
</NcActionButton>
<NcActionButton v-if="supportSensitiveConversations"
<NcActionButton
v-if="supportSensitiveConversations"
key="toggle-sensitive"
type="checkbox"
:description="t('spreed', 'Hide message text')"
:model-value="item.isSensitive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,29 @@
</NcActionText>
<NcActionSeparator />

<NcActionButton v-if="supportReminders"
<NcActionButton
v-if="supportReminders"
key="set-reminder-menu"
is-menu
@click.stop="submenu = 'reminder'">
<template #icon>
<AlarmIcon :size="20" />
</template>
{{ t('spreed', 'Set reminder') }}
</NcActionButton>
<NcActionButton v-if="isPrivateReplyable"
<NcActionButton
v-if="isPrivateReplyable"
key="reply-privately"
close-after-click
@click.stop="handlePrivateReply">
<template #icon>
<AccountIcon :size="20" />
</template>
{{ t('spreed', 'Reply privately') }}
</NcActionButton>
<NcActionButton v-if="isEditable"
<NcActionButton
v-if="isEditable"
key="edit-message"
:aria-label="t('spreed', 'Edit message')"
close-after-click
@click.stop="editMessage">
Expand All @@ -91,22 +97,28 @@
</template>
{{ t('spreed', 'Edit message') }}
</NcActionButton>
<NcActionButton v-if="!isFileShareWithoutCaption"
<NcActionButton
v-if="!isFileShareWithoutCaption"
key="copy-message"
close-after-click
@click.stop="handleCopyMessageText">
<template #icon>
<ContentCopy :size="20" />
</template>
{{ t('spreed', 'Copy message') }}
</NcActionButton>
<NcActionButton close-after-click
<NcActionButton
key="copy-message-link"
close-after-click
@click.stop="handleCopyMessageLink">
<template #icon>
<OpenInNewIcon :size="20" />
</template>
{{ t('spreed', 'Copy message link') }}
</NcActionButton>
<NcActionButton close-after-click
<NcActionButton
key="mark-as-unread"
close-after-click
@click.stop="handleMarkAsUnread">
<template #icon>
<EyeOffOutline :size="16" />
Expand All @@ -128,15 +140,19 @@
{{ t('spreed', 'Download file') }}
</NcActionLink>
</template>
<NcActionButton v-if="canForwardMessage && !isInNoteToSelf"
<NcActionButton
v-if="canForwardMessage && !isInNoteToSelf"
key="forward-to-note"
close-after-click
@click="forwardToNote">
<template #icon>
<Note :size="16" />
</template>
{{ t('spreed', 'Note to self') }}
</NcActionButton>
<NcActionButton v-if="canForwardMessage"
<NcActionButton
v-if="canForwardMessage"
key="forward-message"
close-after-click
@click.stop="openForwarder">
<template #icon>
Expand All @@ -145,14 +161,17 @@
{{ t('spreed', 'Forward message') }}
</NcActionButton>
<NcActionSeparator v-if="messageActions.length > 0" />
<NcActionButton v-for="action in messageActions"
<NcActionButton
v-for="action in messageActions"
:key="action.label"
:icon="action.icon"
close-after-click
@click="handleMessageAction(action)">
{{ action.label }}
</NcActionButton>
<NcActionButton v-if="isTranslationAvailable && !isFileShareWithoutCaption"
<NcActionButton
v-if="isTranslationAvailable && !isFileShareWithoutCaption"
key="translate-message"
close-after-click
@click.stop="$emit('showTranslateDialog', true)"
@close="$emit('showTranslateDialog', false)">
Expand All @@ -163,7 +182,9 @@
</NcActionButton>
<template v-if="isDeleteable">
<NcActionSeparator />
<NcActionButton close-after-click
<NcActionButton
key="delete-message"
close-after-click
@click.stop="handleDelete">
<template #icon>
<DeleteIcon :size="16" />
Expand All @@ -174,15 +195,19 @@
</template>

<template v-else-if="supportReminders && submenu === 'reminder'">
<NcActionButton :aria-label="t('spreed', 'Back')"
<NcActionButton
key="action-back"
:aria-label="t('spreed', 'Back')"
@click.stop="submenu = null">
<template #icon>
<IconArrowLeft class="bidirectional-icon" />
</template>
{{ t('spreed', 'Back') }}
</NcActionButton>

<NcActionButton v-if="currentReminder"
<NcActionButton
v-if="currentReminder"
key="remove-reminder"
close-after-click
@click.stop="removeReminder">
<template #icon>
Expand All @@ -193,7 +218,8 @@

<NcActionSeparator />

<NcActionButton v-for="option in reminderOptions"
<NcActionButton
v-for="option in reminderOptions"
:key="option.key"
:aria-label="option.ariaLabel"
close-after-click
Expand All @@ -213,7 +239,9 @@
</template>
</NcActionInput>

<NcActionButton :aria-label="t('spreed', 'Set custom reminder')"
<NcActionButton
key="set-reminder"
:aria-label="t('spreed', 'Set custom reminder')"
close-after-click
@click.stop="setReminder(customReminderTimestamp)">
<template #icon>
Expand Down
Loading