Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (k KeyMap) FullHelp() [][]key.Binding {
{k.FocusBacklog, k.FocusInProgress, k.FocusBlocked, k.FocusDone},
{k.Enter, k.New, k.Queue, k.Close},
{k.Retry, k.Archive, k.Delete, k.OpenWorktree},
{k.Filter, k.CommandPalette, k.Settings, k.ToggleShellPane},
{k.Filter, k.CommandPalette, k.Settings},
{k.ChangeStatus, k.TogglePin, k.Refresh, k.Help},
{k.Quit},
}
Expand Down
6 changes: 6 additions & 0 deletions internal/ui/detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -2490,6 +2490,12 @@ func (m *DetailModel) renderHelp() string {
// Show pane navigation shortcut when panes are visible
if hasPanes && os.Getenv("TMUX") != "" {
keys = append(keys, helpKey{"shift+" + IconArrowUp() + IconArrowDown(), "switch pane", false})
// Show shell pane toggle shortcut
toggleDesc := "hide shell"
if m.shellPaneHidden {
toggleDesc = "show shell"
}
keys = append(keys, helpKey{"\\", toggleDesc, false})
}

// Show jump to notification shortcut when there's an active notification
Expand Down
67 changes: 67 additions & 0 deletions internal/ui/detail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,70 @@ func TestDetailModel_HasNotification(t *testing.T) {
})
}
}

// TestDetailModel_IsShellPaneHidden verifies the shell pane hidden state accessor.
func TestDetailModel_IsShellPaneHidden(t *testing.T) {
task := &db.Task{ID: 1, Title: "Test task"}

tests := []struct {
name string
shellPaneHidden bool
want bool
}{
{
name: "shell pane visible",
shellPaneHidden: false,
want: false,
},
{
name: "shell pane hidden",
shellPaneHidden: true,
want: true,
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
m := &DetailModel{task: task, shellPaneHidden: tt.shellPaneHidden}

got := m.IsShellPaneHidden()
if got != tt.want {
t.Errorf("IsShellPaneHidden() = %v, want %v", got, tt.want)
}
})
}
}

// TestDetailModel_ToggleShellPaneKeyBinding verifies that the shell pane toggle
// key binding (\) is properly defined and accessible.
func TestDetailModel_ToggleShellPaneKeyBinding(t *testing.T) {
// Verify the key binding exists and uses the backslash key
keys := DefaultKeyMap()

// Check that ToggleShellPane binding is set to backslash
bindings := keys.ToggleShellPane.Keys()
if len(bindings) == 0 {
t.Fatal("ToggleShellPane key binding has no keys")
}

found := false
for _, k := range bindings {
if k == "\\" {
found = true
break
}
}

if !found {
t.Errorf("ToggleShellPane key binding expected '\\', got %v", bindings)
}

// Verify help text is set
help := keys.ToggleShellPane.Help()
if help.Key != "\\" {
t.Errorf("ToggleShellPane help key expected '\\', got %q", help.Key)
}
if help.Desc != "toggle shell" {
t.Errorf("ToggleShellPane help desc expected 'toggle shell', got %q", help.Desc)
}
}