Skip to content

InteractionService should expose InteractionInput-based APIs for requesting confirmation #10049

Open
@captainsafia

Description

@captainsafia

The InteractionService currently models requests for confirmation as MessageBoxInteractions.

public async Task<InteractionResult<bool>> PromptConfirmationAsync(string title, string message, MessageBoxInteractionOptions? options = null, CancellationToken cancellationToken = default)
{
options ??= MessageBoxInteractionOptions.CreateDefault();
options.Intent = MessageIntent.Confirmation;
options.ShowDismiss ??= false;
options.ShowSecondaryButton ??= true;
return await PromptMessageBoxCoreAsync(title, message, options, cancellationToken).ConfigureAwait(false);
}

We should consider modeling confirmation as an InputInteraction and add confirmation to the InputType enum to make the implementation play more nicely with CLI-based UIs where both confirmations and text-based inputs flow through the same pipeline.

Related to this, we should consider renaming certain APIs (like InputsDialogInteractionOptions) to remove assumptions about the type of UI that is used to present an interaction.

cc: @JamesNK @mitchdenny

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions