Skip to content

obsidian/components/notebook-navigator-menu-event-registrar-component

Bridges the file and files context-menu events into Notebook Navigator’s own menus.

Notebook Navigator draws its own file tree and never raises Obsidian’s file-menu / files-menu workspace events, so a plugin’s context-menu items vanish for anyone browsing through it. This component is a MenuEventRegistrar backed by Notebook Navigator’s extension API instead of the workspace, so the very same handlers reach both surfaces.

ClassDescription
NotebookNavigatorMenuEventRegistrarComponentMenuEventRegistrar backed by Notebook Navigator’s menu-extension API. Handlers registered here are collected eagerly and bound to Notebook Navigator once the workspace layout is ready. When Notebook Navigator is not installed the component simply stays dormant. Every collected handler writes into a plugin-titled parent entry’s submenu, so a handler must NOT declare a section submenu of its own — Menu.sort() would fold that into a second, nested plugin-titled entry. CommandHandlerComponent takes care of this by forcing CommandHandlerRegistrationContext.shouldAddCommandToSubmenu off for the surfaces it feeds here.
InterfaceDescription
NotebookNavigatorMenuEventRegistrarComponentConstructorParamsParameters for NotebookNavigatorMenuEventRegistrarComponent.