PowerRename: continue batch rename on per-item IFileOperation failures and surface partial-failure state#47060
Draft
PowerRename: continue batch rename on per-item IFileOperation failures and surface partial-failure state#47060
Conversation
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/e6409325-1f8a-4ff0-b614-2950de17758b Co-authored-by: moooyo <42196638+moooyo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/e6409325-1f8a-4ff0-b614-2950de17758b Co-authored-by: moooyo <42196638+moooyo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix PowerRename exiting on html file with connected folder
PowerRename: continue batch rename on per-item IFileOperation failures and surface partial-failure state
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
PowerRename currently reports success while silently stopping the batch when it hits an
htmlrename that triggers shell-level conflict behavior (for example, connected folder scenarios). This change isolates rename execution per item so one failure does not terminate the batch, and surfaces partial failures in UI state instead of closing as if fully successful.PR Checklist
Detailed Description of the Pull Request / Additional comments
Rename execution semantics
IFileOperationrename batch to per-item operations inPowerRenameManager.Partial-failure propagation
SRM_FILEOP_ITEM_ERROR) and completion state propagation to manager/UI flow.OnRenameCompletedis raised with non-close behavior to prevent false “all good” UX.UI error surfacing
MainWindow::OnErrorhandling to retain error state across completion.ErrorMessage_RenameFailed("This item couldn't be renamed.").ItemNameAlreadyExiststo error visual state and message rendering path.Focused regression coverage
VerifyRenameContinuesWhenOneItemFailsin PowerRename manager tests:Validation Steps Performed
Added a targeted regression unit test that exercises mixed success/failure rename batches (
VerifyRenameContinuesWhenOneItemFails) to validate failure isolation and partial-failure signaling behavior.