feat: 新建对话按钮移到历史列表页顶部右侧

This commit is contained in:
2026-04-26 10:24:39 +08:00
parent 15ce68cd6e
commit 2a7f362c88
2 changed files with 27 additions and 5 deletions

View File

@@ -68,14 +68,12 @@ function showConversationList() {
<span class="logo">🤖</span>
<h1>AI助手</h1>
</div>
<button class="new-chat-btn-header" id="newChatBtn" title="新建对话">
<svg viewBox="0 0 24 24" width="20" height="20"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
</button>
</header>
<div class="list-content">
<button class="new-chat-btn" id="newChatBtn">
<svg viewBox="0 0 24 24" width="20" height="20"><path fill="currentColor" d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
新建对话
</button>
<div class="conversation-list" id="conversationList">
${conversations.length === 0
? '<div class="empty-list">暂无对话记录</div>'

View File

@@ -72,6 +72,30 @@ body {
overflow-y: auto;
}
/* Header 中的新建对话按钮 */
.new-chat-btn-header {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: rgba(255,255,255,0.2);
border: none;
border-radius: 10px;
color: white;
cursor: pointer;
transition: all 0.2s;
}
.new-chat-btn-header:hover {
background: rgba(255,255,255,0.3);
}
.new-chat-btn-header:active {
transform: scale(0.95);
}
/* 原样式保留(备用) */
.new-chat-btn {
display: flex;
align-items: center;