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

Add a new 'is-docked' class to the ChatHeader component for improved styling when the references panel is visible. Introduce a 'hasReferencesPanel' prop to manage this state, enhancing the layout and responsiveness of the chat header on wider screens.
This commit is contained in:
wizardchen
2026-07-17 17:52:45 +08:00
committed by lyingbug
parent 457285cffe
commit e294dff7f4
2 changed files with 34 additions and 2 deletions
+29 -1
View File
@@ -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 {
+5 -1
View File
@@ -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;
}
}
}