feat: Add Agent Chat History Popup for Enhanced User Interaction

- Introduced the AgentChatHistoryPopup class to provide a sidebar for displaying recent chat messages, improving accessibility and user experience.
- Implemented message filtering options (All, User Only, Agent Only) and auto-scroll functionality for better message management.
- Enhanced the AgentChatWidget to synchronize chat history with the new popup, ensuring users have up-to-date information at their fingertips.
- Updated CMake configuration to include the new build_cleaner target for improved project maintenance.
This commit is contained in:
scawful
2025-10-05 05:31:07 -04:00
parent e490dea2e5
commit 2aeb384034
6 changed files with 372 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ namespace editor {
class ProposalDrawer;
class ToastManager;
class AgentChatHistoryPopup;
/**
* @class AgentChatWidget
@@ -86,6 +87,8 @@ class AgentChatWidget {
void SetToastManager(ToastManager* toast_manager);
void SetProposalDrawer(ProposalDrawer* drawer);
void SetChatHistoryPopup(AgentChatHistoryPopup* popup);
void SetCollaborationCallbacks(const CollaborationCallbacks& callbacks) {
collaboration_callbacks_ = callbacks;
@@ -228,6 +231,9 @@ public:
void HandleRomSyncReceived(const std::string& diff_data, const std::string& rom_hash);
void HandleSnapshotReceived(const std::string& snapshot_data, const std::string& snapshot_type);
void HandleProposalReceived(const std::string& proposal_data);
// History synchronization
void SyncHistoryToPopup();
// Chat session management
struct ChatSession {
@@ -261,6 +267,7 @@ public:
int last_proposal_count_ = 0;
ToastManager* toast_manager_ = nullptr;
ProposalDrawer* proposal_drawer_ = nullptr;
AgentChatHistoryPopup* chat_history_popup_ = nullptr;
std::string pending_focus_proposal_id_;
absl::Time last_persist_time_ = absl::InfinitePast();