Skip to content

Ignore detached tree rows when showing selection - #4163

Merged
siegfriedpammer merged 2 commits into
masterfrom
fix/ignore-detached-tree-rows
Sep 27, 2026
Merged

siegfriedpammer merged 2 commits into
masterfrom
fix/ignore-detached-tree-rows

Conversation

@siegfriedpammer

@siegfriedpammer siegfriedpammer commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

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-trx


This PR description was written by an AI agent (OpenCode gpt-5.5) working under @siegfriedpammer's direction.

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
siegfriedpammer force-pushed the fix/ignore-detached-tree-rows branch from 0c6b3fb to 7fdc038 Compare September 21, 2026 15:52
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
@siegfriedpammer
siegfriedpammer merged commit aa9e3de into master Sep 27, 2026
15 checks passed
@siegfriedpammer
siegfriedpammer deleted the fix/ignore-detached-tree-rows branch September 27, 2026 10:07
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.

1 participant