Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

feat(chat): enhance ChatHeader with docked state and references panel support

wizardchene294dff7f479
diff --git a/frontend/src/components/ChatHeader.vue b/frontend/src/components/ChatHeader.vue
index c5549eff4..79aec898f 100644
--- a/frontend/src/components/ChatHeader.vue
+++ b/frontend/src/components/ChatHeader.vue
@@ -1,5 +1,5 @@
<template>
- <header class="chat-header" :class="{ 'is-editing': titleEditing }">
+ <header class="chat-header" :class="{ 'is-editing': titleEditing, 'is-docked': hasReferencesPanel }">
<form
v-if="titleEditing"
class="chat-header__edit"
@@ -139,6 +139,7 @@ type MenuMode = 'menu' | 'clear' | 'delete'
const props = defineProps<{
session: ChatHeaderSession | null
+ hasReferencesPanel?: boolean
}>()
const { t } = useI18n()
@@ -387,6 +388,33 @@ function handleMenuClick(data: { value: string }): void {
max-width: min(360px, calc(100% - 24px));
padding: 2px;
}
+
+ @media (min-width: 960px) {
+ &.is-docked {
+ position: relative;
+ top: auto;
+ left: auto;
+ align-self: stretch;
+ z-index: 5;
+ flex-shrink: 0;
+ width: 100%;
+ max-width: none;
+ margin: 0;
+ padding: 10px 12px;
+ border-radius: 0;
+ border-bottom: 1px solid var(--td-component-stroke);
+ background: var(--td-bg-color-container);
+ backdrop-filter: none;
+ -webkit-backdrop-filter: none;
+ box-sizing: border-box;
+ transition: border-color 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
+
+ &.is-editing {
+ max-width: none;
+ padding: 8px 12px;
+ }
+ }
+ }
}
.chat-header__edit {
diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue
index 93041930a..86ef5c1d5 100644
--- a/frontend/src/views/chat/index.vue
+++ b/frontend/src/views/chat/index.vue
@@ -4,7 +4,7 @@
'is-sidebar-collapsed': uiStore.sidebarCollapsed,
'has-references-panel': referencesDrawerVisible,
}">
- <ChatHeader v-if="!embeddedMode" :session="currentSession" />
+ <ChatHeader v-if="!embeddedMode" :session="currentSession" :has-references-panel="referencesDrawerVisible" />
<div ref="scrollContainer" class="chat_scroll_box" @scroll="handleScroll">
<div class="msg_list" :class="{ 'is-embedded': embeddedMode }">
<!-- 消息列表骨架屏 -->
@@ -1063,6 +1063,10 @@ onBeforeRouteUpdate((to, from, next) => {
@media (min-width: 960px) {
padding-right: 420px;
box-sizing: border-box;
+
+ .chat_scroll_box {
+ padding-top: 0;
+ }
}
}