From ee49bcd5a3c64901f871cfc24ee9fffd6a0f11bc Mon Sep 17 00:00:00 2001 From: Bruno Bornsztein Date: Sat, 10 Jan 2026 08:52:38 -0500 Subject: [PATCH] Hide execute and retry commands when task is processing - Hide 'x' (execute) and 'r' (retry) keys from detail view help bar when task status is 'processing' - Add guards to prevent execute/retry actions from being triggered when a task is already processing - Fix merge conflict in executor.go Co-Authored-By: Claude Opus 4.5 --- internal/executor/executor.go | 4 ---- internal/ui/app.go | 8 ++++++++ internal/ui/detail.go | 25 ++++++++++++++++++++++--- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 261d554e..de3de9b9 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -1549,11 +1549,7 @@ func (e *Executor) checkMergedBranches() { } // isBranchMerged checks if a task's branch has been merged into the default branch. -<<<<<<< Updated upstream // Uses git commands with a fetch to ensure we have the latest remote state. -======= -// Uses git commands to detect merged branches. ->>>>>>> Stashed changes func (e *Executor) isBranchMerged(task *db.Task) bool { projectDir := e.getProjectDir(task.Project) if projectDir == "" { diff --git a/internal/ui/app.go b/internal/ui/app.go index 6fc62b42..b4febcb7 100644 --- a/internal/ui/app.go +++ b/internal/ui/app.go @@ -825,6 +825,10 @@ func (m *AppModel) updateDashboard(msg tea.KeyMsg) (tea.Model, tea.Cmd) { case key.Matches(msg, m.keys.Queue): if task := m.kanban.SelectedTask(); task != nil { + // Don't allow queueing if task is already processing + if task.Status == db.StatusProcessing { + return m, nil + } // Immediately update UI for responsiveness task.Status = db.StatusQueued m.updateTaskInList(task) @@ -949,6 +953,10 @@ func (m *AppModel) updateDetail(msg tea.Msg) (tea.Model, tea.Cmd) { // Handle queue/close/retry from detail view if key.Matches(keyMsg, m.keys.Queue) && m.selectedTask != nil { + // Don't allow queueing if task is already processing + if m.selectedTask.Status == db.StatusProcessing { + return m, nil + } // Immediately update UI for responsiveness m.selectedTask.Status = db.StatusQueued if m.detailView != nil { diff --git a/internal/ui/detail.go b/internal/ui/detail.go index f1a5bb44..b662546f 100644 --- a/internal/ui/detail.go +++ b/internal/ui/detail.go @@ -716,7 +716,15 @@ func (m *DetailModel) renderHelp() string { desc string }{ {"↑/↓", "scroll"}, - {"x", "execute"}, + } + + // Only show execute when task is not currently processing + isProcessing := m.task != nil && m.task.Status == db.StatusProcessing + if !isProcessing { + keys = append(keys, struct { + key string + desc string + }{"x", "execute"}) } hasSession := m.hasActiveTmuxSession() @@ -735,12 +743,23 @@ func (m *DetailModel) renderHelp() string { }{"k", "kill"}) } + keys = append(keys, struct { + key string + desc string + }{"e", "edit"}) + + // Only show retry when task is not currently processing + if !isProcessing { + keys = append(keys, struct { + key string + desc string + }{"r", "retry"}) + } + keys = append(keys, []struct { key string desc string }{ - {"e", "edit"}, - {"r", "retry"}, {"c", "close"}, {"d", "delete"}, {"q/esc", "back"},