Feat: Support batch operations (delete/move) for multi-selected tags in Super View#309
Merged
donkeyProgramming merged 1 commit intodonkeyProgramming:masterfrom Mar 22, 2026
Conversation
…in Super View Introduces comprehensive batch operations for the Super View meta editor. Users can now multi-select multiple tags in the UI to perform bulk deletions, as well as move multiple selected tags up or down simultaneously. The UI dynamically preserves the multi-selection state after moving, ensuring a seamless user experience. **Technical Rationale (Why this approach?):** * **Safe Enumeration (`.ToList()` Materialization):** By evaluating the selected items into a detached list via `.ToList()` before performing any structural modifications, we strictly avoid `InvalidOperationException` (Collection was modified; enumeration operation may not execute). This ensures absolute safety when manipulating the underlying `controller.ParsedFile.Attributes`. * **Directional Sorting for Cohesive Movement:** When moving multiple items, processing order is critical. For `ExecuteUp`, we sort the selected items in ascending index order. This guarantees the highest item moves first, preventing lower items from jumping over or overwriting higher ones. Conversely, `ExecuteDown` applies a descending sort to process the lowest items first. * **Adjacent Block Checking:** We implemented an adjacent evaluation (`!itemsToMove.Contains(itemAbove)`) to ensure that contiguously selected blocks of tags move together as a solid unit without collapsing into each other or shifting relative internal positions. * **Deferred View Updates:** Instead of refreshing the visual tree on every individual item swap or deletion, `controller.UpdateView()` is called exactly once after the entire batch operation concludes. This dramatically reduces layout passes, eliminating UI freezes during large multi-select operations.
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.
…in Super View
Introduces comprehensive batch operations for the Super View meta editor. Users can now multi-select multiple tags in the UI to perform bulk deletions, as well as move multiple selected tags up or down simultaneously. The UI dynamically preserves the multi-selection state after moving, ensuring a seamless user experience.
Technical Rationale (Why this approach?):
.ToList()Materialization): By evaluating the selected items into a detached list via.ToList()before performing any structural modifications, we strictly avoidInvalidOperationException(Collection was modified; enumeration operation may not execute). This ensures absolute safety when manipulating the underlyingcontroller.ParsedFile.Attributes.ExecuteUp, we sort the selected items in ascending index order. This guarantees the highest item moves first, preventing lower items from jumping over or overwriting higher ones. Conversely,ExecuteDownapplies a descending sort to process the lowest items first.!itemsToMove.Contains(itemAbove)) to ensure that contiguously selected blocks of tags move together as a solid unit without collapsing into each other or shifting relative internal positions.controller.UpdateView()is called exactly once after the entire batch operation concludes. This dramatically reduces layout passes, eliminating UI freezes during large multi-select operations.