Ignore detached tree rows when showing selection - #4163
Merged
Merged
Conversation
Removing a set of assemblies takes their nodes out of the tree in one step, but the list control drops them from its selection one at a time, so the selection is reported shrinking through every intermediate size on the way to empty. Acting on those decompiles an assembly the user just removed, and the result lands on top of the tab that the removal had already emptied. Assisted-by: Claude:claude-opus-5[1m]:Claude Code Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
siegfriedpammer
force-pushed
the
fix/ignore-detached-tree-rows
branch
from
September 21, 2026 15:52
0c6b3fb to
7fdc038
Compare
Keep the tree selection invariant at the control boundary so model consumers never observe rows after the flattener has removed them. This replaces the display-side detached-node filter with a source-level selection cleanup. Assisted-by: OpenCode:openai/gpt-5.5:OpenCode
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.
Rows removed from the assembly tree can remain in the underlying ListBox selection while the flattened tree reports removal.
Fix this at the SharpTreeView boundary: when the flattener removes selected rows, the tree prunes those rows from SelectedItems and publishes one clean aggregate selection change, so AssemblyTreeModel consumers never observe detached rows.
Verification:
OPENSSL_ENABLE_SHA1_SIGNATURES=1 dotnet test "ILSpy.Tests/ILSpy.Tests.csproj" --filter "FullyQualifiedName~SharpTreeViewTests" --report-trxThis PR description was written by an AI agent (OpenCode gpt-5.5) working under @siegfriedpammer's direction.