Skip to content

Conversation

@sinharaksh1t
Copy link

@sinharaksh1t sinharaksh1t commented May 24, 2025

Feature to allow deletion of multiple files and directories.

Implemented:

  • Multi-selection.
  • Deletion of the files and directories that have been selected.
  • README updates.

Initial Demo:

walk.-.multi-line.selection.mov

@antonmedv
Copy link
Owner

This is cool. I like it. But can we do something better for indicating which files are selected? Maybe changing a background? Those (x) doesn’t look cool.

@sinharaksh1t
Copy link
Author

sinharaksh1t commented May 24, 2025

I actually agree with that. Changing background was definitely my first choice instead of (X). However, then I started imagining what the user experience would look like.

For example, the file under the cursor is currently colored purple. If the user selects a file, say we color it blue (as an example) to mark it selected, what color should we show when the cursor is on top of a selected file? Here are some of my initial thoughts:

  • Showing it purple may confuse them when they hit d to delete the selected files, as they may or may not recall they had selected the current file under the cursor and might accidentally delete a file they don't want to.
  • And showing it blue might confuse them in case they have multiple files selected in sequence and they're trying to find where the cursor is since they won't know until the cursor comes out of the selected files, and into an unselected file.
  • We can go with a third option where we show a third/different color instead of purple or blue when the cursor is on top of a selected file. This options helps with the drawbacks of the two options shared above, but I'm not convinced that this is a good user experience.

My goal with (X) was to ensure that regardless of the background color, when the user has the view of all the files, there is a clear indication of which files are selected and which aren't. Let me know what you think.

@sinharaksh1t
Copy link
Author

Maybe we can use an emoji instead of (X)? Like ✅ or ❌ or something else?

I'm also happy to go with the color option if we can come up with a user experience that helps address the issues I shared in the first two options above.

@antonmedv
Copy link
Owner

Emojis are particularly difficult to render on terminal reliably. Especially the width of emojis can be different on different terminals, but do not use those in TUI applications.

@sinharaksh1t
Copy link
Author

Oh, I see. Then let's scratch the emoji idea.

What do you think about the color dilemma?

@antonmedv
Copy link
Owner

Lets try those 3 colors solutions.

@sinharaksh1t
Copy link
Author

Sounds good, I'll give it a shot. Probably be Monday my time.

@sinharaksh1t sinharaksh1t force-pushed the feat/allow-multi-deletion branch from a95802f to 567f927 Compare May 27, 2025 02:55
@sinharaksh1t
Copy link
Author

sinharaksh1t commented May 27, 2025

@antonmedv I tried the 3 colors solution and I actually seem to like this user experience. I can definitely use some help in choosing the right color combination since I'm not very good at it 😅

Demo (edited and re-uploaded the demo after adding keybinding to c to clear all selected files):

walk.-.multi-line.selection.with.colors.mov

@sinharaksh1t
Copy link
Author

sinharaksh1t commented May 28, 2025

@antonmedv I've implemented the multi-file deletion. Please take a look when you can, thanks!

In the demo, I show the following 3 use-cases:

  1. Select multiple files with v > Press d to delete selected files > Press ctrl+c to disallow pending deletions. Result: Files were not deleted and we see a message saying: Seleted files were not deleted.
  2. Select multiple files with v > Press d to delete selected files > Press u to undo deletion. Result: No files were deleted, selected files that were marked for deleted were reverted back into the view.
  3. Select multiple files with v > Press d to delete selected files > Wait 5 seconds to allow files to be deleted. Result: Files were deleted from the local file system.
walk.implement.multi-file.deletion.mov

@sinharaksh1t sinharaksh1t changed the title [WIP] Feat: Implement multi-deletion Implement feature to delete multiple files May 28, 2025
@heypran
Copy link

heypran commented May 28, 2025

this looks amazing

@sinharaksh1t
Copy link
Author

Hi @antonmedv wondering if you got a chance to look at the PR.. Let me know if you have any comments/suggestions. Thanks!

@antonmedv
Copy link
Owner

I will take a look after weekend

@sinharaksh1t
Copy link
Author

Hi @antonmedv, just checking if you got a chance to take a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants