fix 优化对话标题显示方法

This commit is contained in:
Wenjie Zhang 2025-05-15 22:57:23 +08:00
parent a292e69b22
commit b81f31c652

View File

@ -25,7 +25,9 @@
</div>
</div>
<div class="header__center">
<div @click="console.log(currentChat)">{{ currentChat?.title }}</div>
<div @click="console.log(currentChat)" class="center-title">
{{ currentChat?.title }}
</div>
<slot name="header-center"></slot>
</div>
<div class="header__right">
@ -304,6 +306,11 @@ const renameChat = async (data) => {
return;
}
// 30
if (title.length > 30) {
title = title.slice(0, 30);
}
try {
// API
await threadApi.updateThread(chatId, title);
@ -797,10 +804,17 @@ const mergeMessageChunk = (chunks) => {
padding: 1rem;
border-bottom: 1px solid var(--main-light-3);
.header__left, .header__right {
.header__left, .header__right, .header__center {
display: flex;
align-items: center;
}
.center-title {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.nav-btn {