Skip to content

Handle context for menu items in Tree Views - #11742

Merged
colin-grant-work merged 2 commits into
eclipse-theia:masterfrom
colin-grant-work:bugfix/parent-context-propagation
Nov 8, 2022
Merged

colin-grant-work merged 2 commits into
eclipse-theia:masterfrom
colin-grant-work:bugfix/parent-context-propagation

Conversation

@colin-grant-work

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@msujew

msujew commented Nov 7, 2022

Copy link
Copy Markdown
Member

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

@msujew msujew left a comment

Copy link
Copy Markdown
Member

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