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

@@ -40,6 +40,7 @@ type layoutRow struct {
}
type repairModel struct {
panel string
client *paperclip.Client
folder string
@@ -58,8 +59,8 @@ type repairModel struct {
var repairTabs = []string{"health", "layout", "rebuild log"}
func newRepairModel(c *paperclip.Client, folder string) repairModel {
return repairModel{client: c, folder: folder}
func newRepairModel(c *paperclip.Client, folder, panel string) repairModel {
return repairModel{client: c, folder: folder, panel: panel}
}
func (m repairModel) Init() tea.Cmd {
@@ -254,7 +255,45 @@ func (m repairModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}
// singleView is one panel filling the pane: health, layout or the rebuild log.
func (m repairModel) singleView() string {
titles := map[string]string{"health": "checks", "layout": "the layout as TUIOS has it", "log": "the last rebuild"}
title := titles[m.panel]
if title == "" {
title = "checks"
}
var body []string
switch m.panel {
case "layout":
body = m.layoutLines()
case "log":
body = m.logLines()
default:
body = m.healthLines()
}
footer := hintLine([]string{
keyHint("↑↓ j k", "scroll"),
keyHint("R", "rebuild every pane"),
keyHint("B", "add missing panes"),
keyHint("r", "check again"),
keyHint("?", "keys"),
}, m.width)
if m.showHelp {
return helpOverlay(title, [][2]string{
{"R", "rebuild every pane"}, {"B", "add only the missing panes"},
{"↑ ↓ j k", "scroll"}, {"r", "check again"}, {"q", "leave"},
}, m.width, m.height)
}
return singlePanel(title, nil, 0, body, m.width, m.height, footer, m.scroll)
}
func (m repairModel) View() string {
if m.panel != "" {
if m.width == 0 {
return "checking…"
}
return m.singleView()
}
if m.width == 0 || m.height == 0 {
return "reading…"
}