Skip to content

AI-native design editor. Open-source Figma alternative.

fix(app): render non-command menu items

Danila Poyarkov16be275f650b
diff --git a/src/app/shell/menu/app-menu.ts b/src/app/shell/menu/app-menu.ts
index b49ff0a6d..c35a6484e 100644
--- a/src/app/shell/menu/app-menu.ts
+++ b/src/app/shell/menu/app-menu.ts
@@ -7,7 +7,7 @@ import { useAppTheme } from '@/app/shell/theme'
import { useEditorCommands, useI18n } from '@open-pencil/vue'
import type { AppMenuActionItem, AppMenuEntry, AppMenuGroupSchema } from '@/app/shell/menu/schema'
-import type { EditorCommandId, MenuEntry } from '@open-pencil/vue'
+import type { MenuEntry } from '@open-pencil/vue'
export interface AppMenuGroup {
label: string
@@ -26,10 +26,6 @@ function isSeparator(entry: AppMenuEntry): entry is Extract<AppMenuEntry, { type
return entry.type === 'separator'
}
-function isCommandId(id: string | undefined): id is EditorCommandId {
- return Boolean(id?.includes('.'))
-}
-
export function useAppMenu(mod: string) {
const store = useEditorStore()
const { menuItem: commandMenuItem } = useEditorCommands()
@@ -157,9 +153,8 @@ export function useAppMenu(mod: string) {
return { label: entry.label, sub: languageMenu.value }
}
- if (entry.command ?? isCommandId(entry.id)) {
- const command = entry.command ?? (entry.id as EditorCommandId)
- return commandMenuItem(command, shortcutLabel(entry.shortcut, mod))
+ if (entry.command) {
+ return commandMenuItem(entry.command, shortcutLabel(entry.shortcut, mod))
}
return {