From 23f31aac99b22898c87d3daead84d50355f20d25 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Tue, 2 Sep 2025 20:19:28 +0200 Subject: [PATCH] feat: implement duplicate message detection and display notification --- app/components/chat/CommandPalette.vue | 164 ++++++++++++----------- app/components/chat/MessageContainer.vue | 3 + app/components/tool/Duplicated.vue | 33 +++++ app/composables/chat.ts | 15 ++- app/pages/index.vue | 22 ++- app/stores/chat.ts | 22 +-- types/chat.ts | 1 + 7 files changed, 158 insertions(+), 102 deletions(-) create mode 100644 app/components/tool/Duplicated.vue diff --git a/app/components/chat/CommandPalette.vue b/app/components/chat/CommandPalette.vue index a385fda..fdc6485 100644 --- a/app/components/chat/CommandPalette.vue +++ b/app/components/chat/CommandPalette.vue @@ -9,9 +9,9 @@ const openClearModal = ref(false) const { t } = useI18n({ useScope: 'local' }) const { messages, submitMessage } = useChat(t) - const { clearMessages, messages: storeMessages } = useChatStore() const loading = computed(() => storeMessages.some(msg => msg.state === ChatState.LOADING)) + function handleDelete() { clearMessages() openClearModal.value = false @@ -22,6 +22,7 @@ function onSelect(item: CommandPaletteItem) { openMessageModal.value = false submitMessage(item.type, item.prompt, item.fetchStates ?? []) } + defineShortcuts({ meta_enter: () => { openMessageModal.value = !openMessageModal.value @@ -45,88 +46,91 @@ const commandPaletteUi = {