fix(frontend): 聊天页单屏布局并消除 F5 滚底闪烁
锁定视口避免双滚动;消息列表改用 flex-col-reverse,SSR/无 JS 默认贴最新消息。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -66,29 +66,27 @@ export default async function ChatRoomPage({ params }: PageProps) {
|
||||
: room.name;
|
||||
|
||||
return (
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<ChatShell meId={me.user.id} initialRooms={rooms} activeRoomId={room.id}>
|
||||
<ChatRoomClient
|
||||
roomId={room.id}
|
||||
roomName={displayName}
|
||||
roomDescription={room.description}
|
||||
ownerId={room.owner_id}
|
||||
memberCount={room.member_count}
|
||||
myRole={room.my_role}
|
||||
joined={room.joined}
|
||||
isPrivate={room.is_private}
|
||||
isDefault={room.is_default}
|
||||
roomType={room.room_type || "group"}
|
||||
peer={room.peer || null}
|
||||
meId={me.user.id}
|
||||
meRole={me.user.role}
|
||||
meName={me.user.nickname || me.user.username}
|
||||
meAvatar={me.user.avatar || ""}
|
||||
initialMessages={initialMessages.messages}
|
||||
initialHasMore={initialMessages.has_more}
|
||||
embedded
|
||||
/>
|
||||
</ChatShell>
|
||||
</div>
|
||||
<ChatShell meId={me.user.id} initialRooms={rooms} activeRoomId={room.id}>
|
||||
<ChatRoomClient
|
||||
roomId={room.id}
|
||||
roomName={displayName}
|
||||
roomDescription={room.description}
|
||||
ownerId={room.owner_id}
|
||||
memberCount={room.member_count}
|
||||
myRole={room.my_role}
|
||||
joined={room.joined}
|
||||
isPrivate={room.is_private}
|
||||
isDefault={room.is_default}
|
||||
roomType={room.room_type || "group"}
|
||||
peer={room.peer || null}
|
||||
meId={me.user.id}
|
||||
meRole={me.user.role}
|
||||
meName={me.user.nickname || me.user.username}
|
||||
meAvatar={me.user.avatar || ""}
|
||||
initialMessages={initialMessages.messages}
|
||||
initialHasMore={initialMessages.has_more}
|
||||
embedded
|
||||
/>
|
||||
</ChatShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user