gpui-kit GitHub

Components

ApprovalPrompt view

One request for permission, with the answer left to the caller.

A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).

use gpui_kit::agent::ApprovalPrompt;

Construct

new(ident: impl Into<Ident>, action: impl Into<SharedString>, _window: &mut Window, cx: &mut Context<Self>) -> Self

Options

Chain onto the value.

detail(detail: DescriptionItem) -> Self
details(details: impl IntoIterator<Item = DescriptionItem>) -> Self
always(scope: AlwaysScope) -> Self
status(status: ApprovalStatus) -> Self

Commands

Need a Context, so they need a view.

set_status(status: ApprovalStatus, cx: &mut Context<Self>)
approve(decision: ApprovalDecision, cx: &mut Context<Self>)
decline(cx: &mut Context<Self>)

Queries

Only answer; they change nothing.

current_status() -> &ApprovalStatus

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/agent/approval.rs