How n8n Uses the useEditorContext Vue Composable to Manage Editor Features

The n8n workflow automation platform uses a Vue composable called useEditorContext to manage per-editor host overrides within its editor-ui frontend. Composables in Vue leverage the Composition API to encapsulate reusable stateful logic, similar in concept to React Hooks. useEditorContext controls which AI and editor features are active by combining settings from a central store with optional overrides injected by the host environment. Host environments, such as an AI artifact preview panel, can restrict features like AI Assistant or read-only mode by supplying an EditorEnabledFeaturesKey, but cannot enable features beyond what the store permits. Flags for execution result toasts are also managed through this composable, defaulting to visible unless explicitly suppressed by the host.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in