Skip to content

@jsvision/ui / MenuLoopSeam

Interface: MenuLoopSeam ​

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

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

Methods ​

commandsVersion() ​

commandsVersion(): number

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

A tick that changes on any command-enablement change; the bar binds it so greying repaints live.

Returns ​

number


dismissAccelerators()? ​

optional dismissAccelerators(): void

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

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:23

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:29

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:31

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:25

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

Parameters ​

command ​

string

Returns ​

boolean