diff --git a/cli/pkg/cli/output/input_model.go b/cli/pkg/cli/output/input_model.go index a8a240d4..0cb8f007 100644 --- a/cli/pkg/cli/output/input_model.go +++ b/cli/pkg/cli/output/input_model.go @@ -61,6 +61,7 @@ type InputModel struct { // For approval type approvalOptions []string selectedOption int + pendingApproval bool // Stores approval decision when transitioning to feedback input // Styles (huh-inspired theme) styles fieldStyles @@ -299,6 +300,8 @@ func (m *InputModel) handleSubmit() (tea.Model, tea.Cmd) { needsFeedback := strings.Contains(selected, "feedback") if needsFeedback { + // Store the approval decision before switching to feedback input + m.pendingApproval = approved // Switch to feedback input return m, func() tea.Msg { return ChangeInputTypeMsg{ @@ -324,6 +327,7 @@ func (m *InputModel) handleSubmit() (tea.Model, tea.Cmd) { return InputSubmitMsg{ Value: value, InputType: InputTypeFeedback, + Approved: m.pendingApproval, // Pass the stored approval decision } } } @@ -439,6 +443,7 @@ func (m *InputModel) Clone() *InputModel { lastHeight: m.lastHeight, approvalOptions: m.approvalOptions, selectedOption: m.selectedOption, + pendingApproval: m.pendingApproval, // Preserve approval decision styles: m.styles, } diff --git a/cli/pkg/cli/task/input_handler.go b/cli/pkg/cli/task/input_handler.go index a7780f99..06809281 100644 --- a/cli/pkg/cli/task/input_handler.go +++ b/cli/pkg/cli/task/input_handler.go @@ -352,6 +352,7 @@ func (ih *InputHandler) runInputProgram(ctx context.Context, model output.InputM case output.InputTypeFeedback: // This came from approval flow ih.feedbackApproval = true + ih.feedbackApproved = result.Approved // Use the approval decision from the feedback return result.Value, true, nil }