Files
zero/internal/tui/plan_command.go
Vasanth T 37f3cc17a5 feat: advance Go-first TUI and npm wrapper (#57)
* feat: advance Go-first TUI and npm wrapper

* fix: address wrapper and footer review feedback

* feat: deepen Go TUI model and exec controls

* fix: address coderabbit exec and model list feedback
2026-06-04 20:59:06 +05:30

41 lines
769 B
Go

package tui
import (
"fmt"
"strings"
"github.com/Gitlawb/zero/internal/tools"
)
type currentPlanReader interface {
CurrentPlan() []tools.PlanItem
}
func (m model) planText() string {
tool, ok := m.registry.Get("update_plan")
if !ok {
return "No plan is active."
}
reader, ok := tool.(currentPlanReader)
if !ok {
return "No plan is active."
}
plan := reader.CurrentPlan()
if len(plan) == 0 {
return "No plan is active."
}
lines := make([]string, 0, len(plan)+1)
lines = append(lines, "Current Plan")
for index, item := range plan {
line := fmt.Sprintf("%d. [%s] %s", index+1, item.Status, item.Content)
if item.Notes != "" {
line += "\n Notes: " + item.Notes
}
lines = append(lines, line)
}
return strings.Join(lines, "\n")
}