From 92b6e2a2819918a6938e125b809e63ef750aa774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl-Einar=20Bergstr=C3=B8m?= Date: Sun, 11 Oct 2026 23:47:10 +0200 Subject: [PATCH] feat: show and hide in the help bar, the same width so it doesn't shift Co-Authored-By: Claude Opus 5.5 (1M context) --- internal/ui/app/app_test.go | 2 +- internal/ui/app/help.go | 5 +++-- internal/ui/app/layout_test.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/ui/app/app_test.go b/internal/ui/app/app_test.go index 740d0a0..db83bb1 100644 --- a/internal/ui/app/app_test.go +++ b/internal/ui/app/app_test.go @@ -988,7 +988,7 @@ func TestRebindingShowsEverywhere(t *testing.T) { if !strings.Contains(scr, "z to reveal") || strings.Contains(scr, "space to reveal") { t.Errorf("detail hint doesn't follow the binding:\n%s", scr) } - if !strings.Contains(lastLine(scr), "z reveal") || strings.Contains(lastLine(scr), "reveal/hide") { + if !strings.Contains(lastLine(scr), "z show") { t.Errorf("help bar: %q", lastLine(scr)) } d.keys("z") diff --git a/internal/ui/app/help.go b/internal/ui/app/help.go index be91acd..a405f91 100644 --- a/internal/ui/app/help.go +++ b/internal/ui/app/help.go @@ -39,7 +39,8 @@ type contextHelp struct { account bool // the fourth pane shows Fields (fields.go) of pane // what the fourth pane describes // revealed, when set, says whether the selected value is shown, so - // the reveal key says just what it'll do: reveal or hide. + // the reveal key says just what it'll do: show or hide, the same + // width so the bar doesn't shift. revealed *bool } @@ -68,7 +69,7 @@ func (c contextHelp) ShortHelp() []key.Binding { default: reveal := k.Reveal if c.revealed != nil { - reveal = key.NewBinding(key.WithKeys(k.Reveal.Keys()...), key.WithHelp(k.Reveal.Help().Key, map[bool]string{false: "reveal", true: "hide"}[*c.revealed])) + reveal = key.NewBinding(key.WithKeys(k.Reveal.Keys()...), key.WithHelp(k.Reveal.Help().Key, map[bool]string{false: "show", true: "hide"}[*c.revealed])) } b = append(b, reveal, k.Copy, k.Share, k.ShareMenu, k.Versions, k.Favourite, k.Filter) } diff --git a/internal/ui/app/layout_test.go b/internal/ui/app/layout_test.go index 72245a6..5c6becb 100644 --- a/internal/ui/app/layout_test.go +++ b/internal/ui/app/layout_test.go @@ -136,7 +136,7 @@ func TestLayoutIsSaved(t *testing.T) { func TestContextHelpBar(t *testing.T) { t.Parallel() d := newDriver(t) - if bar := lastLine(d.screen()); !strings.Contains(bar, "S share") || !strings.HasSuffix(strings.TrimSpace(bar), "? help • q quit") || strings.Contains(bar, "space reveal") { + if bar := lastLine(d.screen()); !strings.Contains(bar, "S share") || !strings.HasSuffix(strings.TrimSpace(bar), "? help • q quit") || strings.Contains(bar, "space show") { t.Errorf("Sources help bar: %q", bar) } d.keys("3") -- 2.54.0