|
@@ -9,6 +9,7 @@
|
|
|
import Input from '$lib/components/ui/input/input.svelte';
|
|
import Input from '$lib/components/ui/input/input.svelte';
|
|
|
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
|
|
import { conversationsStore, conversations } from '$lib/stores/conversations.svelte';
|
|
|
import { chatStore } from '$lib/stores/chat.svelte';
|
|
import { chatStore } from '$lib/stores/chat.svelte';
|
|
|
|
|
+ import { getPreviewText } from '$lib/utils/text';
|
|
|
import ChatSidebarActions from './ChatSidebarActions.svelte';
|
|
import ChatSidebarActions from './ChatSidebarActions.svelte';
|
|
|
|
|
|
|
|
const sidebar = Sidebar.useSidebar();
|
|
const sidebar = Sidebar.useSidebar();
|
|
@@ -20,6 +21,9 @@
|
|
|
let showEditDialog = $state(false);
|
|
let showEditDialog = $state(false);
|
|
|
let selectedConversation = $state<DatabaseConversation | null>(null);
|
|
let selectedConversation = $state<DatabaseConversation | null>(null);
|
|
|
let editedName = $state('');
|
|
let editedName = $state('');
|
|
|
|
|
+ let selectedConversationNamePreview = $derived.by(() =>
|
|
|
|
|
+ selectedConversation ? getPreviewText(selectedConversation.name) : ''
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
let filteredConversations = $derived.by(() => {
|
|
let filteredConversations = $derived.by(() => {
|
|
|
if (searchQuery.trim().length > 0) {
|
|
if (searchQuery.trim().length > 0) {
|
|
@@ -162,7 +166,7 @@
|
|
|
bind:open={showDeleteDialog}
|
|
bind:open={showDeleteDialog}
|
|
|
title="Delete Conversation"
|
|
title="Delete Conversation"
|
|
|
description={selectedConversation
|
|
description={selectedConversation
|
|
|
- ? `Are you sure you want to delete "${selectedConversation.name}"? This action cannot be undone and will permanently remove all messages in this conversation.`
|
|
|
|
|
|
|
+ ? `Are you sure you want to delete "${selectedConversationNamePreview}"? This action cannot be undone and will permanently remove all messages in this conversation.`
|
|
|
: ''}
|
|
: ''}
|
|
|
confirmText="Delete"
|
|
confirmText="Delete"
|
|
|
cancelText="Cancel"
|
|
cancelText="Cancel"
|