files-community / files-community/Files
Feature: Option to Auto-Select Next Item After Delete (macOS Finder-style)
- Dominant language
- C#
- Stars
- 45.4k
- Forks
- 2.9k
- PR merge metrics
- PR metrics pending
Description
## What feature or improvement do you think would benefit Files?
Add an optional setting to automatically **select** (not just focus) the next item after deleting a file or folder. This would enable macOS Finder-style keyboard workflow where users can sequentially delete multiple files by repeatedly pressing the Delete key.
While I understand that Files tries to mimic the native UX of Windows Explorer, I believe many users switch to it because Files is already so much better in many regards. MacOS people (like me) who struggle using Windows Explorer, will find Files a relieve. This feature would remove another every-day struggle using a file explorer on Windows, even though most Windows people will likely not use it.
## Problem Description
Currently, after deleting a file using the keyboard:
1. The deleted file is removed from the list
2. The **focus** moves to the next item (dotted border/focus ring)
3. The next item is **not selected** (no highlighted background)
4. Pressing Delete again does nothing because no item is selected
5. User must press Arrow Down/Up or click to re-select before deleting another file
This mimics Windows Explorer behavior, but creates friction for users who:
- Are migrating from macOS where Finder auto-selects the next item
- Want to quickly review and delete multiple files sequentially
- Prefer keyboard-centric workflows without needing to re-select after each deletion
## Expected Behavior (with proposed setting enabled)
After deleting a file using the keyboard:
1. The deleted file is removed from the list
2. The next item is automatically **selected** (highlighted background)
3. The next item also receives **focus** for keyboard navigation
4. Pressing Delete again immediately deletes the next file
5. User can sequentially delete files without additional keystrokes
## Proposed Solution
Add a toggle setting in **Settings > Folders** (or Settings > Advanced):
**Setting Name**: "Auto-select next item after delete"
**Description**: "When enabled, the next item will be automatically selected after deleting a file or folder. This provides macOS Finder-like behavior for sequential deletions."
**Default**: Off (preserving current Windows Explorer behavior)
### Technical Approach
The implementation would modify the post-delete handler in `ShellViewModel` to:
1. Check the user preference setting
2. If enabled, set both `SelectedItems` and `FocusedItem` to the next item in the list
3. If disabled, maintain current behavior (focus only, no selection)
### Conceptual Code Change
```csharp
// In ShellViewModel.cs, after delete operation completes
if (UserSettingsService.FoldersSettingsService.AutoSelectNextItemAfterDelete)
{
var nextIndex = Math.Min(deletedItemIndex, FilesAndFolders.Count - 1);
if (nextIndex >= 0)
{
var nextItem = FilesAndFolders[nextIndex];
SelectedItems.Clear();
SelectedItems.Add(nextItem);
FocusedItem = nextItem;
}
}
```
## Use Cases
1. **Photo/Media Curation**: Reviewing a folder of images and deleting unwanted ones sequentially
2. **Download Cleanup**: Going through a Downloads folder and removing old files one by one
3. **Code Cleanup**: Removing obsolete files from a project directory
4. **Cross-Platform Users**: Users switching between macOS and Windows who expect consistent behavior
## Platform Comparison
| File Manager | Behavior After Delete |
|--------------|----------------------|
| Windows Explorer | Focus only (no selection) |
| macOS Finder | Auto-select next item |
| Nautilus (GNOME) | Auto-select next item |
| Dolphin (KDE) | Auto-select next item |
| Total Commander | Configurable |
## Additional Context
- This is a **non-breaking change** as the default would preserve current Windows Explorer behavior
- The setting would benefit keyboard-centric users and those with accessibility needs
- Related closed issue: #9429 (addressed random selection, but maintained focus-only behavior)
- Similar focus/selection issues have been reported in #8352, #15288, #16530
Thanks a lot!
Stephan
### Requirements
## Requirements Checklist
- [ ] New setting in IFoldersSettingsService / FoldersSettingsService
- [ ] UI toggle in Settings > Folders page
- [ ] Localization strings for setting name and description
- [ ] Modify post-delete handler in ShellViewModel
- [ ] Unit tests for both enabled/disabled states
- [ ] Documentation update
### Files Version
4.0.21.0
### Windows Version
10.0.26200.7462
### Comments
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.