repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
4dce36e
parent
2340a56
author
Eric Bower
date
2026-01-16 22:41:06 -0500 EST
fix(tui.access_logs): start at last access with cmds to go to top or bot list
1 files changed,  +17, -1
M pkg/tui/access_logs.go
+17, -1
 1@@ -40,6 +40,8 @@ func (m *AccessLogsPage) Footer() []Shortcut {
 2 	return []Shortcut{
 3 		{Shortcut: "tab", Text: "focus"},
 4 		{Shortcut: "^r", Text: "refresh"},
 5+		{Shortcut: "g", Text: "top"},
 6+		{Shortcut: "G", Text: "bottom"},
 7 	}
 8 }
 9 
10@@ -72,7 +74,7 @@ func (m *AccessLogsPage) filterLogs() {
11 	m.filtered = filtered
12 
13 	if len(filtered) > 0 {
14-		m.list.SetCursor(0)
15+		m.list.SetCursor(uint(len(filtered) - 1))
16 	}
17 }
18 
19@@ -121,6 +123,20 @@ func (m *AccessLogsPage) HandleEvent(ev vaxis.Event, phase vxfw.EventPhase) (vxf
20 			go m.fetchLogs()
21 			return vxfw.RedrawCmd{}, nil
22 		}
23+		if msg.Matches('g') {
24+			// Go to top
25+			if len(m.filtered) > 0 {
26+				m.list.SetCursor(0)
27+				return vxfw.RedrawCmd{}, nil
28+			}
29+		}
30+		if msg.Matches('G') {
31+			// Go to bottom
32+			if len(m.filtered) > 0 {
33+				m.list.SetCursor(uint(len(m.filtered) - 1))
34+				return vxfw.RedrawCmd{}, nil
35+			}
36+		}
37 	}
38 	return nil, nil
39 }