fix(frontend): 聊天页单屏布局并消除 F5 滚底闪烁

锁定视口避免双滚动;消息列表改用 flex-col-reverse,SSR/无 JS 默认贴最新消息。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 00:50:16 +08:00
parent a138f428e1
commit e6f8fadbe5
6 changed files with 83 additions and 53 deletions

View File

@@ -113,6 +113,26 @@ body {
text-rendering: optimizeLegibility;
}
/* 聊天页:整页锁在视口内,避免「页面滚动 + 对话区滚动」双滚动条 */
body:has([data-chat-viewport]) {
height: 100dvh;
max-height: 100dvh;
overflow: hidden;
}
body:has([data-chat-viewport]) > footer {
display: none;
}
body:has([data-chat-viewport]) #main {
flex: 1 1 0;
min-height: 0;
display: flex;
flex-direction: column;
/* 覆盖 root layout 的 py-7/sm:py-9,只留紧凑间距 */
padding-top: 0.75rem;
padding-bottom: 0.75rem;
overflow: hidden;
}
::selection {
background: var(--accent);
color: var(--accent-on);