Expand pipeline panes and select the verified Docker client endpoint

This commit is contained in:
2026-10-10 00:56:55 +01:00
parent 2cc703b8a5
commit 7565693957
13 changed files with 352 additions and 8 deletions
+6 -4
View File
@@ -19,10 +19,12 @@ type paneGeometry struct {
func (m Model) pipelineGeometry(height int) paneGeometry {
remaining := max(0, height-3)
if remaining >= 15 {
bottom := remaining / 2
graph := remaining * 3 / 4
if m.stageFocus {
bottom = remaining - max(6, remaining/3)
graph = remaining / 4
}
graph = max(6, min(remaining-8, graph))
bottom := remaining - graph
return paneGeometry{graphWidth: m.width, graphHeight: remaining - bottom, stageWidth: m.width, stageHeight: bottom}
}
if m.stageFocus {
@@ -203,7 +205,7 @@ func graphViewport(label string, lines []string, width, height, scrollTop, pan i
if pan+inner < graphWidth {
label += " →"
}
headers := []string{bar(label, fmt.Sprintf("%d–%d / %d", min(top+1, len(lines)), end, len(lines)), inner, focused), ""}
headers := []string{runPaneTitle(strings.TrimPrefix(label, "▸ "), fmt.Sprintf("%d–%d / %d", min(top+1, len(lines)), end, len(lines)), inner, focused), ""}
if graphWidth > inner {
footer = "←/→ pan · " + footer
}
@@ -418,7 +420,7 @@ func (m Model) stagePanel(width, height int) string {
if m.stageFocus {
label = "▸ " + label
}
headers := []string{bar(label, fmt.Sprintf("%d / %d · rows %d–%d/%d", m.stageIndex+1, len(m.detail.Graph.Stages), min(top+1, len(lines)), min(len(lines), top+rows), len(lines)), inner, m.stageFocus), m.stageTabs(inner), columns}
headers := []string{runPaneTitle(strings.TrimPrefix(label, "▸ "), fmt.Sprintf("%d / %d · rows %d–%d/%d", m.stageIndex+1, len(m.detail.Graph.Stages), min(top+1, len(lines)), min(len(lines), top+rows), len(lines)), inner, m.stageFocus), m.stageTabs(inner), columns}
return panel(width, height, headers, lines[top:min(len(lines), top+rows)], "n/p stage · Tab pane · j/k scroll · PgUp/Dn page", m.stageFocus)
}
+19
View File
@@ -129,6 +129,25 @@ func TestPanelResponsiveLayout(t *testing.T) {
}
}
func TestPipelineTabExpandsFocusedPane(t *testing.T) {
m := panelModel(t)
m.width, m.height = 120, 48
g := m.pipelineGeometry(44)
if g.graphHeight <= g.stageHeight*2 {
t.Fatal("pipeline graph does not occupy most height", g)
}
m = press(m, "tab")
g = m.pipelineGeometry(44)
if !m.stageFocus || g.stageHeight <= g.graphHeight*2 {
t.Fatal("pipeline stage pane did not expand", g)
}
m = press(m, "tab")
g = m.pipelineGeometry(44)
if m.stageFocus || g.graphHeight <= g.stageHeight*2 {
t.Fatal("pipeline graph did not re-expand", g)
}
}
func TestStageCapabilitiesAndScrolledHeadings(t *testing.T) {
m := panelModel(t)
m.detail.Graph.Stages[0].Notify = &protocol.NotificationPolicy{On: []string{"failure"}, Destination: "system"}