Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base
improve title generation
Hugo Richard067ed5131be9
diff --git a/apps/chat/app/components/TextScramble.vue b/apps/chat/app/components/TextScramble.vuenew file mode 100644index 0000000..059fa0a--- /dev/null+++ b/apps/chat/app/components/TextScramble.vue@@ -0,0 +1,32 @@+<script setup lang="ts">+const props = withDefaults(defineProps<{+ length?: number+ interval?: number+}>(), {+ length: 14,+ interval: 60+})++const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'++function randomString() {+ return Array.from({ length: props.length }, () => chars[Math.floor(Math.random() * chars.length)]).join('')+}++const display = ref(randomString())+let timer: ReturnType<typeof setInterval>++onMounted(() => {+ timer = setInterval(() => {+ display.value = randomString()+ }, props.interval)+})++onUnmounted(() => {+ clearInterval(timer)+})+</script>++<template>+ <span class="text-muted font-mono tracking-wide opacity-50">{{ display }}</span>+</template>diff --git a/apps/chat/app/composables/useChats.ts b/apps/chat/app/composables/useChats.tsindex 1e26b02..d912463 100644--- a/apps/chat/app/composables/useChats.ts+++ b/apps/chat/app/composables/useChats.ts@@ -3,6 +3,7 @@ import { isToday, isYesterday, subMonths } from 'date-fns'export interface UIChat {id: stringlabel: string+ generating?: booleanicon: stringcreatedAt: string}diff --git a/apps/chat/app/composables/useModels.ts b/apps/chat/app/composables/useModels.tsindex 072f0a2..529abda 100644--- a/apps/chat/app/composables/useModels.ts+++ b/apps/chat/app/composables/useModels.ts@@ -15,11 +15,9 @@ export function formatModelName(modelId: string): string {export function useModels() {const models = [- 'moonshotai/kimi-k2.5','anthropic/claude-opus-4.5','openai/gpt-5.1-instant','google/gemini-3-flash',- 'minimax/minimax-m2.1']const model = useCookie<string>('model', { default: () => 'google/gemini-3-flash' })diff --git a/apps/chat/app/layouts/default.vue b/apps/chat/app/layouts/default.vueindex b3de5c5..2ff6f55 100644--- a/apps/chat/app/layouts/default.vue+++ b/apps/chat/app/layouts/default.vue@@ -29,7 +29,8 @@ const { data: chats, refresh: refreshChats } = await useFetch<Chat[]>('/api/chatkey: 'chats',transform: data => data.map(chat => ({id: chat.id,- label: chat.title || 'Untitled',+ label: chat.title || 'Generating title…',+ generating: !chat.title,to: `/chat/${chat.id}`,icon: 'i-lucide-message-circle',createdAt: chat.createdAt,@@ -55,7 +56,7 @@ const items = computed(() => groups.value?.flatMap((group, groupIndex) => {...item,slot: 'chat' as const,icon: undefined,- class: item.label === 'Untitled' ? 'text-muted' : ''+ class: item.generating ? 'text-muted' : ''}))]}))@@ -256,6 +257,11 @@ defineShortcuts({orientation="vertical":ui="{ link: 'overflow-hidden', label: 'font-pixel tracking-wide uppercase text-[10px] text-muted pb-1' }">+ <template #chat-label="{ item }">+ <TextScramble v-if="(item as any).generating" />+ <span v-else class="truncate">{{ item.label }}</span>+ </template>+<template #chat-trailing="{ item }"><div class="flex -mr-1.5 translate-x-full group-hover:translate-x-0 transition-transform"><UButton@@ -332,4 +338,4 @@ defineShortcuts({<slot v-else /></div></UDashboardGroup>-</template>+</template>\ No newline at end of file