From 020251c7061f8d9fb04fabbc16c2d61bd2249ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B3=E5=85=83=E7=9A=93?= Date: Fri, 16 May 2025 23:39:15 +0800 Subject: [PATCH] Fix the code of conduct file name & Update the UI of the ChatBot, it is still a work in progress tho --- CODE_OF_CONDUCT.md.md => CODE_OF_CONDUCT.md | 0 components/app/windows/chatbot.vue | 67 ++++++++++++++++----- 2 files changed, 51 insertions(+), 16 deletions(-) rename CODE_OF_CONDUCT.md.md => CODE_OF_CONDUCT.md (100%) diff --git a/CODE_OF_CONDUCT.md.md b/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md.md rename to CODE_OF_CONDUCT.md diff --git a/components/app/windows/chatbot.vue b/components/app/windows/chatbot.vue index fc1f1e0..dbe4936 100644 --- a/components/app/windows/chatbot.vue +++ b/components/app/windows/chatbot.vue @@ -6,7 +6,14 @@ interface chatInterface { user: boolean; } -import { History, Plus, Send } from "lucide-vue-next"; +import { + History, + Plus, + Send, + Square, + User, + BotMessageSquare, +} from "lucide-vue-next"; import { Input } from "~/components/ui/input"; import { v4 as uuidv4 } from "uuid"; const { t } = useI18n(); @@ -16,6 +23,7 @@ const chatId = ref(); const inputMessage = ref(); const messages = ref([]); const messageIndex = ref(); +const aiGenerating = ref(false); // Great, there are now no errors ig const emit = defineEmits(["windowopener", "error", "loadValue"]); const props = defineProps<{ @@ -24,6 +32,7 @@ const props = defineProps<{ const sendChatData = (event?: KeyboardEvent) => { if (event?.shiftKey) return; + if (inputMessage.value === "") return; const userMessage = inputMessage.value; inputMessage.value = ""; messages.value.push({ @@ -32,6 +41,10 @@ const sendChatData = (event?: KeyboardEvent) => { message: userMessage, user: true, }); + aiGenerating.value = true; + setTimeout(() => { + aiGenerating.value = false; + }, 3000); }; onMounted(async () => { @@ -79,26 +92,48 @@ onMounted(async () => {
-
- {{ message.message }} +
+
+ {{ message.message }} +
+
+ {{ message.message }} +
- - + +
+ Note: AI might create imbalanced views. - -