From 534ef0df87f0f26c6211ada1ea8bd53c65acc1e8 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 24 Dec 2024 17:17:59 +0200 Subject: [PATCH] Implemented g to go to the top message and shift+g/enter to go to the bottom --- internal/client/ui/core/chat/chat.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index b3f6dec..f2b0362 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -170,6 +170,16 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { m.Scroll(m.messagesHeight / 2) case "ctrl+d": m.Scroll(-m.messagesHeight / 2) + case "g": + // HACK: hacky way to scroll to the top + // Also for the first time a user scrolls there will be a visual + // glitch that doesn't show the top message being selected + m.Scroll(10000) // Large numbers can slow this!!!! + case "G": + fallthrough + case "enter": + m.offset = SnapToBottom + m.index = -1 } }