yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
agent_chat_history_popup.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_POPUP_H
2
#define YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_POPUP_H
3
4
#include <string>
5
#include <vector>
6
7
#include "
cli/service/agent/conversational_agent_service.h
"
8
9
namespace
yaze
{
10
namespace
editor {
11
12
class
ToastManager;
13
28
class
AgentChatHistoryPopup
{
29
public
:
30
AgentChatHistoryPopup
();
31
~AgentChatHistoryPopup
() =
default
;
32
33
// Set dependencies
34
void
SetToastManager
(
ToastManager
* toast_manager) {
35
toast_manager_
= toast_manager;
36
}
37
38
// Render the popup UI
39
void
Draw
();
40
41
// Show/hide the popup
42
void
Show
() {
visible_
=
true
; }
43
void
Hide
() {
visible_
=
false
; }
44
void
Toggle
() {
visible_
= !
visible_
; }
45
bool
IsVisible
()
const
{
return
visible_
; }
46
47
// Update history from service
48
void
UpdateHistory
(
const
std::vector<cli::agent::ChatMessage>& history);
49
50
// Notify of new message (triggers auto-scroll)
51
void
NotifyNewMessage
();
52
53
// Set callback for opening full chat window
54
using
OpenChatCallback
= std::function<void()>;
55
void
SetOpenChatCallback
(
OpenChatCallback
callback) {
56
open_chat_callback_
= std::move(callback);
57
}
58
59
// Set callback for sending messages
60
using
SendMessageCallback
= std::function<void(
const
std::string&)>;
61
void
SetSendMessageCallback
(
SendMessageCallback
callback) {
62
send_message_callback_
= std::move(callback);
63
}
64
65
// Set callback for capturing snapshots
66
using
CaptureSnapshotCallback
= std::function<void()>;
67
void
SetCaptureSnapshotCallback
(
CaptureSnapshotCallback
callback) {
68
capture_snapshot_callback_
= std::move(callback);
69
}
70
71
private
:
72
void
DrawHeader
();
73
void
DrawMessageList
();
74
void
DrawMessage
(
const
cli::agent::ChatMessage
& msg,
int
index);
75
void
DrawInputSection
();
76
void
DrawQuickActions
();
77
78
void
SendMessage
(
const
std::string& message);
79
void
ClearHistory
();
80
void
ExportHistory
();
81
void
ScrollToBottom
();
82
83
bool
visible_
=
false
;
84
bool
needs_scroll_
=
false
;
85
bool
auto_scroll_
=
true
;
86
bool
compact_mode_
=
true
;
87
bool
show_quick_actions_
=
true
;
88
89
// History state
90
std::vector<cli::agent::ChatMessage>
messages_
;
91
int
display_limit_
= 50;
// Show last 50 messages
92
93
// Input state
94
char
input_buffer_
[512] = {};
95
bool
focus_input_
=
false
;
96
97
// UI state
98
float
drawer_width_
= 420.0f;
99
float
min_drawer_width_
= 300.0f;
100
float
max_drawer_width_
= 700.0f;
101
bool
is_resizing_
=
false
;
102
103
// Filter state
104
enum class
MessageFilter
{
105
kAll
,
106
kUserOnly
,
107
kAgentOnly
108
};
109
MessageFilter
message_filter_
=
MessageFilter::kAll
;
110
111
// Visual state
112
float
header_pulse_
= 0.0f;
113
int
unread_count_
= 0;
114
115
// Retro hacker aesthetic animations
116
float
pulse_animation_
= 0.0f;
117
float
scanline_offset_
= 0.0f;
118
float
glitch_animation_
= 0.0f;
119
int
blink_counter_
= 0;
120
121
// Dependencies
122
ToastManager
*
toast_manager_
=
nullptr
;
123
OpenChatCallback
open_chat_callback_
;
124
SendMessageCallback
send_message_callback_
;
125
CaptureSnapshotCallback
capture_snapshot_callback_
;
126
};
127
128
}
// namespace editor
129
}
// namespace yaze
130
131
#endif
// YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_POPUP_H
yaze::editor::AgentChatHistoryPopup
ImGui popup drawer for displaying chat history on the left side.
Definition
agent_chat_history_popup.h:28
yaze::editor::AgentChatHistoryPopup::SetCaptureSnapshotCallback
void SetCaptureSnapshotCallback(CaptureSnapshotCallback callback)
Definition
agent_chat_history_popup.h:67
yaze::editor::AgentChatHistoryPopup::unread_count_
int unread_count_
Definition
agent_chat_history_popup.h:113
yaze::editor::AgentChatHistoryPopup::Hide
void Hide()
Definition
agent_chat_history_popup.h:43
yaze::editor::AgentChatHistoryPopup::~AgentChatHistoryPopup
~AgentChatHistoryPopup()=default
yaze::editor::AgentChatHistoryPopup::compact_mode_
bool compact_mode_
Definition
agent_chat_history_popup.h:86
yaze::editor::AgentChatHistoryPopup::SetSendMessageCallback
void SetSendMessageCallback(SendMessageCallback callback)
Definition
agent_chat_history_popup.h:61
yaze::editor::AgentChatHistoryPopup::DrawHeader
void DrawHeader()
Definition
agent_chat_history_popup.cc:207
yaze::editor::AgentChatHistoryPopup::DrawInputSection
void DrawInputSection()
Definition
agent_chat_history_popup.cc:387
yaze::editor::AgentChatHistoryPopup::SetToastManager
void SetToastManager(ToastManager *toast_manager)
Definition
agent_chat_history_popup.h:34
yaze::editor::AgentChatHistoryPopup::AgentChatHistoryPopup
AgentChatHistoryPopup()
Definition
agent_chat_history_popup.cc:17
yaze::editor::AgentChatHistoryPopup::DrawQuickActions
void DrawQuickActions()
Definition
agent_chat_history_popup.cc:323
yaze::editor::AgentChatHistoryPopup::message_filter_
MessageFilter message_filter_
Definition
agent_chat_history_popup.h:109
yaze::editor::AgentChatHistoryPopup::SendMessageCallback
std::function< void(const std::string &)> SendMessageCallback
Definition
agent_chat_history_popup.h:60
yaze::editor::AgentChatHistoryPopup::OpenChatCallback
std::function< void()> OpenChatCallback
Definition
agent_chat_history_popup.h:54
yaze::editor::AgentChatHistoryPopup::display_limit_
int display_limit_
Definition
agent_chat_history_popup.h:91
yaze::editor::AgentChatHistoryPopup::drawer_width_
float drawer_width_
Definition
agent_chat_history_popup.h:98
yaze::editor::AgentChatHistoryPopup::IsVisible
bool IsVisible() const
Definition
agent_chat_history_popup.h:45
yaze::editor::AgentChatHistoryPopup::SendMessage
void SendMessage(const std::string &message)
Definition
agent_chat_history_popup.cc:424
yaze::editor::AgentChatHistoryPopup::capture_snapshot_callback_
CaptureSnapshotCallback capture_snapshot_callback_
Definition
agent_chat_history_popup.h:125
yaze::editor::AgentChatHistoryPopup::toast_manager_
ToastManager * toast_manager_
Definition
agent_chat_history_popup.h:122
yaze::editor::AgentChatHistoryPopup::ExportHistory
void ExportHistory()
Definition
agent_chat_history_popup.cc:468
yaze::editor::AgentChatHistoryPopup::NotifyNewMessage
void NotifyNewMessage()
Definition
agent_chat_history_popup.cc:449
yaze::editor::AgentChatHistoryPopup::UpdateHistory
void UpdateHistory(const std::vector< cli::agent::ChatMessage > &history)
Definition
agent_chat_history_popup.cc:437
yaze::editor::AgentChatHistoryPopup::min_drawer_width_
float min_drawer_width_
Definition
agent_chat_history_popup.h:99
yaze::editor::AgentChatHistoryPopup::pulse_animation_
float pulse_animation_
Definition
agent_chat_history_popup.h:116
yaze::editor::AgentChatHistoryPopup::ScrollToBottom
void ScrollToBottom()
Definition
agent_chat_history_popup.cc:475
yaze::editor::AgentChatHistoryPopup::needs_scroll_
bool needs_scroll_
Definition
agent_chat_history_popup.h:84
yaze::editor::AgentChatHistoryPopup::max_drawer_width_
float max_drawer_width_
Definition
agent_chat_history_popup.h:100
yaze::editor::AgentChatHistoryPopup::send_message_callback_
SendMessageCallback send_message_callback_
Definition
agent_chat_history_popup.h:124
yaze::editor::AgentChatHistoryPopup::Show
void Show()
Definition
agent_chat_history_popup.h:42
yaze::editor::AgentChatHistoryPopup::auto_scroll_
bool auto_scroll_
Definition
agent_chat_history_popup.h:85
yaze::editor::AgentChatHistoryPopup::DrawMessageList
void DrawMessageList()
Definition
agent_chat_history_popup.cc:116
yaze::editor::AgentChatHistoryPopup::blink_counter_
int blink_counter_
Definition
agent_chat_history_popup.h:119
yaze::editor::AgentChatHistoryPopup::CaptureSnapshotCallback
std::function< void()> CaptureSnapshotCallback
Definition
agent_chat_history_popup.h:66
yaze::editor::AgentChatHistoryPopup::DrawMessage
void DrawMessage(const cli::agent::ChatMessage &msg, int index)
Definition
agent_chat_history_popup.cc:142
yaze::editor::AgentChatHistoryPopup::show_quick_actions_
bool show_quick_actions_
Definition
agent_chat_history_popup.h:87
yaze::editor::AgentChatHistoryPopup::input_buffer_
char input_buffer_[512]
Definition
agent_chat_history_popup.h:94
yaze::editor::AgentChatHistoryPopup::is_resizing_
bool is_resizing_
Definition
agent_chat_history_popup.h:101
yaze::editor::AgentChatHistoryPopup::Toggle
void Toggle()
Definition
agent_chat_history_popup.h:44
yaze::editor::AgentChatHistoryPopup::focus_input_
bool focus_input_
Definition
agent_chat_history_popup.h:95
yaze::editor::AgentChatHistoryPopup::scanline_offset_
float scanline_offset_
Definition
agent_chat_history_popup.h:117
yaze::editor::AgentChatHistoryPopup::ClearHistory
void ClearHistory()
Definition
agent_chat_history_popup.cc:460
yaze::editor::AgentChatHistoryPopup::SetOpenChatCallback
void SetOpenChatCallback(OpenChatCallback callback)
Definition
agent_chat_history_popup.h:55
yaze::editor::AgentChatHistoryPopup::open_chat_callback_
OpenChatCallback open_chat_callback_
Definition
agent_chat_history_popup.h:123
yaze::editor::AgentChatHistoryPopup::messages_
std::vector< cli::agent::ChatMessage > messages_
Definition
agent_chat_history_popup.h:90
yaze::editor::AgentChatHistoryPopup::Draw
void Draw()
Definition
agent_chat_history_popup.cc:21
yaze::editor::AgentChatHistoryPopup::glitch_animation_
float glitch_animation_
Definition
agent_chat_history_popup.h:118
yaze::editor::AgentChatHistoryPopup::visible_
bool visible_
Definition
agent_chat_history_popup.h:83
yaze::editor::AgentChatHistoryPopup::MessageFilter
MessageFilter
Definition
agent_chat_history_popup.h:104
yaze::editor::AgentChatHistoryPopup::MessageFilter::kUserOnly
@ kUserOnly
yaze::editor::AgentChatHistoryPopup::MessageFilter::kAll
@ kAll
yaze::editor::AgentChatHistoryPopup::MessageFilter::kAgentOnly
@ kAgentOnly
yaze::editor::AgentChatHistoryPopup::header_pulse_
float header_pulse_
Definition
agent_chat_history_popup.h:112
yaze::editor::ToastManager
Definition
toast_manager.h:25
conversational_agent_service.h
yaze
Main namespace for the application.
Definition
asar_wrapper.cc:14
yaze::cli::agent::ChatMessage
Definition
conversational_agent_service.h:23
src
app
editor
agent
agent_chat_history_popup.h
Generated by
1.9.8