feat: Advanced file editor and file tree improvements (#444)

# Features
- File drag and drop upload: Support uploading files and folders via drag and drop
- Binary file handling: Detect binary files and display a friendly message instead of trying to edit them
- Folder download: Download folders as ZIP files (using JSZip library)
- Context menu integration: Full right-click context menu for file operations (rename, delete, copy path, download, new file/folder)
This commit is contained in:
朱见
2026-03-03 20:19:46 +08:00
committed by GitHub
parent 503c384685
commit 97689588aa
30 changed files with 2270 additions and 94 deletions

View File

@@ -65,12 +65,15 @@ export const useEditorSidebar = ({
return;
}
const container = resizeHandleRef.current?.parentElement;
if (!container) {
// Get the main container (parent of EditorSidebar's parent) that contains both left content and editor
const editorContainer = resizeHandleRef.current?.parentElement;
const mainContainer = editorContainer?.parentElement;
if (!mainContainer) {
return;
}
const containerRect = container.getBoundingClientRect();
const containerRect = mainContainer.getBoundingClientRect();
// Calculate new editor width: distance from mouse to right edge of main container
const newWidth = containerRect.right - event.clientX;
const minWidth = 300;