Skip to content
Merged
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,10 @@
- Best for "popup over app" with no lag
- [ ] Drag and drop files into breadcrumb folders
- [ ] Support network devices
- [ ] Drag and drop files from EdenExplorer into Windows objects (Desktop, File Explorer, applications, etc.)

## 🐛 Known Bugs
- After hitting "Enter" when renaming a new file/folder, it should automatically select that item in the itemviewer
- Dragging and dropping files into empty folders/directories doesn't do anything
- Hitting "Shift" after already shift-selecting files drops the entire file selection
- Entering "%appdata%" in the breadcrumbs/path throws an invalid path errors

## Star History

Expand Down
24 changes: 23 additions & 1 deletion src/gui/windows/containers/itemviewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ pub fn draw_item_viewer(
let mut any_row_hovered = false;

if files.is_empty() {
// Handle drag and drop for empty folders
if ui.ctx().input(|i| !i.raw.dropped_files.is_empty()) {
let dropped_paths: Vec<PathBuf> = ui.ctx().input(|i| {
i.raw
.dropped_files
.iter()
.filter_map(|f| f.path.clone())
.collect()
});

if !dropped_paths.is_empty() {
action = Some(ItemViewerAction::FilesDropped(dropped_paths));
}
}

ui.centered_and_justified(|ui| {
if is_loading {
ui.add(egui::Spinner::new().size(28.0));
Expand Down Expand Up @@ -147,14 +162,21 @@ pub fn draw_item_viewer(
.resizable(true)
.id_salt("item_viewer_table");

// If we have a newly created row, scroll to it
// If we have a newly created row, scroll to it and select it
if let Some(new_path) = &explorer_state.newly_created_path {
if let Some(idx) = filter_state
.cached_indices
.iter()
.position(|&i| files[i].path == *new_path)
{
table = table.scroll_to_row(idx, Some(egui::Align::Center));

// Auto-select the newly created/renamed item
explorer_state.selected_paths.clear();
explorer_state.selected_paths.insert(new_path.clone());
explorer_state.selection_anchor = Some(idx);
explorer_state.selection_focus = Some(idx);

explorer_state.newly_created_path = None;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/gui/windows/mainwindow_imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ impl MainWindow {

file_op.PerformOperations().ok();
}

// Set the renamed file path for auto-selection and scrolling
self.explorer_state.newly_created_path = Some(target);
}
}

Expand Down
Loading