Skip to content

Commit 0a63afb

Browse files
committed
fix: 聊天居中时滚动条预留空间,避免布局偏移
1 parent b24bda8 commit 0a63afb

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

frontend/src/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,9 @@
198198

199199
.animate-text-flash {
200200
animation: text-flash 1.5s ease-in-out infinite;
201+
}
202+
203+
/* 预留滚动条空间(左右对称),避免出现/消失时布局偏移,保持内容居中 */
204+
.scrollbar-gutter-stable {
205+
scrollbar-gutter: stable both-edges;
201206
}

frontend/src/pages/console/user/task/task-detail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default function TaskDetailPage() {
267267
<PlanStepsBlock plan={plan} streamStatus={streamStatus} />
268268
</div>
269269
)}
270-
<div ref={chatScrollRef} className="flex-1 min-h-0 overflow-y-auto min-w-0">
270+
<div ref={chatScrollRef} className={cn("flex-1 min-h-0 overflow-y-auto min-w-0", !hasPanel && "scrollbar-gutter-stable")}>
271271
<div className={cn("min-h-full", hasPanel ? "w-full" : "mx-auto max-w-[800px]")}>
272272
<TaskChatPanel
273273
scrollContainerRef={chatScrollRef}

0 commit comments

Comments
 (0)