Skip to content

feat: batch file remove actions#5081

Closed
PeterCardenas wants to merge 1 commit intojesseduffield:masterfrom
PeterCardenas:batch-file-remove-action
Closed

feat: batch file remove actions#5081
PeterCardenas wants to merge 1 commit intojesseduffield:masterfrom
PeterCardenas:batch-file-remove-action

Conversation

@PeterCardenas
Copy link
Copy Markdown
Contributor

@PeterCardenas PeterCardenas commented Dec 5, 2025

PR Description

closes #4581

when pressing the remove keymap for files, we now group them up by the action we will perform on them, and then execute each action in bulk for all the files. This is a much faster approach than executing for each file.

some notes:

  • was initially fully generated by ai, but i edited it a decent amount
  • the discard unstaged files logic can be a separate change if need be, ai went ahead and did both to begin with so figured i'd go with it
  • trusting that existing integration tests and unit tests are good enough since this is not new behavior, but open to adding more

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)* [x] Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@PeterCardenas PeterCardenas force-pushed the batch-file-remove-action branch from 7ccf17a to d4b9643 Compare December 5, 2025 11:23
@PeterCardenas PeterCardenas marked this pull request as ready for review December 8, 2025 00:03
@PeterCardenas PeterCardenas force-pushed the batch-file-remove-action branch from d4b9643 to ef897c3 Compare December 8, 2025 00:14
@stefanhaller
Copy link
Copy Markdown
Collaborator

I'm closing this as superseded by #5407, hope you don't mind. From a cursory look it seems like yours took a similar approach, but I have to say that I find it hard to review, and it's lacking test coverage.

@PeterCardenas
Copy link
Copy Markdown
Contributor Author

@stefanhaller all good! glad it's getting addressed in some way. i've been meaning to add tests but haven't got around to it. one thing i did want to eventually address was an issue in the same code path where directories whose files where removed by the action are not also removed, but figured that might be a separate pr

@stefanhaller
Copy link
Copy Markdown
Collaborator

one thing i did want to eventually address was an issue in the same code path where directories whose files where removed by the action are not also removed,

That would be #1964. I'm working on that right now. 😄

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.

Discard changes can be very slow

2 participants