yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::AgentChatHistoryPopup Class Reference

ImGui popup drawer for displaying chat history on the left side. More...

#include <agent_chat_history_popup.h>

Collaboration diagram for yaze::editor::AgentChatHistoryPopup:

Public Types

using OpenChatCallback = std::function< void()>
 
using SendMessageCallback = std::function< void(const std::string &)>
 
using CaptureSnapshotCallback = std::function< void()>
 

Public Member Functions

 AgentChatHistoryPopup ()
 
 ~AgentChatHistoryPopup ()=default
 
void SetToastManager (ToastManager *toast_manager)
 
void Draw ()
 
void Show ()
 
void Hide ()
 
void Toggle ()
 
bool IsVisible () const
 
void UpdateHistory (const std::vector< cli::agent::ChatMessage > &history)
 
void NotifyNewMessage ()
 
void SetOpenChatCallback (OpenChatCallback callback)
 
void SetSendMessageCallback (SendMessageCallback callback)
 
void SetCaptureSnapshotCallback (CaptureSnapshotCallback callback)
 

Private Types

enum class  MessageFilter { kAll , kUserOnly , kAgentOnly }
 

Private Member Functions

void DrawHeader ()
 
void DrawMessageList ()
 
void DrawMessage (const cli::agent::ChatMessage &msg, int index)
 
void DrawInputSection ()
 
void DrawQuickActions ()
 
void SendMessage (const std::string &message)
 
void ClearHistory ()
 
void ExportHistory ()
 
void ScrollToBottom ()
 

Private Attributes

bool visible_ = false
 
bool needs_scroll_ = false
 
bool auto_scroll_ = true
 
bool compact_mode_ = true
 
bool show_quick_actions_ = true
 
std::vector< cli::agent::ChatMessagemessages_
 
int display_limit_ = 50
 
char input_buffer_ [512] = {}
 
bool focus_input_ = false
 
float drawer_width_ = 420.0f
 
float min_drawer_width_ = 300.0f
 
float max_drawer_width_ = 700.0f
 
bool is_resizing_ = false
 
MessageFilter message_filter_ = MessageFilter::kAll
 
float header_pulse_ = 0.0f
 
int unread_count_ = 0
 
float pulse_animation_ = 0.0f
 
float scanline_offset_ = 0.0f
 
float glitch_animation_ = 0.0f
 
int blink_counter_ = 0
 
ToastManagertoast_manager_ = nullptr
 
OpenChatCallback open_chat_callback_
 
SendMessageCallback send_message_callback_
 
CaptureSnapshotCallback capture_snapshot_callback_
 

Detailed Description

ImGui popup drawer for displaying chat history on the left side.

Provides a quick-access sidebar for viewing recent chat messages, complementing the ProposalDrawer on the right. Features:

  • Recent message list with timestamps
  • User/Agent message differentiation
  • Scroll to view older messages
  • Quick actions (clear, export, open full chat)
  • Syncs with AgentChatWidget and AgentEditor

Positioned on the LEFT side of the screen as a slide-out panel.

Definition at line 28 of file agent_chat_history_popup.h.

Member Typedef Documentation

◆ OpenChatCallback

Definition at line 54 of file agent_chat_history_popup.h.

◆ SendMessageCallback

using yaze::editor::AgentChatHistoryPopup::SendMessageCallback = std::function<void(const std::string&)>

Definition at line 60 of file agent_chat_history_popup.h.

◆ CaptureSnapshotCallback

Definition at line 66 of file agent_chat_history_popup.h.

Member Enumeration Documentation

◆ MessageFilter

Enumerator
kAll 
kUserOnly 
kAgentOnly 

Definition at line 104 of file agent_chat_history_popup.h.

Constructor & Destructor Documentation

◆ AgentChatHistoryPopup()

yaze::editor::AgentChatHistoryPopup::AgentChatHistoryPopup ( )

Definition at line 17 of file agent_chat_history_popup.cc.

References input_buffer_.

◆ ~AgentChatHistoryPopup()

yaze::editor::AgentChatHistoryPopup::~AgentChatHistoryPopup ( )
default

Member Function Documentation

◆ SetToastManager()

void yaze::editor::AgentChatHistoryPopup::SetToastManager ( ToastManager toast_manager)
inline

Definition at line 34 of file agent_chat_history_popup.h.

References toast_manager_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ Draw()

◆ Show()

void yaze::editor::AgentChatHistoryPopup::Show ( )
inline

Definition at line 42 of file agent_chat_history_popup.h.

References visible_.

◆ Hide()

void yaze::editor::AgentChatHistoryPopup::Hide ( )
inline

Definition at line 43 of file agent_chat_history_popup.h.

References visible_.

◆ Toggle()

void yaze::editor::AgentChatHistoryPopup::Toggle ( )
inline

◆ IsVisible()

bool yaze::editor::AgentChatHistoryPopup::IsVisible ( ) const
inline

Definition at line 45 of file agent_chat_history_popup.h.

References visible_.

◆ UpdateHistory()

void yaze::editor::AgentChatHistoryPopup::UpdateHistory ( const std::vector< cli::agent::ChatMessage > &  history)

◆ NotifyNewMessage()

void yaze::editor::AgentChatHistoryPopup::NotifyNewMessage ( )

Definition at line 449 of file agent_chat_history_popup.cc.

References auto_scroll_, ICON_MD_CHAT, yaze::editor::kInfo, needs_scroll_, yaze::editor::ToastManager::Show(), toast_manager_, and visible_.

Here is the call graph for this function:

◆ SetOpenChatCallback()

void yaze::editor::AgentChatHistoryPopup::SetOpenChatCallback ( OpenChatCallback  callback)
inline

◆ SetSendMessageCallback()

void yaze::editor::AgentChatHistoryPopup::SetSendMessageCallback ( SendMessageCallback  callback)
inline

◆ SetCaptureSnapshotCallback()

void yaze::editor::AgentChatHistoryPopup::SetCaptureSnapshotCallback ( CaptureSnapshotCallback  callback)
inline

◆ DrawHeader()

◆ DrawMessageList()

void yaze::editor::AgentChatHistoryPopup::DrawMessageList ( )
private

Definition at line 116 of file agent_chat_history_popup.cc.

References display_limit_, DrawMessage(), yaze::cli::agent::ChatMessage::kAgent, kAgentOnly, yaze::cli::agent::ChatMessage::kUser, kUserOnly, message_filter_, and messages_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawMessage()

◆ DrawInputSection()

void yaze::editor::AgentChatHistoryPopup::DrawInputSection ( )
private

Definition at line 387 of file agent_chat_history_popup.cc.

References focus_input_, ICON_MD_INFO, ICON_MD_SEND, input_buffer_, and SendMessage().

Referenced by Draw().

Here is the call graph for this function:

◆ DrawQuickActions()

void yaze::editor::AgentChatHistoryPopup::DrawQuickActions ( )
private

◆ SendMessage()

void yaze::editor::AgentChatHistoryPopup::SendMessage ( const std::string &  message)
private

Definition at line 424 of file agent_chat_history_popup.cc.

References ICON_MD_SEND, yaze::editor::kSuccess, needs_scroll_, send_message_callback_, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by DrawInputSection().

Here is the call graph for this function:

◆ ClearHistory()

void yaze::editor::AgentChatHistoryPopup::ClearHistory ( )
private

Definition at line 460 of file agent_chat_history_popup.cc.

References yaze::editor::kInfo, messages_, yaze::editor::ToastManager::Show(), and toast_manager_.

Referenced by DrawQuickActions().

Here is the call graph for this function:

◆ ExportHistory()

void yaze::editor::AgentChatHistoryPopup::ExportHistory ( )
private
Todo:
Implement export functionality

Definition at line 468 of file agent_chat_history_popup.cc.

References yaze::editor::kInfo, yaze::editor::ToastManager::Show(), and toast_manager_.

Here is the call graph for this function:

◆ ScrollToBottom()

void yaze::editor::AgentChatHistoryPopup::ScrollToBottom ( )
private

Definition at line 475 of file agent_chat_history_popup.cc.

References needs_scroll_.

Member Data Documentation

◆ visible_

bool yaze::editor::AgentChatHistoryPopup::visible_ = false
private

◆ needs_scroll_

bool yaze::editor::AgentChatHistoryPopup::needs_scroll_ = false
private

◆ auto_scroll_

bool yaze::editor::AgentChatHistoryPopup::auto_scroll_ = true
private

Definition at line 85 of file agent_chat_history_popup.h.

Referenced by NotifyNewMessage(), and UpdateHistory().

◆ compact_mode_

bool yaze::editor::AgentChatHistoryPopup::compact_mode_ = true
private

