Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .jules/bolt.md
Empty file.
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignoredBuiltDependencies:
- esbuild
1 change: 1 addition & 0 deletions src-tauri/src/commands/volume_operations_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub fn get_system_volumes_information() -> Vec<VolumeInformation> {
#[cfg(test)]
mod tests {
use super::*;
use crate::log_info;

#[test]
fn test_get_volumes() {
Expand Down
19 changes: 15 additions & 4 deletions src/components/explorer/FileList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="file-list-wrapper">
<div
Expand Down Expand Up @@ -632,18 +641,20 @@ const FileList = ({ data, isLoading, viewMode = 'grid', isSearching = false, sea
{/* File list content */}
<div className={`file-list view-mode-${viewMode.toLowerCase()} scrollable-content`}>
{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 (
<FileItem
key={item.path}
item={item}
index={index}
viewMode={viewMode}
isSelected={selectedItems.some(selected => selected.path === item.path)}
isSelected={isSelected}
isFocused={focusedItem && focusedItem.path === item.path}
isCut={!!isCut}
isCut={isCut}
onItemClick={stableOnItemClick}
onItemDoubleClick={stableOnItemDoubleClick}
/>
Expand Down
Loading