@@ -1,7 +1,7 @@
1package layout
1package layout
4− "github.com/charmbracelet/bubbles/v2/key"
4+ "github.com/charmbracelet/bubbles/v2/help"
5 tea "github.com/charmbracelet/bubbletea/v2"
5 tea "github.com/charmbracelet/bubbletea/v2"
6 "github.com/charmbracelet/crush/internal/tui/styles"
6 "github.com/charmbracelet/crush/internal/tui/styles"
7 "github.com/charmbracelet/crush/internal/tui/util"
7 "github.com/charmbracelet/crush/internal/tui/util"
@@ -19,7 +19,7 @@ const (
19type SplitPaneLayout interface {
19type SplitPaneLayout interface {
20 util.Model
20 util.Model
23 SetLeftPanel(panel Container) tea.Cmd
23 SetLeftPanel(panel Container) tea.Cmd
24 SetRightPanel(panel Container) tea.Cmd
24 SetRightPanel(panel Container) tea.Cmd
25 SetBottomPanel(panel Container) tea.Cmd
25 SetBottomPanel(panel Container) tea.Cmd
@@ -269,24 +269,23 @@ func (s *splitPaneLayout) ClearBottomPanel() tea.Cmd {
269 return nil
269 return nil
272−func (s *splitPaneLayout) BindingKeys() []key.Binding {
272+func (s *splitPaneLayout) Help() help.KeyMap {
273− keys := []key.Binding{}
274 if s.leftPanel != nil {
273 if s.leftPanel != nil {
275− if b, ok := s.leftPanel.(Bindings); ok {
274+ if b, ok := s.leftPanel.(Help); ok && s.leftPanel.IsFocused() {
276− keys = append(keys, b.BindingKeys()...)
275+ return b.Help()
279 if s.rightPanel != nil {
278 if s.rightPanel != nil {
280− if b, ok := s.rightPanel.(Bindings); ok {
279+ if b, ok := s.rightPanel.(Help); ok && s.rightPanel.IsFocused() {
281− keys = append(keys, b.BindingKeys()...)
280+ return b.Help()
284 if s.bottomPanel != nil {
283 if s.bottomPanel != nil {
285− if b, ok := s.bottomPanel.(Bindings); ok {
284+ if b, ok := s.bottomPanel.(Help); ok && s.bottomPanel.IsFocused() {
286− keys = append(keys, b.BindingKeys()...)
285+ return b.Help()
289− return keys
288+ return nil
292func (s *splitPaneLayout) FocusPanel(panel LayoutPanel) tea.Cmd {
291func (s *splitPaneLayout) FocusPanel(panel LayoutPanel) tea.Cmd {