Skip to content

feat: abstract user prompts behind a generic prompt backend trait#499

Open
pullfrog[bot] wants to merge 2 commits intomasterfrom
pullfrog/0-abstract-prompt-backend
Open

feat: abstract user prompts behind a generic prompt backend trait#499
pullfrog[bot] wants to merge 2 commits intomasterfrom
pullfrog/0-abstract-prompt-backend

Conversation

@pullfrog
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot commented Apr 14, 2026

What changed

  • introduced a generic PromptBackend trait in src/tui.rs that abstracts all interactive input operations used by command flows
  • added TuiPromptBackend as the default implementation and routed existing prompt helpers through a backend dispatcher
  • added with_prompt_backend(...) to temporarily swap prompt implementations for alternate UIs such as GUI integrations
  • centralized secret input behind prompt_secret_non_empty(...) and updated encrypt passkey confirmation to use the backend abstraction

Why

This allows the same command flows to run with TUI prompts today and makes it straightforward to plug in GUI prompt implementations without duplicating flow logic.

Verification

  • cargo fmt
  • cargo check
  • cargo test prompt_char_tests

Pullfrog  | View workflow run | Triggered by Pullfrog | Using GPT Codex𝕏

@pullfrog pullfrog Bot requested a review from dyc3 April 14, 2026 21:05
Comment thread src/tui.rs Outdated
Comment thread src/tui.rs Outdated
@pullfrog
Copy link
Copy Markdown
Contributor Author

pullfrog Bot commented Apr 14, 2026

Addressed the requested review changes on PR #499 by moving PromptBackend into a new module and redesigning it around GUI friendly abstractions (prompt_text, choose, select_confirmations, prompt_secret) while removing pause from the trait. Pushed commit fb9c608 to pullfrog/0-abstract-prompt-backend, replied to both review comments, and resolved both threads. Validation passed with cargo check and cargo test prompt_char_tests.

Task list (6/6 completed)

Pullfrog  | View workflow run | Triggered by Pullfrog | Using GPT Codex𝕏

@dyc3 dyc3 changed the title Abstract user prompts behind a generic prompt backend trait feat: abstract user prompts behind a generic prompt backend trait Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant