Show the version top right on every screen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 01:18:45 +02:00
1 parent 7cb9d4fa01
commit d311a3ca4a
2 files changed
+21 -1

No files matched your search

+14
View File
@@ -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)
}
}
+7 -1
View File
@@ -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)