Approval menu using standard Textual patterns.
Key design decisions (following mistral-vibe reference):
ApprovalMenu(
self,
action_requests: list[dict[str, Any]] | dict[str, Any],
_assistant_id: str | None = None,
id: str | None = None,
**kwargs: Any = {}
)Container| Name | Type | Description |
|---|---|---|
action_requests* | list[dict[str, Any]] | dict[str, Any] | A single action request dictionary or a list of action request dictionaries requiring approval. Each dictionary should contain 'name' (tool name) and 'args' (tool arguments). |
_assistant_id | str | None | Default: NoneOptional assistant ID (currently unused, reserved for future use). |
id | str | None | Default: NoneOptional widget ID. Defaults to 'approval-menu'. |
**kwargs | Any | Default: {}Additional keyword arguments passed to the Container base class. |
Set the future to resolve when user decides.
Compose the widget with Static children.
Layout: Tool info first (what's being approved), then options at bottom. For bash/shell, skip tool info since it's already shown in tool call.
Focus self on mount and update tool info.
Move selection up.
Move selection down.
Select current option.
Select approve option.
Select reject option.
Select auto-approve option.
Toggle shell command expansion.
Re-focus on blur to keep focus trapped until decision is made.