Update dependencies and enhance ChatInput component functionality. Upgraded Vite to version 8.0.1, updated various package versions in package-lock.json, and improved user experience in ChatInput.vue by adding dynamic placeholder text and error handling for message sending without an active conversation.

This commit is contained in:
Torsten Schulz (local)
2026-03-19 13:30:40 +01:00
parent aabf162f04
commit 527cea1261
5 changed files with 745 additions and 734 deletions

1273
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -20,6 +20,6 @@
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"terser": "^5.44.1",
"vite": "^5.4.11"
"vite": "^8.0.1"
}
}

View File

@@ -3,7 +3,7 @@
<input
v-model="message"
type="text"
:placeholder="$t('button_send')"
:placeholder="inputPlaceholder"
@keyup.enter="sendMessage"
/>
<button @click="sendMessage">{{ $t('button_send') }}</button>
@@ -17,7 +17,12 @@
style="display: none"
@change="handleImageUpload"
/>
<button class="no-style" @click="$refs.fileInput.click()" :title="$t('tooltip_send_image')">
<button
class="no-style"
@click="$refs.fileInput.click()"
:title="$t('tooltip_send_image')"
:disabled="!hasConversation"
>
<img src="/image.png" alt="Image" />
</button>
@@ -35,12 +40,18 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref, computed } from 'vue';
import { useChatStore } from '../stores/chat';
const chatStore = useChatStore();
const message = ref('');
const showSmileys = ref(false);
const hasConversation = computed(() => !!chatStore.currentConversation);
const inputPlaceholder = computed(() =>
hasConversation.value
? 'Nachricht senden oder /Befehl eingeben'
: 'Nur /Befehle eingeben (z.B. /login, /stat help)'
);
// Smiley-Definitionen (wie im Original)
const smileys = {
@@ -70,7 +81,15 @@ function sendMessage() {
const trimmed = message.value.trim();
if (!trimmed) return;
const isCommand = trimmed.startsWith('/');
if (!isCommand && !chatStore.currentConversation) return;
if (!isCommand && !hasConversation.value) {
chatStore.errorMessage = 'Ohne aktive Konversation sind nur /Befehle erlaubt.';
setTimeout(() => {
if (chatStore.errorMessage === 'Ohne aktive Konversation sind nur /Befehle erlaubt.') {
chatStore.errorMessage = null;
}
}, 4000);
return;
}
chatStore.sendMessage(chatStore.currentConversation, trimmed);
message.value = '';

View File

@@ -29,8 +29,8 @@
<span v-if="currentUserInfo">{{ currentUserInfo.country }}</span>
</div>
</div>
<ChatWindow v-if="!chatStore.errorMessage" />
<ChatInput v-if="chatStore.currentConversation && !chatStore.errorMessage" />
<ChatWindow />
<ChatInput />
</div>
</div>
</div>