Open failed runs from Home with a shortcut in both panels

This commit is contained in:
2026-10-09 18:59:45 +01:00
parent b2dce357ca
commit 9b8afc874f
6 changed files with 118 additions and 4 deletions
+9 -1
View File
@@ -80,7 +80,7 @@ func (k keyMap) ShortHelp() []key.Binding {
if k.detail {
return []key.Binding{k.commands, k.search, key.NewBinding(key.WithKeys("n", "p"), key.WithHelp("n/p", "next/prev stage")), key.NewBinding(key.WithKeys("tab"), key.WithHelp("Tab", "pane")), key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "runs")), key.NewBinding(key.WithKeys("j", "k"), key.WithHelp("j/k", "scroll")), key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "home"))}
}
return []key.Binding{k.commands, k.search, k.create, key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "drafts")), key.NewBinding(key.WithKeys("b"), key.WithHelp("b", "templates")), k.ping, k.quit}
return []key.Binding{k.commands, k.search, k.create, key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "failed runs")), key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "drafts")), key.NewBinding(key.WithKeys("b"), key.WithHelp("b", "templates")), k.ping, k.quit}
}
func (k keyMap) FullHelp() [][]key.Binding { return [][]key.Binding{k.ShortHelp()} }
@@ -150,6 +150,7 @@ type Model struct {
runCollapsed map[string]bool
runError string
runPipelineID int64
runFailedOnly bool
runSpinner spinner.Model
templates []protocol.Template
templateOpen, templateRaw bool
@@ -463,6 +464,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m.updateTemplates(msg)
}
switch {
case m.homePage() && msg.String() == "r":
m.closeRuns()
m.runFailedOnly = true
m.runOpen = true
m.keys.runs = true
m.runIndex = 0
return m.runRequest(protocol.Message{Type: protocol.ListRuns})
case m.homePage() && msg.String() == "d":
return m.openDrafts()
case m.homePage() && msg.String() == "b":