diff --git a/dashboard/src/components/chat/Chat.vue b/dashboard/src/components/chat/Chat.vue index 5524e787d..a73bad4d1 100644 --- a/dashboard/src/components/chat/Chat.vue +++ b/dashboard/src/components/chat/Chat.vue @@ -18,61 +18,27 @@ @editTitle="showEditTitleDialog" @deleteConversation="handleDeleteConversation" @closeMobileSidebar="closeMobileSidebar" + @toggleTheme="toggleTheme" + @toggleFullscreen="toggleFullscreen" />
-
+
- + mdi-menu - - -
- - - - - - - - - - - - - - - - -
- +
+ +
+
Hello, I'm @@ -260,6 +226,14 @@ function toggleTheme() { theme.global.name.value = newTheme; } +function toggleFullscreen() { + if (props.chatboxMode) { + router.push(currSessionId.value ? `/chat/${currSessionId.value}` : '/chat'); + } else { + router.push(currSessionId.value ? `/chatbox/${currSessionId.value}` : '/chatbox'); + } +} + function openImagePreview(imageUrl: string) { previewImageUrl.value = imageUrl; imagePreviewDialog.value = true; @@ -303,11 +277,14 @@ function clearReply() { async function handleSelectConversation(sessionIds: string[]) { if (!sessionIds[0]) return; + // 立即更新选中状态,避免需要点击两次 + currSessionId.value = sessionIds[0]; + selectedSessions.value = [sessionIds[0]]; + // 更新 URL const basePath = props.chatboxMode ? '/chatbox' : '/chat'; if (route.path !== `${basePath}/${sessionIds[0]}`) { router.push(`${basePath}/${sessionIds[0]}`); - return; } // 手机端关闭侧边栏 @@ -317,9 +294,6 @@ async function handleSelectConversation(sessionIds: string[]) { // 清除引用状态 clearReply(); - - currSessionId.value = sessionIds[0]; - selectedSessions.value = [sessionIds[0]]; await getSessionMsg(sessionIds[0], router); @@ -510,6 +484,29 @@ onBeforeUnmount(() => { overflow: hidden; } +.message-list-wrapper { + flex: 1; + position: relative; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.message-list-fade { + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 40px; + background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); + pointer-events: none; + z-index: 1; +} + +.message-list-fade.fade-dark { + background: linear-gradient(to top, rgba(30, 30, 30, 1) 0%, rgba(30, 30, 30, 0) 100%); +} + .conversation-header { display: flex; justify-content: space-between; diff --git a/dashboard/src/components/chat/ChatInput.vue b/dashboard/src/components/chat/ChatInput.vue index 1f6e634b2..402a9e3a9 100644 --- a/dashboard/src/components/chat/ChatInput.vue +++ b/dashboard/src/components/chat/ChatInput.vue @@ -1,7 +1,7 @@