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

@@ -0,0 +1,14 @@
/**
* 聊天路由布局:标记 data-chat-viewport,配合 globals.css
* 将页面锁在一屏内(隐藏页脚、收紧 main 内边距),仅对话区滚动。
*/
export default function ChatLayout({ children }: { children: React.ReactNode }) {
return (
<div
data-chat-viewport
className="flex flex-col flex-1 min-h-0 w-full max-w-6xl mx-auto"
>
{children}
</div>
);
}