Skip to content

Feat: Support batch operations (delete/move) for multi-selected tags in Super View#309

Merged
donkeyProgramming merged 1 commit intodonkeyProgramming:masterfrom
Szy-Cathay:feat/superview-batch-operations
Mar 22, 2026
Merged

Feat: Support batch operations (delete/move) for multi-selected tags in Super View#309
donkeyProgramming merged 1 commit intodonkeyProgramming:masterfrom
Szy-Cathay:feat/superview-batch-operations

Conversation

@Szy-Cathay
Copy link
Contributor

…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.

…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.
@donkeyProgramming donkeyProgramming merged commit 90bf50d into donkeyProgramming:master Mar 22, 2026
1 check passed
@Szy-Cathay Szy-Cathay deleted the feat/superview-batch-operations branch March 22, 2026 15:47
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.

2 participants