Skip to content

Commit b3df6df

Browse files
Merge pull request #19103 from nextcloud/backport/19099/stable34
[stable34] fix(tags): drop total unread counter
2 parents 17a787c + 09eba06 commit b3df6df

2 files changed

Lines changed: 2 additions & 54 deletions

File tree

src/components/LeftSidebar/ConversationsList/ConversationTagHeader.vue

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { useStore } from 'vuex'
1313
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
1414
import NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'
1515
import NcAppNavigationItem from '@nextcloud/vue/components/NcAppNavigationItem'
16-
import NcCounterBubble from '@nextcloud/vue/components/NcCounterBubble'
1716
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
1817
import IconArrowDown from 'vue-material-design-icons/ArrowDown.vue'
1918
import IconArrowUp from 'vue-material-design-icons/ArrowUp.vue'
@@ -26,8 +25,6 @@ import { useConversationTagsStore } from '../../../stores/conversationTags.ts'
2625
export type TagHeaderItem = ConversationTag & {
2726
_type: 'tag-header'
2827
unreadCount: number
29-
unreadMention: boolean
30-
unreadMentionDirect: boolean
3128
isFirst?: boolean
3229
isLast?: boolean
3330
}
@@ -40,15 +37,6 @@ const vuexStore = useStore()
4037
const tagsStore = useConversationTagsStore()
4138
4239
const isCustomTag = computed(() => props.item.type === 'custom')
43-
const counterType = computed(() => {
44-
if (props.item.unreadMentionDirect) {
45-
return 'highlighted'
46-
} else if (props.item.unreadMention) {
47-
return 'outlined'
48-
} else {
49-
return ''
50-
}
51-
})
5240
5341
/**
5442
* Assign a new name to the tag via dialog
@@ -139,9 +127,6 @@ async function handleMarkReadTag() {
139127
@update:open="tagsStore.toggleCollapsed(item.id)">
140128
<!-- Invisible child to trigger the collapse chevron -->
141129
<li class="tag-header__spacer" />
142-
<template #counter>
143-
<NcCounterBubble v-if="item.unreadCount > 0" :count="item.unreadCount" :type="counterType" />
144-
</template>
145130
<template #actions>
146131
<NcActionButton
147132
v-if="item.unreadCount > 0"

src/components/LeftSidebar/ConversationsList/ConversationsListVirtual.vue

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { computed, watch } from 'vue'
1212
import LoadingPlaceholder from '../../UIShared/LoadingPlaceholder.vue'
1313
import ConversationItem from './ConversationItem.vue'
1414
import ConversationTagHeader from './ConversationTagHeader.vue'
15-
import { AVATAR, CONVERSATION } from '../../../constants.ts'
15+
import { AVATAR } from '../../../constants.ts'
1616
import { useConversationTagsStore } from '../../../stores/conversationTags.ts'
1717
import { hasCall, hasUnreadMentions, hasUnreadMessages } from '../../../utils/conversation.ts'
1818
@@ -56,34 +56,21 @@ const listItems = computed<VirtualListItem[]>(() => {
5656
hasTagged: boolean
5757
favorites: Conversation[]
5858
favoritesUnreadCount: number
59-
favoritesUnreadMention: boolean
60-
favoritesUnreadMentionDirect: boolean
6159
tagged: Record<string, Conversation[]>
6260
taggedUnreadCount: Record<string, number>
63-
taggedUnreadMention: Record<string, boolean>
64-
taggedUnreadMentionDirect: Record<string, boolean>
6561
other: Conversation[]
6662
otherUnreadCount: number
67-
otherUnreadMention: boolean
68-
otherUnreadMentionDirect: boolean
6963
}>((acc, conversation) => {
70-
// Count amount of unread conversations, highlight if any has a direct or group mention
64+
// Count amount of unread conversations
7165
const unreadCount = conversation.unreadMessages ? 1 : 0
72-
const unreadMention = conversation.unreadMention
73-
const unreadMentionDirect = conversation.unreadMentionDirect
74-
|| (!!unreadCount && [CONVERSATION.TYPE.ONE_TO_ONE, CONVERSATION.TYPE.ONE_TO_ONE_FORMER].includes(conversation.type))
7566
const isTagged = !!conversation.tagIds?.length
7667
7768
if (conversation.isFavorite) {
7869
acc.favorites.push(conversation)
7970
acc.favoritesUnreadCount += unreadCount
80-
acc.favoritesUnreadMention ||= unreadMention
81-
acc.favoritesUnreadMentionDirect ||= unreadMentionDirect
8271
} else if (!isTagged) {
8372
acc.other.push(conversation)
8473
acc.otherUnreadCount += unreadCount
85-
acc.otherUnreadMention ||= unreadMention
86-
acc.otherUnreadMentionDirect ||= unreadMentionDirect
8774
}
8875
8976
if (isTagged) {
@@ -96,24 +83,16 @@ const listItems = computed<VirtualListItem[]>(() => {
9683
acc.tagged[tagId] ??= []
9784
acc.tagged[tagId].push(conversation)
9885
acc.taggedUnreadCount[tagId] = (acc.taggedUnreadCount[tagId] || 0) + unreadCount
99-
acc.taggedUnreadMention[tagId] = acc.taggedUnreadMention[tagId] || unreadMention
100-
acc.taggedUnreadMentionDirect[tagId] = acc.taggedUnreadMentionDirect[tagId] || unreadMentionDirect
10186
}
10287
return acc
10388
}, {
10489
hasTagged: false,
10590
favorites: [],
10691
favoritesUnreadCount: 0,
107-
favoritesUnreadMention: false,
108-
favoritesUnreadMentionDirect: false,
10992
tagged: {},
11093
taggedUnreadCount: {},
111-
taggedUnreadMention: {},
112-
taggedUnreadMentionDirect: {},
11394
other: [],
11495
otherUnreadCount: 0,
115-
otherUnreadMention: false,
116-
otherUnreadMentionDirect: false,
11796
})
11897
11998
if (!groupedConversations.hasTagged) {
@@ -124,8 +103,6 @@ const listItems = computed<VirtualListItem[]>(() => {
124103
tag: ConversationTag
125104
conversations: Conversation[]
126105
unreadCount: number
127-
unreadMention: boolean
128-
unreadMentionDirect: boolean
129106
}>>((acc, tag) => {
130107
const conversations = tag.type === 'favorites'
131108
? groupedConversations.favorites
@@ -142,23 +119,11 @@ const listItems = computed<VirtualListItem[]>(() => {
142119
: tag.type === 'other'
143120
? groupedConversations.otherUnreadCount
144121
: (groupedConversations.taggedUnreadCount[tag.id] ?? 0)
145-
const unreadMention = tag.type === 'favorites'
146-
? groupedConversations.favoritesUnreadMention
147-
: tag.type === 'other'
148-
? groupedConversations.otherUnreadMention
149-
: (groupedConversations.taggedUnreadMention[tag.id] ?? false)
150-
const unreadMentionDirect = tag.type === 'favorites'
151-
? groupedConversations.favoritesUnreadMentionDirect
152-
: tag.type === 'other'
153-
? groupedConversations.otherUnreadMentionDirect
154-
: (groupedConversations.taggedUnreadMentionDirect[tag.id] ?? false)
155122
156123
acc.push({
157124
tag,
158125
conversations,
159126
unreadCount,
160-
unreadMention,
161-
unreadMentionDirect,
162127
})
163128
return acc
164129
}, [])
@@ -168,8 +133,6 @@ const listItems = computed<VirtualListItem[]>(() => {
168133
...section.tag,
169134
_type: 'tag-header',
170135
unreadCount: section.unreadCount,
171-
unreadMention: section.unreadMention,
172-
unreadMentionDirect: section.unreadMentionDirect,
173136
isFirst: index === 0,
174137
isLast: index === renderedSections.length - 1,
175138
}

0 commit comments

Comments
 (0)