From c0f685f498c54c98b26a5f9956bdaf9a01f831da Mon Sep 17 00:00:00 2001 From: patriceckhart Date: Sat, 18 Apr 2026 11:31:06 +0200 Subject: [PATCH] tui: show /help at the bottom of the transcript instead of the top the help block was prepended to the chat, which pushed any existing conversation off the top of the viewport on anything but the shortest sessions. appending it (with scrollOffset=0 so the viewport sticks to the bottom) means /help is always visible right above the editor, exactly where the user's eye is already looking. login / model / sessions dialogs already render in the bottom-sticky band between chat and editor, so they weren't affected. --- internal/agent/modes/interactive.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/agent/modes/interactive.go b/internal/agent/modes/interactive.go index e5633eb..1bf1e53 100644 --- a/internal/agent/modes/interactive.go +++ b/internal/agent/modes/interactive.go @@ -349,9 +349,12 @@ func (i *Interactive) redraw() { chat = append(welcomeBanner(i.cfg.Theme), chat...) } - // /help block: rendered above the welcome / transcript when active. + // /help block: appended to the transcript so it appears at the + // bottom of the chat area (right above the status bar / editor). + // Prepending it would push long conversations off the top of the + // viewport, which users would miss entirely. if len(i.helpBlock) > 0 { - chat = append(append([]string(nil), i.helpBlock...), chat...) + chat = append(chat, i.helpBlock...) } if i.statusOK != "" { @@ -716,6 +719,10 @@ func (i *Interactive) runSlash(ctx context.Context, cmd string) (done bool) { i.helpBlock = renderHelpBlock(i.cfg.Theme, i.lastCols()) i.statusErr = "" i.statusOK = "" + // Pin the viewport to the newest content so the help block, + // which we just appended to the end of the transcript, is + // what the user actually sees. + i.scrollOffset = 0 i.mu.Unlock() case "/login": i.dialog.Open()