From d311a3ca4a3b3344acb0a45664dd1a2a8c9becb5 Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Sun, 4 Oct 2026 01:18:45 +0200 Subject: [PATCH] Show the version top right on every screen Co-Authored-By: Claude Opus 5.5 (1M context) --- internal/cli/tui_actions_test.go | 14 ++++++++++++++ internal/cli/tui_frame.go | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/cli/tui_actions_test.go b/internal/cli/tui_actions_test.go index 9383313..794ef3b 100644 --- a/internal/cli/tui_actions_test.go +++ b/internal/cli/tui_actions_test.go @@ -17,6 +17,7 @@ import ( "gitea.mynodes.xyz/ilker/llmgw/internal/control/modelserve" "gitea.mynodes.xyz/ilker/llmgw/internal/modelplan" "gitea.mynodes.xyz/ilker/llmgw/internal/store" + "gitea.mynodes.xyz/ilker/llmgw/internal/version" ) type seen struct { @@ -449,3 +450,16 @@ func TestTabAndArrowsGoRoundAFormFromApplyWithoutFalling(t *testing.T) { t.Fatalf("focus %+v", f) } } + +func TestEveryScreenShowsTheVersionTopRight(t *testing.T) { + m, _ := consoleWith(t, cNodes) + first := strings.Split(m.View(), "\n")[0] + if !strings.Contains(first, version.Version) { + t.Errorf("the console's top line: %q", first) + } + d := docsModel{v: newDocViewer(), width: 100, height: 30} + d.v.show(0) + if first := strings.Split(d.View(), "\n")[0]; !strings.Contains(first, version.Version) { + t.Errorf("the manual's top line: %q", first) + } +} diff --git a/internal/cli/tui_frame.go b/internal/cli/tui_frame.go index 5786e0e..3eedb0c 100644 --- a/internal/cli/tui_frame.go +++ b/internal/cli/tui_frame.go @@ -3,6 +3,7 @@ package cli import ( "strings" + "gitea.mynodes.xyz/ilker/llmgw/internal/version" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/x/ansi" ) @@ -60,7 +61,12 @@ func (f frame) render() string { w, h := max(f.Width, 60), max(f.Height, 16) title := " " + f.Title - right := f.Where + " " + // The version on every screen, top right: which build is being looked + // at is the first question about anything it shows. + right := version.Version + " " + if f.Where != "" { + right = f.Where + " ยท " + right + } gap := max(1, w-ansi.StringWidth(title)-ansi.StringWidth(right)) bar := fBar.Render(title + strings.Repeat(" ", gap) + right)