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:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<header class="chat-header" :class="{ 'is-editing': titleEditing }">
|
<header class="chat-header" :class="{ 'is-editing': titleEditing, 'is-docked': hasReferencesPanel }">
|
||||||
<form
|
<form
|
||||||
v-if="titleEditing"
|
v-if="titleEditing"
|
||||||
class="chat-header__edit"
|
class="chat-header__edit"
|
||||||
@@ -139,6 +139,7 @@ type MenuMode = 'menu' | 'clear' | 'delete'
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
session: ChatHeaderSession | null
|
session: ChatHeaderSession | null
|
||||||
|
hasReferencesPanel?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@@ -387,6 +388,33 @@ function handleMenuClick(data: { value: string }): void {
|
|||||||
max-width: min(360px, calc(100% - 24px));
|
max-width: min(360px, calc(100% - 24px));
|
||||||
padding: 2px;
|
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 {
|
.chat-header__edit {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
'is-sidebar-collapsed': uiStore.sidebarCollapsed,
|
'is-sidebar-collapsed': uiStore.sidebarCollapsed,
|
||||||
'has-references-panel': referencesDrawerVisible,
|
'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 ref="scrollContainer" class="chat_scroll_box" @scroll="handleScroll">
|
||||||
<div class="msg_list" :class="{ 'is-embedded': embeddedMode }">
|
<div class="msg_list" :class="{ 'is-embedded': embeddedMode }">
|
||||||
<!-- 消息列表骨架屏 -->
|
<!-- 消息列表骨架屏 -->
|
||||||
@@ -1063,6 +1063,10 @@ onBeforeRouteUpdate((to, from, next) => {
|
|||||||
@media (min-width: 960px) {
|
@media (min-width: 960px) {
|
||||||
padding-right: 420px;
|
padding-right: 420px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.chat_scroll_box {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user