Skip to content

[plan] Replace bare prompt in remove_command.go with console.ConfirmAction() #11624

@github-actions

Description

@github-actions

Objective

Replace the manual prompt/scanln pattern in remove_command.go with the proper console.ConfirmAction() helper for consistency and better UX.

Context

From discussion #11611: The remove_command.go file uses a bare prompt (fmt.Print + fmt.Scanln) instead of the Huh-based console.ConfirmAction() wrapper.

Current Issue: remove_command.go:118 uses manual prompt handling instead of the standardized console helper.

Approach

  1. Locate the prompt code around line 118 in pkg/cli/remove_command.go

  2. Replace with console.ConfirmAction():

    • Use existing console package function
    • Provide clear question text
    • Handle error case properly
  3. Test the change:

    • Verify interactive prompt works
    • Test with and without TTY
    • Ensure accessibility mode is respected

Files to Modify

  • Update: pkg/cli/remove_command.go (line ~118)

Implementation Example

// Before (remove_command.go:118):
fmt.Print("Are you sure you want to remove the workflow? (yes/no): ")
var response string
fmt.Scanln(&response)
if response != "yes" {
    return fmt.Errorf("workflow removal cancelled")
}

// After:
confirmed, err := console.ConfirmAction(
    "Remove workflow?",
    "Yes, remove",
    "No, cancel",
)
if err != nil {
    return fmt.Errorf("failed to get confirmation: %w", err)
}
if !confirmed {
    return fmt.Errorf("workflow removal cancelled")
}

Acceptance Criteria

  • Manual prompt replaced with console.ConfirmAction()
  • Error handling properly implemented
  • Interactive prompt works in terminal
  • Accessibility mode is respected
  • Code passes make fmt and make lint
  • make agent-finish completes successfully

Priority

Phase 1: Critical Fix (1-2 hours estimated)

AI generated by Plan Command for discussion #11611

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions