@@ -1,7 +1,7 @@
11package layout
22
33import (
4− "github.com/charmbracelet/bubbles/v2/key"
4+ "github.com/charmbracelet/bubbles/v2/help"
55 tea "github.com/charmbracelet/bubbletea/v2"
66 "github.com/charmbracelet/crush/internal/tui/styles"
77 "github.com/charmbracelet/crush/internal/tui/util"
@@ -19,7 +19,7 @@ const (
1919type SplitPaneLayout interface {
2020 util.Model
2121 Sizeable
22− Bindings
22+ Help
2323 SetLeftPanel(panel Container) tea.Cmd
2424 SetRightPanel(panel Container) tea.Cmd
2525 SetBottomPanel(panel Container) tea.Cmd
@@ -269,24 +269,23 @@ func (s *splitPaneLayout) ClearBottomPanel() tea.Cmd {
269269 return nil
270270}
271271
272−func (s *splitPaneLayout) BindingKeys() []key.Binding {
273− keys := []key.Binding{}
272+func (s *splitPaneLayout) Help() help.KeyMap {
274273 if s.leftPanel != nil {
275− if b, ok := s.leftPanel.(Bindings); ok {
276− keys = append(keys, b.BindingKeys()...)
274+ if b, ok := s.leftPanel.(Help); ok && s.leftPanel.IsFocused() {
275+ return b.Help()
277276 }
278277 }
279278 if s.rightPanel != nil {
280− if b, ok := s.rightPanel.(Bindings); ok {
281− keys = append(keys, b.BindingKeys()...)
279+ if b, ok := s.rightPanel.(Help); ok && s.rightPanel.IsFocused() {
280+ return b.Help()
282281 }
283282 }
284283 if s.bottomPanel != nil {
285− if b, ok := s.bottomPanel.(Bindings); ok {
286− keys = append(keys, b.BindingKeys()...)
284+ if b, ok := s.bottomPanel.(Help); ok && s.bottomPanel.IsFocused() {
285+ return b.Help()
287286 }
288287 }
289− return keys
288+ return nil
290289}
291290
292291func (s *splitPaneLayout) FocusPanel(panel LayoutPanel) tea.Cmd {