Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

The trial command's confirmation prompt used manual fmt.Scanln handling instead of the standard console helper, creating inconsistency with other commands.

Changes

  • Replaced fmt.Scanln with console.ConfirmAction in showTrialConfirmation function
  • Removed manual response parsing and validation logic (~10 lines)
  • Updated error handling to wrap ConfirmAction errors properly

Before:

fmt.Fprint(os.Stderr, console.FormatPromptMessage("Do you want to continue? [y/N]: "))
var response string
_, err := fmt.Scanln(&response)
if err != nil {
    response = "n"
}
response = strings.ToLower(strings.TrimSpace(response))
if response != "y" && response != "yes" {
    return fmt.Errorf("trial cancelled by user")
}

After:

confirmed, err := console.ConfirmAction(
    "Do you want to continue?",
    "Yes, proceed",
    "No, cancel",
)
if err != nil {
    return fmt.Errorf("confirmation failed: %w", err)
}
if !confirmed {
    return fmt.Errorf("trial cancelled by user")
}

This provides interactive Bubble Tea UI with automatic accessibility mode support, matching the pattern used in run_push.go.

Original prompt

Update trial command user interactive prompt to use console helpers instead


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 6, 2026
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update trial command user interactive prompt with console helpers Replace manual prompt handling with console.ConfirmAction in trial command Jan 6, 2026
Copilot AI requested a review from pelikhan January 6, 2026 06:58
@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 06:59
@pelikhan pelikhan merged commit e7bde51 into main Jan 6, 2026
169 checks passed
@pelikhan pelikhan deleted the copilot/update-trial-command-prompt branch January 6, 2026 07:00
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.

2 participants