Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle context for menu items in Tree Views #11742

Conversation

colin-grant-work
Copy link
Contributor

What it does

Depends on #11741.

Fixes #11458 by using a transient context for tree view context menus rather than a permanent setting when the selection changes in the tree view.

How to test

  1. Install this plugin. (Source).
  2. Open the Test View in the Explorer view container.
  3. Observe that the two parent items show a sub-type hierarchy icon, and clicking it shows a message about clicking a one-letter item.
  4. Observe that the context menus for those items have the same item, and activating it shows the same message.
  5. Observe that child items with the letter 'b' in their labels have a super-type hierarchy icon, and clicking it shows a message about clicking on an item with the letter 'b'.
  6. Observe that the same item appears in the context menus for those items, and activating it shows the same message.
  7. Observe that the child items do not have the parent item's icon, even when the parent item is selected.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added vscode issues related to VSCode compatibility menus issues related to the menu labels Oct 6, 2022
@colin-grant-work colin-grant-work changed the title Don't set viewItem context on selection Handle context for menu items in Tree Views Oct 6, 2022
@msujew msujew self-requested a review October 13, 2022 13:04
@colin-grant-work colin-grant-work force-pushed the bugfix/parent-context-propagation branch from 0ea7561 to 1c344bd Compare October 13, 2022 14:01
@colin-grant-work
Copy link
Contributor Author

Ping @msujew (or shall I request another reviewer?)

@msujew
Copy link
Member

msujew commented Nov 7, 2022

Oh, yeah. Taking a look at this tomorrow :)

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this, I remembered that I already reviewed this. Just didn't approve it yet...

Anyway, the changes look good to me 👍 I can confirm that the issue exists on master and is addressed by the changes nicely.

@colin-grant-work colin-grant-work merged commit 6b14f04 into eclipse-theia:master Nov 8, 2022
@colin-grant-work colin-grant-work deleted the bugfix/parent-context-propagation branch November 8, 2022 16:28
@colin-grant-work colin-grant-work added this to the 1.32.0 milestone Nov 8, 2022
erezmus pushed a commit to ARMmbed/theia that referenced this pull request May 3, 2023
Fixes a bug where context was set by selection rather than item identity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
menus issues related to the menu vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline tree item commands are displayed incorrectly
2 participants