chore: Minor fix
This commit is contained in:
+1
-17
@@ -1,13 +1,5 @@
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
inject,
|
||||
nextTick,
|
||||
useSlots,
|
||||
watch,
|
||||
useAttrs,
|
||||
} from 'vue';
|
||||
import { ref, computed, nextTick, useSlots, watch, useAttrs } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useThrottleFn } from '@vueuse/core';
|
||||
import { useMapGetter } from 'dashboard/composables/store';
|
||||
@@ -90,14 +82,6 @@ const throttledCalculate = useThrottleFn(computeVisibleLabelPosition, 16);
|
||||
|
||||
watch(activeLabels, () => nextTick(throttledCalculate), { immediate: true });
|
||||
|
||||
// Recalculate when parent triggers (e.g., tab changes in ChatList)
|
||||
// Needed because inbox conversation view shows metadata inside CardLabels, affecting available width
|
||||
const recalculateKey = inject('recalculateLabelsKey', null);
|
||||
|
||||
if (recalculateKey) {
|
||||
watch(recalculateKey, () => nextTick(throttledCalculate));
|
||||
}
|
||||
|
||||
const hiddenLabelsCount = computed(() => {
|
||||
if (!showExpandLabelButton.value || showAllLabels.value) return 0;
|
||||
return activeLabels.value.length - labelPosition.value - 1;
|
||||
|
||||
+9
-3
@@ -22,6 +22,7 @@ const props = defineProps({
|
||||
showInboxName: { type: Boolean, default: false },
|
||||
hideThumbnail: { type: Boolean, default: false },
|
||||
enableSelection: { type: Boolean, default: true },
|
||||
isInboxView: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const emit = defineEmits(['selectConversation', 'click', 'contextmenu']);
|
||||
@@ -48,7 +49,7 @@ const showLabelsSection = computed(
|
||||
|
||||
const showMetaSection = computed(
|
||||
() =>
|
||||
props.showInboxName ||
|
||||
(!props.isInboxView && props.showInboxName) ||
|
||||
(props.showAssignee && props.assignee?.name) ||
|
||||
props.chat.priority
|
||||
);
|
||||
@@ -93,11 +94,16 @@ const onSelectConversation = checked => {
|
||||
'mx-2': compact,
|
||||
}"
|
||||
>
|
||||
<InboxName v-if="showInboxName" :inbox="inbox" class="flex-1 min-w-0" />
|
||||
<InboxName
|
||||
v-if="showInboxName && !isInboxView"
|
||||
:inbox="inbox"
|
||||
class="flex-1 min-w-0"
|
||||
/>
|
||||
<div
|
||||
v-if="showAssignee || chat.priority"
|
||||
class="flex items-center gap-2 flex-shrink-0 h-4"
|
||||
:class="{
|
||||
'flex-1 justify-between': !showInboxName,
|
||||
'flex-1 justify-between': isInboxView || !showInboxName,
|
||||
}"
|
||||
>
|
||||
<span
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ const selectedModel = computed({
|
||||
<InboxName v-if="showInboxName" :inbox="inbox" class="min-w-0" />
|
||||
</div>
|
||||
|
||||
<div class="w-px h-3 bg-n-slate-6 flex-shrink-0" />
|
||||
<div v-if="!isInboxView" class="w-px h-3 bg-n-slate-6 flex-shrink-0" />
|
||||
|
||||
<div
|
||||
v-tooltip.top="{
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ const props = defineProps({
|
||||
compact: { type: Boolean, default: false },
|
||||
enableContextMenu: { type: Boolean, default: false },
|
||||
allowedContextMenuOptions: { type: Array, default: () => [] },
|
||||
// eslint-disable-next-line vue/no-unused-properties
|
||||
enableSelection: { type: Boolean, default: true },
|
||||
isExpandedLayout: { type: Boolean, default: false },
|
||||
isPreviousConversations: { type: Boolean, default: false },
|
||||
@@ -196,7 +195,7 @@ const deleteConversation = () => {
|
||||
@contextmenu="openContextMenu"
|
||||
/>
|
||||
|
||||
<!-- Compact: All other cases (mobile OR isExpandedLayout=false) - Using older ConversationCard -->
|
||||
<!-- Compact: All other cases (mobile OR isExpandedLayout=false) -->
|
||||
<ConversationCardCompact
|
||||
v-else
|
||||
:chat="chat"
|
||||
|
||||
@@ -52,10 +52,6 @@ const chatsOnView = ref([]);
|
||||
const isContextMenuOpen = ref(false);
|
||||
const chatListFiltersRef = ref(null);
|
||||
|
||||
// Provide trigger for label recalculation (parent → child pattern)
|
||||
const recalculateLabelsKey = ref(0);
|
||||
provide('recalculateLabelsKey', recalculateLabelsKey);
|
||||
|
||||
const currentUser = useMapGetter('getCurrentUser');
|
||||
const chatLists = useMapGetter('getFilteredConversations');
|
||||
const mineChatsList = useMapGetter('getMineChats');
|
||||
@@ -375,8 +371,6 @@ function updateAssigneeTab(selectedTab) {
|
||||
if (!currentPage.value) {
|
||||
fetchConversations();
|
||||
}
|
||||
// Trigger label position recalculation
|
||||
recalculateLabelsKey.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ const containerRef = useTemplateRef('containerRef');
|
||||
const [showDropdown, toggleDropdown] = useToggle(false);
|
||||
const selectedAgent = ref(null);
|
||||
|
||||
const assignableAgentsUiFlags = computed(
|
||||
() => store.getters['inboxAssignableAgents/getUIFlags']
|
||||
const assignableAgentsUiFlags = useMapGetter(
|
||||
'inboxAssignableAgents/getUIFlags'
|
||||
);
|
||||
|
||||
const isLoading = computed(() => assignableAgentsUiFlags.value.isFetching);
|
||||
|
||||
Reference in New Issue
Block a user