mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-12 08:41:32 -10:00
* 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
41 lines
769 B
Go
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")
|
|
}
|