Definition at line 86 of file agent_chat_history_popup.h.

Referenced by DrawHeader().

◆ show_quick_actions_

bool yaze::editor::AgentChatHistoryPopup::show_quick_actions_ = true
private

Definition at line 87 of file agent_chat_history_popup.h.

Referenced by Draw().

◆ messages_

std::vector<cli::agent::ChatMessage> yaze::editor::AgentChatHistoryPopup::messages_
private

◆ display_limit_

int yaze::editor::AgentChatHistoryPopup::display_limit_ = 50
private

Definition at line 91 of file agent_chat_history_popup.h.

Referenced by DrawMessageList().

◆ input_buffer_

char yaze::editor::AgentChatHistoryPopup::input_buffer_[512] = {}
private

Definition at line 94 of file agent_chat_history_popup.h.

Referenced by AgentChatHistoryPopup(), and DrawInputSection().

◆ focus_input_

bool yaze::editor::AgentChatHistoryPopup::focus_input_ = false
private

Definition at line 95 of file agent_chat_history_popup.h.

Referenced by DrawInputSection().

◆ drawer_width_

float yaze::editor::AgentChatHistoryPopup::drawer_width_ = 420.0f
private

Definition at line 98 of file agent_chat_history_popup.h.

Referenced by Draw().

◆ min_drawer_width_

float yaze::editor::AgentChatHistoryPopup::min_drawer_width_ = 300.0f
private

Definition at line 99 of file agent_chat_history_popup.h.

◆ max_drawer_width_

float yaze::editor::AgentChatHistoryPopup::max_drawer_width_ = 700.0f
private

Definition at line 100 of file agent_chat_history_popup.h.

◆ is_resizing_

bool yaze::editor::AgentChatHistoryPopup::is_resizing_ = false
private

Definition at line 101 of file agent_chat_history_popup.h.

◆ message_filter_

MessageFilter yaze::editor::AgentChatHistoryPopup::message_filter_ = MessageFilter::kAll
private

Definition at line 109 of file agent_chat_history_popup.h.

Referenced by DrawHeader(), DrawMessageList(), and DrawQuickActions().

◆ header_pulse_

float yaze::editor::AgentChatHistoryPopup::header_pulse_ = 0.0f
private

Definition at line 112 of file agent_chat_history_popup.h.

◆ unread_count_

int yaze::editor::AgentChatHistoryPopup::unread_count_ = 0
private

Definition at line 113 of file agent_chat_history_popup.h.

Referenced by DrawHeader().

◆ pulse_animation_

float yaze::editor::AgentChatHistoryPopup::pulse_animation_ = 0.0f
private

Definition at line 116 of file agent_chat_history_popup.h.

Referenced by Draw(), DrawHeader(), and DrawMessage().

◆ scanline_offset_

float yaze::editor::AgentChatHistoryPopup::scanline_offset_ = 0.0f
private

Definition at line 117 of file agent_chat_history_popup.h.

Referenced by Draw().

◆ glitch_animation_

float yaze::editor::AgentChatHistoryPopup::glitch_animation_ = 0.0f
private

Definition at line 118 of file agent_chat_history_popup.h.

Referenced by Draw().

◆ blink_counter_

int yaze::editor::AgentChatHistoryPopup::blink_counter_ = 0
private

Definition at line 119 of file agent_chat_history_popup.h.

Referenced by Draw(), and DrawHeader().

◆ toast_manager_

ToastManager* yaze::editor::AgentChatHistoryPopup::toast_manager_ = nullptr
private

◆ open_chat_callback_

OpenChatCallback yaze::editor::AgentChatHistoryPopup::open_chat_callback_
private

Definition at line 123 of file agent_chat_history_popup.h.

Referenced by DrawHeader(), and SetOpenChatCallback().

◆ send_message_callback_

SendMessageCallback yaze::editor::AgentChatHistoryPopup::send_message_callback_
private

Definition at line 124 of file agent_chat_history_popup.h.

Referenced by SendMessage(), and SetSendMessageCallback().

◆ capture_snapshot_callback_

CaptureSnapshotCallback yaze::editor::AgentChatHistoryPopup::capture_snapshot_callback_
private

Definition at line 125 of file agent_chat_history_popup.h.

Referenced by DrawQuickActions(), and SetCaptureSnapshotCallback().


The documentation for this class was generated from the following files: