From 9be4b6e33ec5fc7859e1ade3165a9a60536bade4 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 29 Mar 2026 00:27:38 -0700 Subject: [PATCH] fix: restore explorer scrolling (#186) --- .../components/right-sidebar/FileExplorer.tsx | 10 +++++---- .../src/components/ui/scroll-area.tsx | 21 +++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/FileExplorer.tsx b/src/renderer/src/components/right-sidebar/FileExplorer.tsx index ca6a45e3a..441f4ae62 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorer.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorer.tsx @@ -5,6 +5,7 @@ import { useAppStore } from '@/store' import { detectLanguage } from '@/lib/language-detect' import { joinPath, normalizeRelativePath } from '@/lib/path' import { cn } from '@/lib/utils' +import { ScrollArea } from '@/components/ui/scroll-area' import type { GitFileStatus } from '../../../../shared/types' import { splitPathSegments } from './path-tree' import { @@ -268,9 +269,10 @@ export default function FileExplorer(): React.JSX.Element { } return ( -
@@ -354,6 +356,6 @@ export default function FileExplorer(): React.JSX.Element { ) })}
-
+ ) } diff --git a/src/renderer/src/components/ui/scroll-area.tsx b/src/renderer/src/components/ui/scroll-area.tsx index e37c928e6..e09bad75c 100644 --- a/src/renderer/src/components/ui/scroll-area.tsx +++ b/src/renderer/src/components/ui/scroll-area.tsx @@ -5,9 +5,14 @@ import { cn } from '@/lib/utils' function ScrollArea({ className, + viewportClassName, + viewportRef, children, ...props -}: React.ComponentProps) { +}: React.ComponentProps & { + viewportClassName?: string + viewportRef?: React.Ref +}) { return ( {children} @@ -36,16 +45,16 @@ function ScrollBar({ data-slot="scroll-area-scrollbar" orientation={orientation} className={cn( - 'flex touch-none p-px transition-colors select-none', - orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent', - orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent', + 'flex touch-none p-px transition-colors select-none bg-transparent', + orientation === 'vertical' && 'h-full w-3 py-2 border-l border-l-transparent', + orientation === 'horizontal' && 'h-3 px-2 flex-col border-t border-t-transparent', className )} {...props} > )