Commit 4dce36e

Eric Bower  ·  2026-01-16 22:41:06 -0500 EST
parent 2340a56
fix(tui.access_logs): start at last access with cmds to go to top or bot list
1 files changed,  +17, -1
+17, -1
......@@ -40,6 +40,8 @@ func (m *AccessLogsPage) Footer() []Shortcut {
4040 return []Shortcut{
4141 {Shortcut: "tab", Text: "focus"},
4242 {Shortcut: "^r", Text: "refresh"},
43+ {Shortcut: "g", Text: "top"},
44+ {Shortcut: "G", Text: "bottom"},
4345 }
4446 }
4547
......@@ -72,7 +74,7 @@ func (m *AccessLogsPage) filterLogs() {
7274 m.filtered = filtered
7375
7476 if len(filtered) > 0 {
75- m.list.SetCursor(0)
77+ m.list.SetCursor(uint(len(filtered) - 1))
7678 }
7779 }
7880
......@@ -121,6 +123,20 @@ func (m *AccessLogsPage) HandleEvent(ev vaxis.Event, phase vxfw.EventPhase) (vxf
121123 go m.fetchLogs()
122124 return vxfw.RedrawCmd{}, nil
123125 }
126+ if msg.Matches('g') {
127+ // Go to top
128+ if len(m.filtered) > 0 {
129+ m.list.SetCursor(0)
130+ return vxfw.RedrawCmd{}, nil
131+ }
132+ }
133+ if msg.Matches('G') {
134+ // Go to bottom
135+ if len(m.filtered) > 0 {
136+ m.list.SetCursor(uint(len(m.filtered) - 1))
137+ return vxfw.RedrawCmd{}, nil
138+ }
139+ }
124140 }
125141 return nil, nil
126142 }