fix(tui): prioritize gitcrawl footer controls

This commit is contained in:
Vincent Koc 2026-05-03 15:26:27 -07:00
parent 9223b22185
commit 0169da761a
No known key found for this signature in database
2 changed files with 24 additions and 3 deletions

View File

@ -2210,15 +2210,15 @@ func (m *model) keepMenuVisible() {
}
func footerControls(width int) string {
full := "Tab focus click select header sort right-click menu a actions o open c copy s sort m members v group d detail l layout r refresh wheel scroll / filter # jump ? help q quit"
full := "Tab focus click select right-click menu a actions header sort wheel scroll / filter # jump o open c copy s sort m members v group d detail r refresh l layout ? help q quit"
if lipgloss.Width(full) <= maxInt(1, width-2) {
return full
}
compact := "Tab focus click select right-click menu a actions o open c copy s sort m members v group d detail l layout r refresh / filter # jump ? help q quit"
compact := "Tab focus click select right-click menu a actions wheel scroll / filter # jump r refresh ? help q quit"
if lipgloss.Width(compact) <= maxInt(1, width-2) {
return compact
}
return "Tab panes click menu a actions o open c copy s sort m members v group d detail l layout r refresh / filter # jump ? help q quit"
return "Tab focus click right-click menu a actions / filter # jump ? help q quit"
}
func (m model) footerLocation() string {

View File

@ -647,11 +647,32 @@ func TestDetailModeToggleStartsFullLikeGitcrawl(t *testing.T) {
if !strings.Contains(full, "Properties") || !strings.Contains(full, "IDs") {
t.Fatalf("full detail should include metadata sections:\n%s", full)
}
m.width = 190
if !strings.Contains(stripANSI(m.View()), "d detail") {
t.Fatalf("footer should expose detail toggle:\n%s", stripANSI(m.View()))
}
}
func TestFooterControlsPrioritizeGitcrawlMuscleMemory(t *testing.T) {
full := footerControls(190)
for _, want := range []string{"right-click menu", "a actions", "header sort", "wheel scroll", "/ filter", "# jump", "r refresh", "d detail"} {
if !strings.Contains(full, want) {
t.Fatalf("wide footer missing %q:\n%s", want, full)
}
}
compact := footerControls(122)
for _, want := range []string{"right-click menu", "a actions", "wheel scroll", "/ filter", "# jump", "r refresh", "? help", "q quit"} {
if !strings.Contains(compact, want) {
t.Fatalf("compact footer missing %q:\n%s", want, compact)
}
}
for _, noisy := range []string{"o open", "c copy", "v group", "l layout"} {
if strings.Contains(compact, noisy) {
t.Fatalf("compact footer should match gitcrawl priority before app extras %q:\n%s", noisy, compact)
}
}
}
func TestChatMembersDefaultToNewestFirstLikeGitcrawl(t *testing.T) {
m := newModel(Options{
Title: "slacrawl archive",