testing: align right-click menu with hover bar on compressed result rows#309139
Merged
connor4312 merged 1 commit intomicrosoft:mainfrom Apr 13, 2026
Merged
Conversation
When a TestCaseElement is rendered together with its only TestMessageElement child, the inline action bar uses the parent element while the right-click context menu was operating on the (compressed) message element. This caused useful actions like Run Test and Debug Test to disappear from the right-click menu even though they were visible as hover icons on the same row. Mirror the renderer's compression logic in onContextMenu so that the menu offered on right-click matches the actions shown in the inline action bar. Fixes microsoft#296078
connor4312
approved these changes
Apr 13, 2026
roblourens
approved these changes
Apr 13, 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
When a
TestCaseElementis rendered together with its onlyTestMessageElementchild (the result tree compresses single-message test rows), the inline action bar inTestRunElementRenderer.renderCompressedElementsis built for the parent element. The right-click handler inOutputPeekTree.onContextMenu, however, was operating on the compressed-inTestMessageElementreturned by the tree. This left the right-click menu missing useful actions like Run Test and Debug Test even though those very same icons were visible in the inline action bar on the same row.This change introduces a small
getRenderedElementhelper that mirrors the renderer's compression logic and uses the resulting element when computing actions and the action context for the right-click menu, so the menu now matches the inline action bar shown on the visible row.Fixes #296078
Test plan
TestMessageElementand confirm it still shows message-specific actions.TestCaseElement(not compressed) and confirm behavior is unchanged.