Class: Binocs::TUI::HelpScreen

Inherits:
Window
  • Object
show all
Defined in:
lib/binocs/tui/help_screen.rb

Constant Summary collapse

KEYBINDINGS =
[
  ['Navigation', [
    ['j / ↓', 'Move down / Scroll down'],
    ['k / ↑', 'Move up / Scroll up'],
    ['g / Home', 'Go to top'],
    ['G / End', 'Go to bottom'],
    ['Ctrl+d/n / PgDn', 'Page down'],
    ['Ctrl+u/p / PgUp', 'Page up'],
  ]],
  ['Actions', [
    ['Enter / l', 'View request details'],
    ['h / Esc', 'Go back / Close'],
    ['n / J', 'Next request (detail view)'],
    ['p / K', 'Prev request (detail view)'],
    ['d', 'Delete request'],
    ['D', 'Delete all requests'],
    ['a', 'View all agents (from list)'],
  ]],
  ['Tabs (Detail View)', [
    ['Tab / ] / L', 'Next tab'],
    ['Shift+Tab / [ / H', 'Previous tab'],
    ['1-8', 'Jump to tab by number'],
    ['a', 'Agent tab + start input'],
    ['c', 'Copy tab content to clipboard'],
    ['o', 'Open Swagger docs in browser'],
  ]],
  ['Agent Tab', [
    ['i / Enter', 'Start composing prompt'],
    ['j / k', 'Scroll output up/down'],
    ['t', 'Change AI tool (Claude/OpenCode)'],
    ['w', 'Toggle worktree mode'],
    ['s', 'Stop running agent'],
    ['Esc', 'Cancel input'],
  ]],
  ['Agents View', [
    ['Enter', 'Go to request Agent tab'],
    ['l', 'View raw log output'],
    ['d', 'Delete/cleanup agent'],
    ['o', 'Open worktree folder'],
    ['r', 'Refresh agents list'],
  ]],
  ['Sequence View', [
    ['s', 'Enter sequence diagram'],
    ['[ / ]', 'Switch client'],
    ['j / k', 'Navigate requests'],
    ['Enter / l', 'View request detail'],
    ['c', 'Copy screen contents'],
    ['Esc / h / ←', 'Return to list'],
  ]],
  ['Endpoints View', [
    ['e', 'Enter endpoints view'],
    ['j / k', 'Navigate endpoints'],
    ['Enter / l', 'Filter list to endpoint'],
    ['c', 'Copy screen contents'],
    ['r', 'Refresh data'],
    ['Esc / h / ←', 'Return to list'],
  ]],
  ['Filtering', [
    ['/', 'Search by path'],
    ['f', 'Open filter menu'],
    ['c', 'Clear all filters'],
  ]],
  ['Other', [
    ['r', 'Refresh list'],
    ['?', 'Toggle this help'],
    ['Space s', 'Spirit animal (detail view)'],
    ['q', 'Quit'],
  ]],
].freeze

Instance Attribute Summary

Attributes inherited from Window

#height, #left, #top, #width, #win

Instance Method Summary collapse

Methods inherited from Window

#clear, #close, #copy_to_clipboard, #draw_box, #initialize, #noutrefresh, #refresh, #resize, #write, #write_centered

Constructor Details

This class inherits a constructor from Binocs::TUI::Window

Instance Method Details

#drawObject



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/binocs/tui/help_screen.rb', line 76

def draw
  clear
  draw_box('Help - Keybindings')

  y = 2
  KEYBINDINGS.each do |section_name, bindings|
    # Section header
    write(y, 3, "── #{section_name} ", Colors::HEADER, Curses::A_BOLD)
    y += 1

    bindings.each do |key, description|
      # Key
      @win.attron(Curses.color_pair(Colors::KEY_HINT) | Curses::A_BOLD) do
        @win.setpos(y, 4)
        @win.addstr(key.ljust(16))
      end

      # Description
      write(y, 21, description, Colors::NORMAL)
      y += 1
    end

    y += 1
    break if y >= @height - 3
  end

  # Footer
  write(@height - 2, 3, 'Press ? or Esc to close', Colors::MUTED, Curses::A_DIM)

  refresh
end