Improve workflow UI, retain stage diffs, and add portable pipeline transfers
Make OpenCode authoring responsive and expand the managed skill references. Add conflict-aware import/export, real-provider reference workflows, and tracked V2 generation for reliable budget accounting.
This commit is contained in:
+29
-9
@@ -6,6 +6,7 @@ import (
|
||||
"git.a-wan.net/alan/pipelines/internal/statusview"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/charmbracelet/x/ansi"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -42,7 +43,7 @@ func (m Model) updateStatus(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
||||
case "pgup":
|
||||
m.statusTop -= max(1, m.height-10)
|
||||
}
|
||||
m.statusTop = max(0, min(m.statusTop, max(0, len(m.statusLines())-max(1, m.height-9))))
|
||||
m.statusTop = max(0, min(m.statusTop, max(0, len(m.statusContent())-max(1, m.height-4))))
|
||||
return m, nil
|
||||
}
|
||||
func (m Model) statusLines() []string {
|
||||
@@ -62,7 +63,7 @@ func (m Model) statusLines() []string {
|
||||
}
|
||||
return lines
|
||||
}
|
||||
func (m Model) statusView(height int) string {
|
||||
func (m Model) statusContent() []string {
|
||||
server, ntfy := statusview.ServerLines(m.systemStatus), statusview.NtfyLines(m.systemStatus)
|
||||
if m.systemStatus == nil && m.statusError != "" {
|
||||
s := statusview.Offline(m.url)
|
||||
@@ -75,14 +76,33 @@ func (m Model) statusView(height int) string {
|
||||
server = append([]string{m.loading("Checking…")}, server...)
|
||||
}
|
||||
width := m.width
|
||||
wrap := func(lines []string, w int) []string {
|
||||
var rows []string
|
||||
for _, line := range lines {
|
||||
rows = append(rows, strings.Split(ansi.Wrap(line, max(1, w), ""), "\n")...)
|
||||
}
|
||||
return rows
|
||||
}
|
||||
if width >= 100 {
|
||||
w := (width - 2) / 2
|
||||
left := panel(w, max(4, height-2), []string{"Pipelines server"}, server, "", false)
|
||||
right := panel(width-w-2, max(4, height-2), []string{"ntfy · phone connection"}, ntfy, "", false)
|
||||
return fitBlock(append(strings.Split(lipgloss.JoinHorizontal(lipgloss.Top, left, " ", right), "\n"), "", "r refresh · Esc close"), width, height)
|
||||
server, ntfy = wrap(server, w-4), wrap(ntfy, width-w-6)
|
||||
cardHeight := max(len(server), len(ntfy)) + 4
|
||||
left := panel(w, cardHeight, []string{"Pipelines server"}, server, "", false)
|
||||
right := panel(width-w-2, cardHeight, []string{"ntfy · phone connection"}, ntfy, "", false)
|
||||
return strings.Split(lipgloss.JoinHorizontal(lipgloss.Top, left, " ", right), "\n")
|
||||
}
|
||||
topHeight := max(4, (height-2)/2)
|
||||
left := panel(width, topHeight, []string{"Pipelines server"}, server, "", false)
|
||||
right := panel(width, max(4, height-topHeight-2), []string{"ntfy · phone connection"}, ntfy, "", false)
|
||||
return fitBlock(append(strings.Split(left+"\n"+right, "\n"), "r refresh · Esc close"), width, height)
|
||||
server, ntfy = wrap(server, width-4), wrap(ntfy, width-4)
|
||||
left := panel(width, len(server)+4, []string{"Pipelines server"}, server, "", false)
|
||||
right := panel(width, len(ntfy)+4, []string{"ntfy · phone connection"}, ntfy, "", false)
|
||||
return strings.Split(left+"\n\n"+right, "\n")
|
||||
}
|
||||
|
||||
func (m Model) statusView(height int) string {
|
||||
lines := m.statusContent()
|
||||
top := max(0, min(m.statusTop, max(0, len(lines)-height)))
|
||||
visible := append([]string{}, lines[top:min(len(lines), top+height)]...)
|
||||
if top+height < len(lines) && len(visible) > 0 {
|
||||
visible[len(visible)-1] = bar("↓ More connection details", fmt.Sprintf("%d–%d / %d", top+1, top+height, len(lines)), m.width, false)
|
||||
}
|
||||
return fitBlock(visible, m.width, height)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user