Every workspace split into real panes: 19 panes across 7 workspaces, one program per panel

This commit is contained in:
Sam
2026-11-10 16:29:27 +11:00
parent 2640049f1f
commit 32fa2752af
19 changed files with 972 additions and 58 deletions

View File

@@ -27,6 +27,7 @@ type createdMsg struct {
}
type newTaskModel struct {
panel string
client *paperclip.Client
proj paperclip.Project
agent string
@@ -61,8 +62,8 @@ var fieldHints = []string{
"yes, to hand it to the configured agent after the blocker is set",
}
func newTaskForm(c *paperclip.Client, proj paperclip.Project, agentID string) newTaskModel {
m := newTaskModel{client: c, proj: proj, agent: agentID}
func newTaskForm(c *paperclip.Client, proj paperclip.Project, agentID, panel string) newTaskModel {
m := newTaskModel{client: c, proj: proj, agent: agentID, panel: panel}
for range fieldNames {
ti := textinput.New()
ti.Placeholder = ""
@@ -240,7 +241,39 @@ func (m newTaskModel) guidanceLines(width int) []string {
return out
}
// singleView is one panel filling the pane: the form, the guidance, or what
// will be sent. The form keeps the keyboard, because its letters are text.
func (m newTaskModel) singleView() string {
title := "new task"
var body []string
footer := ""
switch m.panel {
case "guidance":
title = "what a task needs"
body = m.guidanceLines(m.width - 3)
footer = hintLine([]string{keyHint("r", "nothing to read here"), keyHint("R", "rebuild")}, m.width)
case "preview":
title = "what will be sent"
body = m.previewLines(m.width - 3)
footer = hintLine([]string{keyHint("tab", "back to the form"), keyHint("R", "rebuild")}, m.width)
default:
body = m.formLines(m.width - 3)
footer = hintLine([]string{
keyHint("tab", "next field"),
keyHint("enter", "next, and create on the last"),
keyHint("esc", "cancel"),
}, m.width)
}
return singlePanel(title, nil, 0, body, m.width, m.height, footer, 0)
}
func (m newTaskModel) View() string {
if m.panel != "" {
if m.width == 0 {
return "reading…"
}
return m.singleView()
}
if m.width == 0 || m.height == 0 {
return "reading…"
}