-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
issue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Description
Check for duplicates
- I have searched for similar issues before opening a new one.
Description
PR 8767 added separators to context menus. It did this by refactoring RegistryItem into ActionRegistryItem and SeparatorRegistryItem, both of which extend CoreRegistryItem. It placed preconditionFn in ActionRegistryItem and scopeType in CoreRegistryItem.
PR 8882 deprecated scopeType in favor of a Scope object passed to preconditionFn. This allowed menu items to apply to any IFocusableNode, instead of just workspaces, blocks, and comments.
As a result, separator menu items must use the deprecated scopeType property to specify what component they apply to, while action menu items can use preconditionFn. This results in two problems:
- If
scopeTypeis ever removed, it won't be possible to specify what components separator menu items apply to. - Separator menu items can only apply to workspaces, blocks, and comments, while action menu items can apply to any
IFocusableNode.
The solution is to move preconditionFn from ActionRegistryItem to CoreRegistryItem.
Reproduction steps
Stack trace
Screenshots
No response
Browsers
No response
mxmou
Metadata
Metadata
Assignees
Labels
issue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong