Fix sidebar repaint and command restart navigation

This commit is contained in:
2026-05-14 22:41:24 +01:00
parent 83eb4f6b2d
commit 2f969fa215
9 changed files with 247 additions and 29 deletions

View File

@@ -192,9 +192,6 @@ func currentTabFlat(children []*Child, focusID string) []*Child {
func sidebarNavList(children []*Child, activeAgentID string) []*Child {
out := make([]*Child, 0, 8)
for _, c := range processList(children) {
if c.Status() != StatusRunning {
continue
}
out = append(out, c)
}
for _, c := range visibleAgentTree(children, activeAgentID) {
@@ -208,9 +205,15 @@ func sidebarNavList(children []*Child, activeAgentID string) []*Child {
// wrapping at both ends. Empty when there's nothing else to land on.
func nextChildID(children []*Child, focusID, activeAgentID string, step int) string {
flat := sidebarNavList(children, activeAgentID)
if len(flat) < 2 {
if len(flat) == 0 {
return ""
}
if len(flat) == 1 {
if flat[0].ID == focusID {
return ""
}
return flat[0].ID
}
idx := -1
for i, c := range flat {
if c.ID == focusID {