fix(ui): unify scrollbar styles across scrollable containers

Add .scrollbar-thin and .scrollbar-thin-edge utility classes in
globals.css and apply them to sidebar, file tree, git changes,
git log, session files, diff preview, and message thread panels.
Replace scattered inline webkit-scrollbar overrides with the
shared classes for consistent appearance and gutter behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xintaofei
2026-04-09 18:50:14 +08:00
parent 56cd207801
commit 150b927610
9 changed files with 32 additions and 19 deletions

View File

@@ -2167,7 +2167,7 @@ export function FileTreeTab() {
<div className="flex flex-col h-full">
<ContextMenu>
<ContextMenuTrigger asChild>
<div className="flex-1 min-h-0 overflow-auto pb-1 [scrollbar-gutter:stable] [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border">
<div className="flex-1 min-h-0 overflow-auto pb-1 scrollbar-thin-edge">
<FileTree
key={folder?.path ?? "file-tree-empty"}
className="border-0 rounded-none bg-transparent w-max min-w-full"

View File

@@ -1287,7 +1287,7 @@ export function GitChangesTab() {
return (
<>
<div className="h-full min-h-0 overflow-y-auto">
<div className="h-full min-h-0 overflow-y-auto scrollbar-thin-edge">
{trackedChanges.length === 0 && untrackedChanges.length === 0 ? (
<div className="flex items-center justify-center h-full p-4">
<p className="text-xs text-muted-foreground text-center">

View File

@@ -903,7 +903,7 @@ export function GitLogTab() {
if (loading) {
return (
<div className="flex flex-col h-full overflow-y-auto p-2">
<div className="flex flex-col h-full overflow-y-auto scrollbar-thin px-1 py-3">
{hasBranches && (
<BranchSelector
branchList={branchList}
@@ -929,7 +929,7 @@ export function GitLogTab() {
if (error) {
return (
<div className="flex flex-col h-full overflow-y-auto p-2">
<div className="flex flex-col h-full overflow-y-auto scrollbar-thin px-1 py-3">
{hasBranches && (
<BranchSelector
branchList={branchList}
@@ -959,7 +959,7 @@ export function GitLogTab() {
if (entries.length === 0) {
return (
<div className="flex flex-col h-full overflow-y-auto p-2">
<div className="flex flex-col h-full overflow-y-auto scrollbar-thin px-1 py-3">
{hasBranches && (
<BranchSelector
branchList={branchList}
@@ -985,7 +985,7 @@ export function GitLogTab() {
<ContextMenuTrigger asChild>
<div
onScroll={handleScroll}
className="flex-1 min-h-0 overflow-y-auto p-2 space-y-2"
className="flex-1 min-h-0 overflow-y-auto scrollbar-thin px-1 py-3 space-y-3"
>
{hasBranches && (
<div

View File

@@ -103,7 +103,7 @@ function SessionFilesContent({ conversationId }: { conversationId: number }) {
}
return (
<div className="space-y-3 p-3">
<div className="space-y-3 px-1 py-3">
{groups.map((group, groupIndex) => {
const groupKey = `${group.userTurnId}-${group.timestamp}-${groupIndex}`
const isOpen = openGroups[groupKey] ?? false
@@ -290,7 +290,7 @@ export function SessionFilesTab() {
return (
<div className="flex flex-col h-full">
<div className="flex-1 min-h-0 overflow-y-auto">
<div className="flex-1 min-h-0 overflow-y-auto scrollbar-thin">
<SessionFilesContent conversationId={conversationId} />
</div>
</div>