Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/renderer/src/components/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
:key="chatStore.getActiveThreadId() ?? 'default'"
ref="messageList"
:messages="chatStore.getMessages()"
@scroll-bottom="scrollToBottom"
/>

<!-- 输入框区域 -->
Expand Down
38 changes: 15 additions & 23 deletions src/renderer/src/components/ThreadView.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
<template>
<Teleport to="body">
<Transition
enter-active-class="transition-opacity duration-200 ease-out"
leave-active-class="transition-opacity duration-150 ease-in"
enter-from-class="opacity-0"
leave-to-class="opacity-0"
enter-active-class="transition-all duration-200 ease-out"
leave-active-class="transition-all duration-150 ease-in"
:enter-from-class="'translate-x-full'"
:leave-to-class="'translate-x-full'"
>
<div
v-if="chatStore.isSidebarOpen"
class="fixed inset-0 z-50 flex"
:class="langStore.dir === 'rtl' ? 'justify-end' : 'justify-start'"
class="fixed inset-0 z-50 flex justify-end"
:dir="langStore.dir"
@click.self="closeSidebar"
>
<Transition
enter-active-class="transition-transform duration-200 ease-out"
leave-active-class="transition-transform duration-150 ease-in"
:enter-from-class="langStore.dir === 'rtl' ? 'translate-x-full' : '-translate-x-full'"
:leave-to-class="langStore.dir === 'rtl' ? 'translate-x-full' : '-translate-x-full'"
<div
v-if="chatStore.isSidebarOpen"
:class="[
'h-full w-60 max-w-60 shadow-lg bg-card',
langStore.dir === 'rtl' ? 'border-l' : 'border-r',
'border-border'
]"
@click.stop
>
<div
v-if="chatStore.isSidebarOpen"
:class="[
'h-full w-60 max-w-60 shadow-lg bg-card',
langStore.dir === 'rtl' ? 'border-l' : 'border-r',
'border-border'
]"
@click.stop
>
<ThreadsView class="h-full" />
</div>
</Transition>
<ThreadsView class="h-full" />
</div>
</div>
</Transition>
</Teleport>
Expand Down
22 changes: 1 addition & 21 deletions src/renderer/src/components/ThreadsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@
class="shrink-0 text-xs justify-center h-7 w-7"
@click="chatStore.isSidebarOpen = false"
>
<Icon icon="lucide:panel-left-close" class="h-4 w-4" />
</Button>
<Button
variant="outline"
size="sm"
class="w-0 flex-1 text-xs justify-start gap-2 h-7"
@click="createNewThread"
>
<Icon icon="lucide:pen-line" class="h-4 w-4" />
<span>{{ t('common.newChat') }}</span>
<Icon icon="lucide:chevron-left" class="h-4 w-4" />
</Button>
</div>

Expand Down Expand Up @@ -207,17 +198,6 @@ const flattenedThreads = computed<VirtualScrollItem[]>(() => {
return items
})

// 创建新会话
const createNewThread = async () => {
try {
await chatStore.createNewEmptyThread()
chatStore.isSidebarOpen = false
chatStore.isMessageNavigationOpen = false
} catch (error) {
console.error(t('common.error.createChatFailed'), error)
}
}

// 选择会话
const handleThreadSelect = async (thread: CONVERSATION) => {
try {
Expand Down