diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..e69de29 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..c5739b7 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +ignoredBuiltDependencies: + - esbuild diff --git a/src-tauri/src/commands/volume_operations_commands.rs b/src-tauri/src/commands/volume_operations_commands.rs index 6fd3acb..af74e75 100644 --- a/src-tauri/src/commands/volume_operations_commands.rs +++ b/src-tauri/src/commands/volume_operations_commands.rs @@ -137,6 +137,7 @@ pub fn get_system_volumes_information() -> Vec { #[cfg(test)] mod tests { use super::*; + use crate::log_info; #[test] fn test_get_volumes() { diff --git a/src/components/explorer/FileList.jsx b/src/components/explorer/FileList.jsx index c6b37ac..2437475 100644 --- a/src/components/explorer/FileList.jsx +++ b/src/components/explorer/FileList.jsx @@ -579,6 +579,15 @@ const FileList = ({ data, isLoading, viewMode = 'grid', isSearching = false, sea handleItemClickRef.current(item, index, true); }, []); + // ⚡ Bolt Performance Optimization: + // Create Sets for O(1) lookups during render instead of O(M) Array.some() checks + // This reduces the render loop complexity from O(N*M) to O(N) where N is sortedItems length + const selectedPaths = useMemo(() => new Set(selectedItems.map(item => item.path)), [selectedItems]); + const cutPaths = useMemo(() => { + if (clipboard?.operation !== 'cut' || !clipboard?.items) return new Set(); + return new Set(clipboard.items.map(item => item.path)); + }, [clipboard]); + return (
{sortedItems.map((item, index) => { - const isCut = clipboard?.operation === 'cut' && - clipboard.items?.some(clipItem => clipItem.path === item.path); + // ⚡ Bolt Performance Optimization: + // O(1) Set lookups instead of O(M) Array.some() searches for every single item + const isSelected = selectedPaths.has(item.path); + const isCut = cutPaths.has(item.path); return ( selected.path === item.path)} + isSelected={isSelected} isFocused={focusedItem && focusedItem.path === item.path} - isCut={!!isCut} + isCut={isCut} onItemClick={stableOnItemClick} onItemDoubleClick={stableOnItemDoubleClick} />