fix: FileTree scrolling and text selection issues
- Change FilesPanel overflow-hidden to overflow-auto for scrolling - Add max-h-80 to FileTree to limit height while allowing scroll - Add select-none to FileTreeNode to prevent text selection - Cursor-pointer already present for clickable indication Now the file tree scrolls independently within the FILES panel, and text cannot be selected during rapid clicking.
This commit is contained in:
parent
84f68907da
commit
a7c20d6105
@ -166,7 +166,7 @@ export default function FileTree({ workspaceMode, onFileSelect }: FileTreeProps)
|
||||
const rootLoading = state.loadingPaths.has('');
|
||||
|
||||
return (
|
||||
<div className="flex-1 overflow-y-auto p-2">
|
||||
<div className="flex-1 overflow-auto p-2 max-h-80">
|
||||
{rootLoading && (
|
||||
<div className="flex items-center justify-center py-8">
|
||||
<div className="animate-spin rounded-full h-6 w-6 border-b-2 border-brand"></div>
|
||||
|
||||
@ -72,7 +72,7 @@ export default function FileTreeNode({
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
className={`flex items-center gap-1 px-2 py-1 rounded cursor-pointer hover:bg-bg-tertiary transition-colors ${
|
||||
className={`flex items-center gap-1 px-2 py-1 rounded cursor-pointer hover:bg-bg-tertiary transition-colors select-none ${
|
||||
error ? 'text-red-500' : 'text-text-primary'
|
||||
}`}
|
||||
style={{ paddingLeft: `${depth * 12 + 8}px` }}
|
||||
|
||||
@ -38,7 +38,7 @@ export default function FilesPanel({ workspaceMode }: FilesPanelProps) {
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<div className="flex-1 overflow-auto">
|
||||
<FileTree
|
||||
workspaceMode={workspaceMode}
|
||||
onFileSelect={(path) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user