Skip to content

FEAT: Plugin API - multi-field prompts and confirm dialogs #514

@andrinoff

Description

@andrinoff

Is your feature request related to a problem?

matcha.prompt() only supports a single text input field. Plugins that need multi-step configuration (e.g. API key + model selection, or multiple form fields) must chain multiple prompts sequentially, which is awkward UX. There's also no way to ask a simple yes/no confirmation question.

Describe the solution you'd like

At minimum, add a confirm dialog:

matcha.confirm("Are you sure you want to proceed?", function(yes)
    if yes then
        -- do the thing
    end
end)

Ideally, also support multi-field prompts:

matcha.prompt_fields({
    {name = "api_key", placeholder = "Enter API key"},
    {name = "model", placeholder = "Model name (default: gpt-4)"},
}, function(fields)
    local key = fields.api_key
    local model = fields.model
end)

Describe alternatives you've considered

Chaining multiple matcha.prompt() calls in nested callbacks. This works but creates deeply nested callback hell and poor UX (multiple sequential popups).

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions