MutkaMutka

MutkaAction

Reference — MutkaAction in the Mutka module API.

Interface: MutkaAction

Defined in: module-registry/module-registry.types.ts:53

Properties

contextMenuCategory?

optional contextMenuCategory?: string;

Defined in: module-registry/module-registry.types.ts:75

Context menu category. Actions in the same category share a section header. Use ContextMenuCategories or any custom string.


contextMenuZones?

optional contextMenuZones?: readonly ("file" | "background" | "breadcrumb" | "sidebar")[];

Defined in: module-registry/module-registry.types.ts:81

UI regions this action appears in when right-clicked. Undefined → the default zones (file rows + empty background). The registry filters context-menu actions by the zone the user clicked. See core/menu/menuZone.ts.


execute

execute: () => void | Promise<void>;

Defined in: module-registry/module-registry.types.ts:83

The operation to perform. May be async. Acts via the module's host capabilities.

Returns

void | Promise<void>


icon?

optional icon?: string;

Defined in: module-registry/module-registry.types.ts:63

Optional icon key from the icon registry (e.g. "trash", "copy", "cloud"). Unknown keys render as nothing. Only string keys reach the renderer. Full registry: src/components/ContextMenu/icon-registry.ts


id

id: string;

Defined in: module-registry/module-registry.types.ts:55

Globally unique ID, format: "module-id.action-name", e.g. "core.clipboard.copy"


isEnabled?

optional isEnabled?: (context) => boolean;

Defined in: module-registry/module-registry.types.ts:88

Whether this action can run right now. Disabled actions are greyed out. Default: always enabled.

Parameters

ParameterType
contextBaseContext

Returns

boolean


isVisible?

optional isVisible?: (context) => boolean;

Defined in: module-registry/module-registry.types.ts:94

Whether this action is shown at all. Hidden actions don't appear in the menu and their shortcut is suppressed. Default: always visible. Built from a module's serializable when clause for sandboxed modules.

Parameters

ParameterType
contextBaseContext

Returns

boolean


label

label: string;

Defined in: module-registry/module-registry.types.ts:57

Human-readable label shown in menus and tooltips


shortcut?

optional shortcut?: string;

Defined in: module-registry/module-registry.types.ts:68

Keyboard shortcut in normalized form. Keys: meta, ctrl, alt, shift + key name (lowercase). Examples: "meta+c", "meta+shift+n", "f2", "meta+backspace"


showInContextMenu?

optional showInContextMenu?: boolean;

Defined in: module-registry/module-registry.types.ts:70

Show this action in the right-click context menu. Default: true.

On this page