From c728033436a125b50a61900b7e0ffcf15ef258df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl-Einar=20Bergstr=C3=B8m?= Date: Mon, 12 Oct 2026 08:56:29 +0200 Subject: [PATCH] fix: no cursor on the versions in a secret's details: they're read, not moved in Co-Authored-By: Claude Opus 5.5 (1M context) --- internal/ui/app/app_test.go | 9 ++++++--- internal/ui/panes/detail.go | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/internal/ui/app/app_test.go b/internal/ui/app/app_test.go index 0a104a1..79be8ed 100644 --- a/internal/ui/app/app_test.go +++ b/internal/ui/app/app_test.go @@ -494,14 +494,17 @@ func TestVersionHistoryInDetail(t *testing.T) { screen := d.screen() for _, want := range []string{ "versions 3 · v to browse", - "▸ 3f9c2a 2026-09-01 current", // the version shown above - " 91d3e0 2026-03-01 expired", - " 0a77c4 2025-09-01 disabled", + " 3f9c2a 2026-09-01 current", + " 91d3e0 2026-03-01 expired", + " 0a77c4 2025-09-01 disabled", } { if !strings.Contains(screen, want) { t.Errorf("missing %q:\n%s", want, screen) } } + if strings.Contains(screen, "▸ 3f9c2a") { + t.Errorf("a cursor on a list that can't be moved in:\n%s", screen) + } d.keys("3", "j") // api-key: only its current version if !strings.Contains(d.screen(), "versions 1") || strings.Contains(d.screen(), "v to browse") { t.Errorf("wrong history for api-key:\n%s", d.screen()) diff --git a/internal/ui/panes/detail.go b/internal/ui/panes/detail.go index 416df35..4876daf 100644 --- a/internal/ui/panes/detail.go +++ b/internal/ui/panes/detail.go @@ -362,11 +362,13 @@ func (d Detail) versionLines(st styles.Styles) []string { out = append(out, muted(fmt.Sprintf(" … %d more", len(d.versions)-i))) break } - marker := " " - if d.secret.Version != "" && v.Version == d.secret.Version { - marker = "▸ " // the version shown above + // A list to read, not to move in (v browses them): no cursor. The + // version shown above, when it isn't the current one, is named. + line := " " + VersionLine(st, v, d.Now(), current) + if d.secret.Version != "" && v.Version == d.secret.Version && v.Version != current { + line += muted(" · shown above") } - out = append(out, " "+marker+VersionLine(st, v, d.Now(), current)) + out = append(out, line) } return out }