Skip to content

@jsvision/ui / MenuLoopSeam

Interface: MenuLoopSeam

Defined in: ui/src/menu/controller.ts:20

The application-level operations the controller calls into for activation, greying, and focus.

Methods

dismissAccelerators()?

optional dismissAccelerators(): void

Defined in: ui/src/menu/controller.ts:34

Turn off the accelerator-hint overlay when a menu opens. Optional — a bare event loop without the full app shell omits it. An open menu owns plain letter keys (for item hotkeys), so the overlay must not also intercept them; the controller calls this on every open path.

Returns

void


emitCommand()

emitCommand(command, arg?): void

Defined in: ui/src/menu/controller.ts:22

Emit the activated item's command so the app can handle it.

Parameters

command

string

arg?

unknown

Returns

void


focusView()

focusView(view): void

Defined in: ui/src/menu/controller.ts:26

Focus a view — used to restore the pre-menu focus when the menu closes.

Parameters

view

View

Returns

void


getFocused()

getFocused(): View | null

Defined in: ui/src/menu/controller.ts:28

The currently-focused view, captured when a menu opens so it can be restored on close.

Returns

View | null


isCommandEnabled()

isCommandEnabled(command): boolean

Defined in: ui/src/menu/controller.ts:24

Whether a command is enabled — a disabled item is greyed and cannot be activated.

Parameters

command

string

Returns

boolean