Class: RubyCoded::Chat::Renderer

Inherits:
Object
  • Object
show all
Includes:
ChatPanel, ChatPanelInput, ChatPanelThinking, LoginFlow, LoginFlowLayout, ModelSelector, PlanClarifier, PlanClarifierLayout, StatusBar
Defined in:
lib/ruby_coded/chat/renderer.rb,
lib/ruby_coded/chat/renderer/chat_panel.rb,
lib/ruby_coded/chat/renderer/login_flow.rb,
lib/ruby_coded/chat/renderer/status_bar.rb,
lib/ruby_coded/chat/renderer/model_selector.rb,
lib/ruby_coded/chat/renderer/plan_clarifier.rb,
lib/ruby_coded/chat/renderer/chat_panel_input.rb,
lib/ruby_coded/chat/renderer/login_flow_layout.rb,
lib/ruby_coded/chat/renderer/chat_panel_thinking.rb,
lib/ruby_coded/chat/renderer/plan_clarifier_layout.rb

Overview

This class manages the rendering of the UI elements

Defined Under Namespace

Modules: ChatPanel, ChatPanelInput, ChatPanelThinking, LoginFlow, LoginFlowLayout, ModelSelector, PlanClarifier, PlanClarifierLayout, StatusBar

Constant Summary

Constants included from ChatPanelInput

ChatPanelInput::INPUT_PREFIX

Constants included from ChatPanelThinking

ChatPanelThinking::MAX_THINKING_MESSAGES, ChatPanelThinking::THINK_CLOSE, ChatPanelThinking::THINK_OPEN, ChatPanelThinking::TOOL_ROLES

Instance Method Summary collapse

Constructor Details

#initialize(tui, state) ⇒ Renderer

Returns a new instance of Renderer.



27
28
29
30
# File 'lib/ruby_coded/chat/renderer.rb', line 27

def initialize(tui, state)
  @tui = tui
  @state = state
end

Instance Method Details

#drawObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ruby_coded/chat/renderer.rb', line 32

def draw
  @tui.clear

  @tui.draw do |frame|
    chat_area, status_area, input_area = main_layout(frame)
    render_chat_panel(frame, chat_area)
    render_status_bar(frame, status_area)
    render_input_panel(frame, input_area)
    render_overlays(frame, chat_area, input_area)
  end
end