fix(vue): enable Create Instance menu item for components

The disabled flag was inverted — the manually constructed menu item
used `!commandMenuItem(...).disabled` which made the item disabled
when the command was enabled, and vice versa. Replaced with a direct
commandMenuItem() call which handles label, disabled, and action
correctly.

Fixes #223
This commit is contained in:
Danila Poyarkov 2026-04-22 14:16:14 +03:00
parent e23b3f0ce1
commit 3a2a3865f4

View file

@ -103,13 +103,7 @@ export function useMenuModel() {
? [commandMenuItem('selection.createComponentSet', '⇧⌘K')]
: []),
...(isComponent.value && selectedNode.value
? [
{
label: t.value.createInstance,
action: () => commandMenuItem('selection.createInstance').action?.(),
disabled: !commandMenuItem('selection.createInstance').disabled
} satisfies MenuActionNode
]
? [commandMenuItem('selection.createInstance')]
: []),
...(isInstance.value ? [commandMenuItem('selection.goToMainComponent')] : []),
...(isInstance.value ? [commandMenuItem('selection.detachInstance', '⌥⌘B')] : []),